I am trying to make a zombie class that can drain speed from the human it infected, so I edited the source file for leech zombie. There is no error but the zombie can't drain speed from human it infects. Can someone teach me how to make it works? To compile this, you need to have the zombieplague.inc in your include folder.
Thanks.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
// Speed Zombie Attributes
new const zclass_name[] = "Speed Stealer Zombie" // name
new const zclass_info[] = "Drains human speed." // description
new const zclass_model[] = "zombie_source" // model
new const zclass_clawmodel[] = "v_knife_zombie.mdl" // claw model
const zclass_health = 1350 // health
const zclass_speed = 190 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.0 // knockback
const zclass_infectspeed = 240 // extra speed for infections
/*===============================================================================*/
// Class IDs
new g_zclass_speedstealer
// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
register_plugin("[ZP] Speed Zombie Class", "1.0 Beta", "hueyjie")
// Register the new class and store ID for reference
g_zclass_speedstealer = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
// User Infected forward
public zp_user_infected_post(id, infector)
{
// If attacker is a speed zombie, gets extra 240 speed
if (zp_get_user_zombie_class(infector) == g_zclass_speedstealer)
set_pev(infector, pev_speed, float(pev(infector, pev_speed) + zclass_infectspeed))
}