AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Zombie Plague Hitboxes (https://forums.alliedmods.net/showthread.php?t=108575)

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)

Arkshine 11-07-2009 05:58

Re: [HELP] Zombie Plague Hitboxes
 
I'm not sure it's a good idea to use this native, if I remember it's broken. You should try something like : http://forums.alliedmods.net/showthr...638#post585638

Excalibur.007 11-08-2009 04:25

Re: [HELP] Zombie Plague Hitboxes
 
Thanks for your information Arkshine. Testing now. I will edit this post when i tested it fully.


All times are GMT -4. The time now is 17:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.