Hi guys,
I have question how to set player to ghost without killing.
Example:
1) Player is alive on round end,
2) move this player to ghost without kill,
3) swap teams
I need to use to change player state:
PHP Code:
SetEntProp(client, Prop_Send, "m_lifeState", 2); <-- what state is 2 value ?
second I need to remove weapons and other thinks, then change player team.
Anyone can help me with this problem ?
CODE
PHP Code:
public void OnRoundEnd(Handle event, const char[] name, bool dontBroadcast)
{
for(int client = 0; client < MaxClients; client++)
{
if(client > 0 && IsClientConnected(client) && IsClientInGame(client))
{
int team = GetClientTeam(client);
if(team > CS_TEAM_SPECTATOR)
SwappTeams(client, InversePlayableTeam(team));
}
}
}
public void SwappTeam(int client, int team)
{
SetEntProp(client, Prop_Send, "m_lifeState", 2);
CS_SwitchTeam(client, team);
}
stock int InversePlayableTeam(int team)
{
if(team == CS_TEAM_T)
return CS_TEAM_CT;
return CS_TEAM_T;
}
Regards,
Nerus.