PHP Code:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Win HUD."
#define VERSION "0.1"
#define AUTHOR "SNAFFY"
#pragma semicolon 0
new g_winh , g_winz , count , g_roundhud
native zp_is_nemesis_round()
native zp_is_survivor_round()
native zp_has_round_started()
native zp_get_user_zombie(id)
forward zp_round_ended(winteam)
const WIN_ZOMBIES = 1
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_roundstart", "a", "1=0", "2=0")
set_task (0.6,"showhud",_,_,_,"b");
g_roundhud = 1
}
public plugin_precache()
{
precache_sound("Premium_plague/count/1.wav")
precache_sound("Premium_plague/count/2.wav")
precache_sound("Premium_plague/count/3.wav")
precache_sound("Premium_plague/count/4.wav")
precache_sound("Premium_plague/count/5.wav")
precache_sound("Premium_plague/count/6.wav")
precache_sound("Premium_plague/count/7.wav")
precache_sound("Premium_plague/count/8.wav")
precache_sound("Premium_plague/count/9.wav")
precache_sound("Premium_plague/count/10.wav")
precache_sound("Premium_plague/count/start1.mp3")
precache_sound("Premium_plague/count/start2.mp3")
precache_sound("Premium_plague/count/start3.mp3")
}
public event_roundstart()
{
set_task(9.0,"start_countdown",1499)
new players[32], num, id
get_players(players, num, "ach")
for (new i = 0; i < num; i++)
{
id = players[i]
switch (random(2))
{
case 0: client_cmd(id, "mp3 play sound/Premium_plague/count/start1.mp3")
case 1: client_cmd(id, "mp3 play sound/Premium_plague/count/start2.mp3")
case 2: client_cmd(id, "mp3 play sound/Premium_plague/count/start3.mp3")
}
}
g_roundhud = g_winh + g_winz + 1
count = 10
}
public start_countdown()
{
remove_task(1499)
remove_task(1500)
set_task(1.0,"countdown",1500)
}
public countdown()
{
if(count == 0)
{
set_dhudmessage(0, 150, 255, -1.0, 0.22, 0, 1.0, 1.0,1.0,1.0)
show_dhudmessage(0,"<<•>> Infection Has begiN <<•>>")
}
if(count > 0)
{
set_dhudmessage(random_num(1, 255), random_num(1, 255), random_num(1, 255), -1.0, 0.22, 0, 0.5, 0.5,0.5,0.5)
if(count < 11) client_cmd(0,"spk Premium_plague/count/%d", count)
show_dhudmessage(0,"/---------------------\^n • Infection in: %d •^n\---------------------/",count)
}
count = count - 1
if(count >= 0) set_task(1.0,"countdown",1500)
}
public showhud()
{
new red , green , blue
if(zp_is_nemesis_round())
{
red = 0
green = 150
blue = 255
}else if(zp_is_survivor_round())
{
red = 0
green = 150
blue = 255
}else if(!zp_has_round_started())
{
red = 0
green = 150
blue = 255
}else{
red = 0
green = 150
blue = 255
}
set_dhudmessage(red, green, blue, -1.0, 0.0, 0, 0.0, 0.01)
show_dhudmessage(0, "• |** [ZM]-Premuim-Plague Zombies **| •^n• |Zombies: %d [%d]|-|[%d] %d :Humans| •^n• | Round: %d | •" ,fn_get_zombies(), g_winz, g_winh, fn_get_humans() ,g_roundhud)
}
public zp_round_ended(winteam)
{
if(winteam == WIN_ZOMBIES)
{
g_winz += 1
}else{
g_winh += 1
}
}
fn_get_humans()
{
static iAlive, id
iAlive = 0
for (id = 1; id <= 32; id++)
{
if (is_user_alive(id) && !zp_get_user_zombie(id))
iAlive++
}
return iAlive;
}
fn_get_zombies()
{
static iAlive, id
iAlive = 0
for (id = 1; id <= 32; id++)
{
if (is_user_alive(id) && zp_get_user_zombie(id))
iAlive++
}
return iAlive;
}