Hi.
I have a strange issue.
Code:
public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(1.0, Stuff, client);
}
public Action Stuff(Handle timer, any client)
{
if (client > 0 && IsPlayerAlive(client) && IsClientConnected(client))
{
if (IsPlayerGenericAdmin(client))
{
SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 1); //armor
SetEntProp(client, Prop_Send, "m_bHasHelmet", 1); //helmet
GivePlayerItem(client, "weapon_hegrenade"); //grenade
GivePlayerItem(client, "weapon_flashbang"); //flash
CPrintToChatAll("{red}%N {orange} jest graczem {purple}Premium{orange}!", client);
}else
{
SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 1); //armor
SetEntProp(client, Prop_Send, "m_bHasHelmet", 0); //helmet
}
}
}
I create timer on event spawn. It should run only once, yes?
In the first round, I get my grenades once. But in second round and later, procedure Stuff is called twice. Why?