PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <nvault>
#include <fun>
#include <zombieplague>
#include <dhudmessage>
#define zp_cso_lvlmax 10
/*------------------------------------------------------------------------------------------*
[ ZP CSO Plugin Information ]
*------------------------------------------------------------------------------------------*/
/*---------------------------------------------*
[ ZP CSO Plugin Name ]
*---------------------------------------------*/
new const ZP_CSO_PLUGIN_NAME[] = "Zp-cso-theme-edited"
/*---------------------------------------------*
[ ZP CSO Plugin Version ]
*---------------------------------------------*/
new const ZP_CSO_PLUGIN_VERSION[] = "."
/*---------------------------------------------*
[ ZP CSO Plugin Author ]
*---------------------------------------------*/
new const ZP_CSO_PLUGIN_AUTHOR[] = "."
/*------------------------------------------------------------------------------------------*
[ ZP CSO Plugin Game Variables ]
*------------------------------------------------------------------------------------------*/
/*---------------------------------------------*
[ ZP CSO Plugin Variables Needed ]
*---------------------------------------------*/
new zp_cso_czbot
/*---------------------------------------------*
[ ZP CSO Plugin Points System ]
*---------------------------------------------*/
/*---------------------------------------------*
[ ZP CSO Plugin HUD ]
*---------------------------------------------*/
new zp_center_textmsg
/*---------------------------------------------*
[ ZP CSO Plugin HM & ZB Level Up System ]
*---------------------------------------------*/
new zp_cso_hmlvl
/*---------------------------------------------*
[ ZP CSO Plugin KILL! System ]
*---------------------------------------------*/
new zp_cso_kill_lvl[33]
new zp_roundnum
/*---------------------------------------------*
[ ZP CSO Plugin Respawn System ]
*---------------------------------------------*/
/*------------------------------------------------------------------------------------------*
[ ZP CSO Plugin CVARs ]
*------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------*
[ ZP CSO Plugin Sounds ]
*------------------------------------------------------------------------------------------*/
/*---------------------------------------------*
[ ZP CSO Plugin Round Start MP3 ]
*---------------------------------------------*/
new const zp_cso_roundstart[][] =
{
"sound/zombie_plague/cso/round_start.mp3",
"sound/zombie_plague/cso/round_start1.mp3",
"sound/zombie_plague/cso/round_start2.mp3",
"sound/zombie_plague/cso/round_start3.mp3"
}
/*---------------------------------------------*
[ ZP CSO Plugin Zombie Ambience ]
*---------------------------------------------*/
/*-------------------------------------------*
[ ZP CSO Plugin Infection Chant ]
*---------------------------------------------*/
new const zp_cso_infectchant[][] =
{
"zombie_plague/cso/zombie_sound.wav",
"zombie_plague/cso/zombie_sound1.wav",
"zombie_plague/cso/zombie_sound2.wav"
}
new const zp_cso_human_lvlup[][] =
{
"zombie_plague/cso/human_dmglvlup.wav"
}
new const zp_cso_dmg_lvl[11][] =
{
"1.0",
"1.1",
"1.2",
"1.3",
"1.4",
"1.5",
"1.6",
"1.7",
"1.8",
"1.9",
"2.0"
}
new const zp_cso_hmlvl_r[11] =
{
0,
0,
0,
0,
255,
255,
255,
255,
255,
255,
255
}
/*---------------------------------------------*
[ ZP CSO Plugin Human Level HUD Green ]
*---------------------------------------------*/
new const zp_cso_hmlvl_g[11] =
{
255,
255,
255,
255,
255,
255,
255,
155,
155,
155,
0
}
/*---------------------------------------------*
[ ZP CSO Plugin Human Level HUD Blue ]
*---------------------------------------------*/
new const zp_cso_hmlvl_b[11] =
{
0,
0,
0,
0,
55,
55,
55,
55,
55,
55,
0
}
new const ZP_CSO_DMGHEGRENADE_BITSUM = (1<<24)
public plugin_init()
{
register_plugin(ZP_CSO_PLUGIN_NAME, ZP_CSO_PLUGIN_VERSION, ZP_CSO_PLUGIN_AUTHOR)
register_event("HLTV", "zp_cso_round_start", "a", "1=0", "2=0")
register_logevent("zp_cso_round_start",2,"1=RoundStart")
register_event("DeathMsg", "zp_cso_death", "a", "1>0")
RegisterHam(Ham_TakeDamage, "player", "zp_cso_takedamage")
zp_center_textmsg = get_user_msgid("TextMsg")
}
public plugin_precache()
{
new i
for(i = 0; i < sizeof zp_cso_roundstart; i++)
engfunc(EngFunc_PrecacheGeneric, zp_cso_roundstart[i])
for(i = 0; i < sizeof zp_cso_infectchant; i++)
engfunc(EngFunc_PrecacheSound, zp_cso_infectchant[i])
for(i = 0; i < sizeof zp_cso_human_lvlup; i++)
engfunc(EngFunc_PrecacheSound, zp_cso_human_lvlup[i])
}
public zp_cso_round_start()
{
new iPlayers[32], iPlayer, iPlayerNum
new iMP3, MP3[64]
iMP3 = random_num(0,charsmax(zp_cso_roundstart))
copy(MP3, charsmax(MP3), zp_cso_roundstart[iMP3])
client_cmd(0,"mp3 play ^"%s^"", MP3)
get_players(iPlayers, iPlayerNum)
for(new iNum; iNum < iPlayerNum; iNum++)
{
iPlayer = iPlayers[iNum]
zp_cso_damage_plus(iPlayer, 0)
}
zp_cso_hmlvl = 0
}
public zp_cso_death()
{
new iKiller = read_data(1)
new iVictim = read_data(2)
new iClip, iAmmo= get_user_weapon(iKiller, iClip, iAmmo)
new iDmglvl, iHumans[32], iHuman, iHumanNum
if(!zp_get_user_zombie(iKiller))
{
if(zp_cso_hmlvl < zp_cso_lvlmax)
{
zp_cso_hmlvl += 1
iDmglvl = zp_cso_hmlvl
get_players(iHumans, iHumanNum)
for(new iNum ; iNum < iHumanNum; iNum++)
{
iHuman = iHumans[iNum]
zp_cso_damage_plus(iHuman, iDmglvl)
}
}
}
if(iKiller == iVictim)
return PLUGIN_CONTINUE
if(zp_get_user_zombie(iVictim))
{
zp_cso_kill_lvl[iVictim] = 0
}
return PLUGIN_CONTINUE
}
public zp_user_infected_post(id)
{
if(zp_get_user_nemesis(id) || zp_get_user_assassin(id))
return PLUGIN_CONTINUE
new iMP3, MP3[64]
iMP3 = random_num(0,charsmax(zp_cso_infectchant))
copy(MP3, charsmax(MP3), zp_cso_infectchant[iMP3])
client_cmd(0,"spk ^"%s^"", MP3)
return PLUGIN_CONTINUE
}
public zp_cso_takedamage(iVictim, iInflictor, iAttacker, Float: iDamage, iDamage_Type)
{
if(iAttacker == iVictim)
return HAM_IGNORED
if (zp_get_user_zombie(iVictim))
{
if ((iDamage_Type & ZP_CSO_DMGHEGRENADE_BITSUM) && !zp_get_user_zombie(iAttacker))
{
new Float: zp_hedmg = 500.0 * zp_cso_hmlvl
iDamage = zp_hedmg
}
else if (zp_cso_hmlvl)
{
new Float: zp_dmg_lvl = str_to_float(zp_cso_dmg_lvl[zp_cso_hmlvl])
iDamage *= zp_dmg_lvl
}
SetHamParamFloat(4, iDamage)
return HAM_IGNORED
}
return HAM_IGNORED
}
public zp_round_ended()
{
zp_roundnum += 1
}
public client_putinserver(id)
{
zp_cso_auto_on(id)
}
public zp_cso_auto_on(id)
{
set_task(0.3,"zp_scorehud", id, _, _, "b")
if(!zp_cso_czbot)
{
set_task(0.1, "zp_cso_register_czbot", id)
}
}
public zp_scorehud(id)
{
set_hudmessage(212, 255, 170, -1.0, 0.0, 0, 6.0, 12.0)
show_hudmessage(id, "%d- Humans vs Zombies -%d^nRound -%d",zp_get_human_count(),zp_get_zombie_count(),zp_roundnum)
}
public zp_cso_register_czbot(id)
{
if (zp_cso_czbot || !is_user_connected(id) || !is_user_bot(id))
return PLUGIN_CONTINUE
RegisterHamFromEntity(Ham_TakeDamage, id, "zp_cso_takedamage")
zp_cso_czbot = true
return PLUGIN_CONTINUE
}
zp_cso_damage_plus(Human, Damage_Plus)
{
if (!is_user_alive(Human) || zp_get_user_zombie(Human))
return PLUGIN_CONTINUE
if(zp_get_user_assassin(Human) || zp_get_user_sniper(Human) || zp_get_user_survivor(Human) || zp_get_user_nemesis(Human))
return PLUGIN_CONTINUE
if(zp_cso_hmlvl == 0)
return PLUGIN_CONTINUE
new Float: zp_origin[3], zp_r, zp_g, zp_b, iSound, iSpeak[64], iText[64]
zp_r = zp_cso_hmlvl_r[Damage_Plus]
zp_g = zp_cso_hmlvl_g[Damage_Plus]
zp_b = zp_cso_hmlvl_b[Damage_Plus]
pev(Human, pev_origin, zp_origin)
iSound = random_num(0, charsmax(zp_cso_human_lvlup))
copy(iSpeak, charsmax(iSpeak), zp_cso_human_lvlup[iSound])
client_cmd(Human,"spk ^"%s^"", iSpeak)
format(iText, charsmax(iText), "Morale Boost Stage Up %d", Damage_Plus)
zp_clientcenter_text(Human, iText)
zp_cso_setrendering(Human)
zp_cso_setrendering(Human, kRenderFxGlowShell, zp_r, zp_g, zp_b, kRenderNormal, 0)
return PLUGIN_CONTINUE
}
stock zp_clientcenter_text(id, zp_message[])
{
new dest
if (id) dest = MSG_ONE
else dest = MSG_ALL
message_begin(dest, zp_center_textmsg, {0,0,0}, id)
write_byte(4)
write_string(zp_message)
message_end()
}
stock zp_cso_setrendering(Human, zp_fx = kRenderFxNone, zp_r = 255, zp_g = 255, zp_b = 255, zp_render = kRenderNormal, zp_amount = 16)
{
static Float: zp_color[3]
zp_color[0] = float(zp_r)
zp_color[1] = float(zp_g)
zp_color[2] = float(zp_b)
set_pev(Human, pev_renderfx, zp_fx)
set_pev(Human, pev_rendercolor, zp_color)
set_pev(Human, pev_rendermode, zp_render)
set_pev(Human, pev_renderamt, float(zp_amount))
}