PHP Code:
Handle g_hSpawnTimer[MAXPLAYERS+1];
public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
ClearHandle(g_hSpawnTimer);
g_hSpawnTimer = 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
}
}
}
stock void ClearHandle(Handle& hndl)
{
if(hndl != null)
{
delete hndl;
hndl = null;
}
}
__________________