hi guys, i have problem with zombie class pain shock free, as if anyone selected this class and become nemesis/assassin, it will also have pain shock free in nemesis/assassin, it doesnt matter for assassin because it already have pain free, but it matters for nemesis, i managed myself to turn this thing on in another class (heal zombie) but failed in this one, can you guys edit the code so when anyone selected this class and become nemesis will not have any pain shock free effect.
Thanks
Code:
Quote:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Pain Shock Free Zombie"
#define VERSION "1.2.3"
#define AUTHOR "Fry!"
const OFFSET_LINUX = 5
const OFFSET_PAINSHOCK = 108 // ConnorMcLeod
new const zclass_name[] = "Paint Zombie"
new const zclass_info[] = "| G -> Pain Shock Free |"
new const zclass_model[] = "paint_pgln"
new const zclass_clawmodel[] = "v_knife_paint_pgln.mdl"
const zclass_health = 6000
const zclass_speed = 265
const Float:zclass_gravity = 0.75
const Float:zclass_knockback = 0.0
new g_zclass_pain_shock_free
new bool:g_has_pain_shock_free[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_pain_shock_free",VER SION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED |FCVAR_SPONLY)
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_Post", 1)
}
public plugin_precache()
{
g_zclass_pain_shock_free = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass_pain_shock_free)
{
g_has_pain_shock_free[player] = true
}
}
public fw_TakeDamage_Post(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return HAM_IGNORED
if (zp_get_user_zombie_class(id) != g_zclass_pain_shock_free)
return HAM_IGNORED
g_has_pain_shock_free[id] = true
set_pdata_float(id, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX)
return HAM_IGNORED
}
|