PHP Code:
public void OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
}
public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if (client)
{
if (CheckCommandAccess(client, "", ADMFLAG_RESERVATION, true))
{
RemoveClientGrenades(client);
}
}
}
void RemoveClientGrenades(int client)
{
int ent = -1;
while ((ent = GetPlayerWeaponSlot(client, CS_SLOT_GRENADE)) != -1)
{
RemovePlayerItem(client, ent);
RemoveEntity(ent);
}
}
Use the new syntax.
round_end it's a general thing, it's not like player_death, player_spawn, player_hurt etc, so it doesn't have "userid" param.
__________________