Hi, how can I execute a code when a player gets to Spectator?
I tried this but it didnt work, probably because its hooking player_death only I think.
PHP Code:
HookEvent("player_death", Trails_PlayerDeath);
Code:
public Action:Trails_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!IsPlayerAlive(client) && IsClientInGame(client) && GetClientTeam(client) == 3)
for(new i=0;i<STORE_MAX_SLOTS;++i)
RemoveTrail(client, i);
return Plugin_Continue;
}
How can I do it properly? so it executes RemoveTrail once a player changes team to spectator?
Thanks