One thing, use switch case like this:
And now it's more efficient.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <dhudmessage>
#define PLUGIN "Zombie Addon : HUD Stats "
#define VERSION "1.0"
#define AUTHOR "KiA"
/* Initialization */
new ZombieWins
new HumanWins
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(0.5,"HUDUpdate", 0,"",0,"b")
/* CVARS */
register_cvar("zphud_rcolor","0") // RED
register_cvar("zphud_gcolor","255") // GREEN
register_cvar("zphud_bcolor","0") // BLUE
}
public zp_round_ended(WinTeam)
{
switch(WinTeam) {
case ZP_TEAM_ZOMBIE: {
ZombieWins = ZombieWins + 1
}
case ZP_TEAM_HUMAN: {
HumanWins = HumanWins + 1
}
}
}
public HUDUpdate()
{
new zombies = zp_get_zombie_count()
new humans = zp_get_human_count()
set_dhudmessage(get_cvar_num("zphud_rcolor"),get_cvar_num("zphud_gcolor"),get_cvar_num("zphud_bcolor"), -1.0, 0.05, 0, 6.0, 12.0)
show_dhudmessage(0, "Zombies [%i] | [%i] Humans", zombies, humans)
set_dhudmessage(get_cvar_num("zphud_rcolor"),get_cvar_num("zphud_gcolor"),get_cvar_num("zphud_bcolor"), -1.0, 0.10, 0, 6.0, 12.0)
show_dhudmessage(0, "Zombie Wins [%i] | [%i] Human Wins", ZombieWins, HumanWins)
}
__________________