Here's the exact way I used it:
Code:
public join_respawn()
{
if(surfmap == false)
{
return PLUGIN_CONTINUE
}
if(get_cvar_num("surf_on")==0)
{
return PLUGIN_CONTINUE
}
if(get_cvar_num("surf_respawn")==0)
{
return PLUGIN_CONTINUE
}
new arg[32]
read_data(3,arg,31)
new id = cmd_target(1,arg,0)
// Spawn the player twice to avoid the HL engine bug
set_task(0.5,"player_spawn",id)
set_task(0.7,"player_spawn",id)
// Then give them a suit and a knife
set_task(0.9,"player_giveitems",id)
return PLUGIN_CONTINUE
}
Code:
public player_spawn(id)
{
spawn(id)
}
Code:
public player_giveitems(id)
{
give_item(id, "item_suit")
give_item(id, "weapon_knife")
return PLUGIN_CONTINUE
}
It's actually taken partly from Geesu's Respawn Forever, but the joining on connect was added by me.
__________________