Raised This Month: $ Target: $400
 0% 

Solved HUD Breaks on spawn (DOD)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
cmndrfello
Junior Member
Join Date: Jan 2022
Old 01-06-2022 , 17:40   Re: HUD Breaks on spawn (DOD)
Reply With Quote #3

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(idpev_health) <= && pev(id,pev_team) != && get_pdata_int(id,366) != -1){
        
set_task(0.4"dod_player_spawn"id);
        
set_pev(idpev_deadflagDEAD_RESPAWNABLE);
    }
}

public 
dod_player_spawn(id)
{
    
set_pev(idpev_iuser10);
    
dllfunc(DLLFunc_Spawnid);
}

public 
dod_player_postspawn(id)
{
    
fm_strip_user_weapons(id);

    
giveLoadout(); //Function with give_item() calls

    
set_pdata_int(id1060020);
    
set_pdata_int(id1072020);
    
set_pdata_int(id1024120);

    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)

Last edited by cmndrfello; 01-06-2022 at 17:41.
cmndrfello is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode