You can search in other peoples plugins for that or use NetProps, good for starters.
PHP Code:
/**
* Is client Incapacitated (L4D)
*/
stock bool:Client_IsInIncapped(client)
{
return (GetEntProp(client, Prop_Send, "m_isIncapacitated", 1) > 0);
}
PHP Code:
public OnPluginStart()
{
RegConsoleCmd("sm_join", Jointeam2);
RegConsoleCmd("sm_afk", Spectate);
}
public Action:Jointeam2(client, args)
{
if(!IsValidClient(client) || IsClientIncapped(client))
return Plugin_Handled;
FakeClientCommand(client,"jointeam 2");
return Plugin_Handled;
}
public Action:Spectate(client, args)
{
if(!IsValidClient(client) || IsClientIncapped(client))
return Plugin_Handled;
ChangeClientTeam(client, 1);
return Plugin_Handled;
}
stock bool:IsValidClient(client)
{
return (client > 0
&& client <= MaxClients
&& IsClientInGame(client));
}
stock bool:IsClientIncapped(client)
{
return (GetEntProp(client, Prop_Send, "m_isIncapacitated", 1) > 0);
}