AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me to make it works... (https://forums.alliedmods.net/showthread.php?t=110220)

hueyjie 11-26-2009 22:50

Help me to make it works...
 
2 Attachment(s)
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_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    
}

// User Infected forward
public zp_user_infected_post(idinfector)
{
    
// If attacker is a speed zombie, gets extra 240 speed
    
if (zp_get_user_zombie_class(infector) == g_zclass_speedstealer)
        
set_pev(infectorpev_speedfloat(pev(infectorpev_speed) + zclass_infectspeed))




All times are GMT -4. The time now is 13:43.

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