Fixed amb1594 - SetPlayerClass issues with spawning
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402034
This commit is contained in:
parent
70301419b1
commit
dcb9efa131
@ -98,6 +98,8 @@ stock TFClassType:TF2_GetPlayerClass(client)
|
|||||||
/**
|
/**
|
||||||
* Set's a Clients class.
|
* Set's a Clients class.
|
||||||
*
|
*
|
||||||
|
* Note: If setting player class in a player spawn hook weapons should be set to false.
|
||||||
|
*
|
||||||
* @param client Player's index.
|
* @param client Player's index.
|
||||||
* @param class TFClassType class symbol.
|
* @param class TFClassType class symbol.
|
||||||
* @param weapons If true, changes the players weapon set to that of the new class.
|
* @param weapons If true, changes the players weapon set to that of the new class.
|
||||||
@ -110,7 +112,7 @@ stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true)
|
|||||||
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
|
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
|
||||||
TF2_SetPlayerResourceData(client, TFResource_PlayerClass, class);
|
TF2_SetPlayerResourceData(client, TFResource_PlayerClass, class);
|
||||||
|
|
||||||
if (weapons)
|
if (weapons && IsPlayerAlive(client))
|
||||||
{
|
{
|
||||||
TF2_RemoveAllWeapons(client);
|
TF2_RemoveAllWeapons(client);
|
||||||
TF2_EquipPlayerClassWeapons(client, class);
|
TF2_EquipPlayerClassWeapons(client, class);
|
||||||
|
Loading…
Reference in New Issue
Block a user