1.1 --- a/plugins/include/tf2_stocks.inc Wed Apr 16 05:27:09 2008 +0000
1.2 +++ b/plugins/include/tf2_stocks.inc Wed Apr 16 05:41:34 2008 +0000
1.3 @@ -103,15 +103,20 @@
1.4 * @param client Player's index.
1.5 * @param class TFClassType class symbol.
1.6 * @param weapons If true, changes the players weapon set to that of the new class.
1.7 + * @param persistant If true changes the players desired class so the change stays after death.
1.8 * @noreturn
1.9 * @error Invalid client index.
1.10 */
1.11 -stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true)
1.12 +stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true, bool:persistant=true)
1.13 {
1.14 SetEntProp(client, Prop_Send, "m_iClass", _:class);
1.15 - SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
1.16 TF2_SetPlayerResourceData(client, TFResource_PlayerClass, class);
1.17
1.18 + if (persistant)
1.19 + {
1.20 + SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
1.21 + }
1.22 +
1.23 if (weapons && IsPlayerAlive(client))
1.24 {
1.25 TF2_RemoveAllWeapons(client);