Raised This Month: $ Target: $400
 0% 

Health Display.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 08-25-2009 , 06:30   Re: Health Display.
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
#include <fakemeta>
 
#define PLUGIN_NAME "[ZP] Survivor Health"
#define PLUGIN_VERS "1.0"
#define PLUGIN_AUTH "hi!"
 
#define TASK_HEALTH 1234554321
new g_iHudSync
 
enum GameTypes
{
    
GAME_NONE,
 
    
GAME_SURVIVOR,
    
GAME_NEMESIS
};
 
new const 
g_iGameModesGameTypes ] =
{
    
0,
 
    
MODE_SURVIVOR,
    
MODE_NEMESIS
};
 
new const 
g_szGameNamesGameTypes ][ ] =
{
    
"",
 
    
"Survivor",
    
"Nemesis"
};
 
new 
GameTypes:g_iGamePlay;
 
GameTypes:GetModeiMode )
{
    for( new 
GameTypes:GameTypes:1GameTypesi++ )
    {
        if( 
g_iGameModes] == iMode )
        {
            return 
i;
        }
    }
 
    return 
GAME_NONE;
}
 
UserMatchesModeclient )
{
    switch( 
g_iGamePlay )
    {
        case 
GAME_SURVIVOR:
        {
            return 
zp_get_user_survivorclient );
        }
        case 
GAME_NEMESIS:
        {
            return 
zp_get_user_nemesisclient );
        }
    }
 
    return 
0;
}
 
public 
plugin_init() 
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH)
 
 
//
 
g_iHudSync CreateHudSyncObj()
 
 
// Fwd's
 
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
 
RegisterHam(Ham_Killed"player""Fwd_PlayerKilled_Pre"0)
        
register_forward(FM_ClientDisconnect"client_disconnect")
}
 
public 
Fwd_PlayerSpawn_Post(id)
{
 if (
task_exists(id+TASK_HEALTH))
  
remove_task(id+TASK_HEALTH)
}
 
public 
Fwd_PlayerKilled_Pre(victimattackershouldgib)
{
 if (
task_exists(victim+TASK_HEALTH))
  
remove_task(victim+TASK_HEALTH)
}
 
public 
client_disconnect(id)
{
 if (
task_exists(id+TASK_HEALTH))
  
remove_task(id+TASK_HEALTH)
}
 
public 
zp_round_started(modeid)
{
 
g_iGamePlay GetModemode )
 if( !
g_iGamePlay )
  return
 
 if( !
UserMatchesModeid ) )
  return
 
 
set_task(1.0"Task_ShowHealth"id+TASK_HEALTH__"b")
}
 
public 
Task_ShowHealth(id)
{
 
id -= TASK_HEALTH
 
 
if( !g_iGamePlay
 
|| !UserMatchesModeid ) )
 {
  
remove_task(id+TASK_HEALTH)
  return
 }
 
 
set_hudmessage(00225, -1.00.201.01.00.10.2, -1)
 
ShowSyncHudMsg(idg_iHudSync"%s Health: %d"g_szGameNamesg_iGamePlay ], get_user_health(id))

Is it possible to make the hud message for nemesis in red ?

Or blue for survivor ?
Mr.Noobie 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 15:06.


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