#include < amxmodx >
#include < zombieplague >
#define PLUGIN_NAME "[ZP] Addon: Bonus Ammo Pack"
#define PLUGIN_VERSION "0.2"
#define PLUGIN_AUTHOR "Íåáîæèòåëü"
#define HUD_ZM_WIN 0, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
#define HUD_ZM_FAIL 255, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
#define HUD_HM_WIN 0, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
#define HUD_HM_FAIL 255, 255, 0, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
#define HUD_NO_ONE 255, 255, 255, 0.01, 0.25, 1, 0.0, 5.0, 1.0, 1.0, -1
#define BONUS_ZM_WIN 10
#define BONUS_ZM_FAIL 5
#define BONUS_HM_WIN 10
#define BONUS_HM_FAIL 5
#define BONUS_NO_ONE 1
new g_maxplayers
public plugin_init() {
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
register_dictionary ( "zp_bonus_ammopack.txt" )
g_maxplayers = get_maxplayers ( )
}
public zp_round_ended ( Team ) {
if ( Team == WIN_ZOMBIES )
{
for ( new i = 1; i <= g_maxplayers ; i++ )
{
if ( ! is_user_connected ( i ) ) continue;
if ( zp_get_user_zombie ( i ) || zp_get_user_nemesis ( i ) )
{
set_hudmessage ( HUD_ZM_WIN )
show_hudmessage(i, "%L", LANG_PLAYER, "WIN" , BONUS_ZM_WIN)
zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) + BONUS_ZM_WIN );
}
else
{
set_hudmessage( HUD_ZM_FAIL )
show_hudmessage(i, "%L", LANG_PLAYER, "FAIL" , BONUS_ZM_FAIL)
zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) - BONUS_ZM_FAIL );
}
}
}
else if ( Team == WIN_HUMANS)
{
for ( new i = 1; i <= g_maxplayers ; i++ )
{
if ( ! is_user_connected ( i ) ) continue;
if ( zp_get_user_human ( i ) || zp_get_user_survivor ( i ) )
{
set_hudmessage( HUD_HM_WIN )
show_hudmessage( i, "%L", LANG_PLAYER, "WIN" , BONUS_HM_WIN)
zp_set_user_ammo_packs( i, zp_get_user_ammo_packs( i ) + BONUS_HM_WIN );
}
else
{
set_hudmessage( HUD_HM_FAIL )
show_hudmessage ( i , "%L", LANG_PLAYER, "FAIL" , BONUS_HM_FAIL)
zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) - BONUS_HM_FAIL ) ;
}
}
}
else
{
for ( new i = 1; i <= g_maxplayers ; i++ )
{
if ( ! is_user_connected ( i ) ) continue;
set_hudmessage ( HUD_NO_ONE )
show_hudmessage ( i , "%L", LANG_PLAYER, "NO_ONE" , BONUS_NO_ONE )
zp_set_user_ammo_packs ( i , zp_get_user_ammo_packs ( i ) + BONUS_NO_ONE ) ;
}
}
}
stock zp_get_user_human ( id )
return ( ! zp_get_user_survivor ( id ) && ! zp_get_user_nemesis ( id ) && ! zp_get_user_zombie ( id ) )