Raised This Month: $ Target: $400
 0% 

Text above the Health and armor text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-21-2010 , 13:19   Re: Text above the Health and armor text
Reply With Quote #1

PHP Code:
// Show HUD Task
public ShowHUD(taskid)
{
    static 
id
    id 
ID_SHOWHUD;
    
    
// Player died?
    
if (!g_isalive[id])
    {
        
// Get spectating target
        
id pev(idPEV_SPEC_TARGET)
        
        
// Target not alive
        
if (!g_isalive[id]) return;
    }
    
    
// Format classname
    
static class[32], redgreenblue
    
    
if (g_zombie[id]) // zombies
    
{
        
red 200
        green 
250
        blue 
0
        
        
if (g_nemesis[id])
            
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_NEMESIS")
        else
            
copy(class, charsmax(class), g_zombie_classname[id])
    }
    else 
// humans
    
{
        
red 0
        green 
0
        blue 
255
        
        
if (g_survivor[id])
            
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_SURVIVOR")
        else
            
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_HUMAN")
    }
    
    
// Spectating someone else?
    
if (id != ID_SHOWHUD)
    {
        
// Show name, health, class, and ammo packs
        
set_hudmessage(255255255HUD_SPECT_XHUD_SPECT_Y06.01.10.00.0, -1)
        
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L %s^nHP: %d - %L %s - %L %d"ID_SHOWHUD"SPECTATING"g_playername[id], pev(idpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[id])
    }
    else
    {
        
// Show health, class and ammo packs
        
set_hudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0, -1)
        
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L: %d - %L %s - %L %d"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD])
    }

The complete hud func from zombie plague.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-21-2010 , 13:21   Re: Text above the Health and armor text
Reply With Quote #2

why cant i go to page 2? it shows me the page 1 everytime... !!!

// edit

thanks i gonna try it tomorrow =) thanks a lot for ur nice helping D

// edit 2

the same thing in zombieplague (set_task(1.0 >>>>>>))

needs this method too much CPU? Or shoud i use StatusText?

Last edited by mottzi; 06-21-2010 at 13:26.
mottzi is offline
Send a message via MSN to mottzi
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-21-2010 , 13:30   Re: Text above the Health and armor text
Reply With Quote #3

Well, I think you could just set the task to be like 15.0 seconds, and to have the HUD set to 15.1 seconds. Then, you can just tell it to run the update whenever something changes, otherwise, it will only update every 15 seconds.
RedRobster is offline
Reply



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 14:50.


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