Code:
new bool:u_died[33]
...
public plugin_init()
{
...
RegisterHam(Ham_Spawn, "player", "giveweap", 1)
...
RegisterHam(Ham_Killed, "player", "fn_PlayerKilled_post", 1)
...
}
...
public fn_PlayerKilled_post(victim, attacker, shouldgib)
{
u_died[victim] = true
}
...
public giveweap(id)
{
if(is_user_alive(id) && !is_user_bot(id) && u_died[id])
{
u_died[id] = false
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
if(cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "weapon_usp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
}
else
if(cs_get_user_team(id) == CS_TEAM_T) // what if spawned as spectator / unassigned?
{
give_item(id,"weapon_glock18")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
}
}
}