 |
|
BANNED
|

08-25-2009
, 06:30
Re: Health Display.
|
#5
|
Quote:
Originally Posted by Exolent[jNr]
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_iGameModes[ GameTypes ] = { 0, MODE_SURVIVOR, MODE_NEMESIS }; new const g_szGameNames[ GameTypes ][ ] = { "", "Survivor", "Nemesis" }; new GameTypes:g_iGamePlay; GameTypes:GetMode( iMode ) { for( new GameTypes:i = GameTypes:1; i < GameTypes; i++ ) { if( g_iGameModes[ i ] == iMode ) { return i; } } return GAME_NONE; } UserMatchesMode( client ) { switch( g_iGamePlay ) { case GAME_SURVIVOR: { return zp_get_user_survivor( client ); } case GAME_NEMESIS: { return zp_get_user_nemesis( client ); } } return 0; } public plugin_init() { register_plugin(PLUGIN_NAME, PLUGIN_VERS, PLUGIN_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(victim, attacker, shouldgib) { 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(mode, id) { g_iGamePlay = GetMode( mode ) if( !g_iGamePlay ) return if( !UserMatchesMode( id ) ) return set_task(1.0, "Task_ShowHealth", id+TASK_HEALTH, _, _, "b") } public Task_ShowHealth(id) { id -= TASK_HEALTH if( !g_iGamePlay || !UserMatchesMode( id ) ) { remove_task(id+TASK_HEALTH) return } set_hudmessage(0, 0, 225, -1.0, 0.2, 0, 1.0, 1.0, 0.1, 0.2, -1) ShowSyncHudMsg(id, g_iHudSync, "%s Health: %d", g_szGameNames[ g_iGamePlay ], get_user_health(id)) }
|
Is it possible to make the hud message for nemesis in red ?
Or blue for survivor ?
|
|
|
|