I was trying to give all players an item everytime they spawn. But it seems only me who receive it.
PHP Code:
RegisterHam(Ham_Spawn, "player", "fwd_spawn", 1)
PHP Code:
public fwd_spawn(id)
{
new players[32], num
get_players(players, num, "ae", "T")
if (!is_user_alive(id))
if (get_cvar_num("health_enable") == 1)
{
set_user_health(id, 120)
}
new weapon = get_user_weapon(id)
if (is_user_alive(id))
{
acg_drawoverviewradar(id, 1, 0, 0, 180, 180, 255, 255, 255)
g_bEnabled[id] = 1
acg_showteammate(id, 1)
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
give_item(id, "weapon_hegrenade")
cs_set_user_bpammo(id, CSW_HEGRENADE, 2)
for(new i = 0; i < num; i++)
{
give_item(players[id], "weapon_m4a1")
}
}
if (weapon == CSW_HEGRENADE)
{
cs_set_weapon_ammo(id, 2)
}
return PLUGIN_CONTINUE
}