| Excalibur.007 |
11-07-2009 01:43 |
[HELP] Zombie Plague Hitboxes
Ok i tried to set a zombie(headcrab) to left and right legs but it still doesn't work. Is there anything wrong with this?
Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <fun>
#define PLUGIN "[ZP] Class : Head Crab"
#define VERSION "0.1"
#define AUTHOR "~007~"
new g_zclass_headcrab
// Head Crab Attributes
new const zclass_name[] = "Head Crab" // name
new const zclass_info[] = "Small and vicious" // description
new const zclass_model[] = "headcrab" // model
new const zclass_clawmodel[] = "v_knife_headcrab.mdl" // claw model
const zclass_health = 1800 // health
const zclass_speed = 190 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.0 // knockback
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
set_user_hitzones(0, 0, 192);
}
public plugin_precache()
{
precache_model("models/player/headcrab/headcrab.mdl")
g_zclass_headcrab = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public fw_PlayerPreThink(player)
{
if(!is_user_alive(player))
return FMRES_IGNORED
if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_zclass_headcrab)
set_pev(player, pev_flTimeStepSound, 999)
return FMRES_IGNORED
}
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_zclass_headcrab)
{
client_print(id, print_chat, "[ZP] You are currently using Head Crab.")
}
}
set_user_hitzones(0, 0, 192); 192 = 64(left leg) + 128(right leg)
|