Here's the code that i am using on a windows server
PHP Code:
register_forward(FM_PlayerPreThink, "dod_player_prethink");
RegisterHam(Ham_Spawn, "player", "dod_player_postspawn", true);
public dod_player_prethink(id)
{
if(pev(id, pev_health) <= 0 && pev(id,pev_team) != 3 && get_pdata_int(id,366) != -1){
set_task(0.4, "dod_player_spawn", id);
set_pev(id, pev_deadflag, DEAD_RESPAWNABLE);
}
}
public dod_player_spawn(id)
{
set_pev(id, pev_iuser1, 0);
dllfunc(DLLFunc_Spawn, id);
}
public dod_player_postspawn(id)
{
fm_strip_user_weapons(id);
giveLoadout(); //Function with give_item() calls
set_pdata_int(id, 1060, 0, 20);
set_pdata_int(id, 1072, 0, 20);
set_pdata_int(id, 1024, 1, 20);
return PLUGIN_CONTINUE;
}
"dod_player_prethink()" function checks if player is dead and if so will spawn them with dllfunc.
After spawning even without "fm_strip_user_weapons()" still the weapon HUD won't appear.
(health, deathmsgs and chat still appears only weapon related HUD does not)