Raised This Month: $32 Target: $400
 8% 

Subplugin Submission [ZP] Zombie Class: Vampire Zombie


Post New Thread Reply   
 
Thread Tools Display Modes
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-25-2010 , 16:35   Re: [ZP] Zombie Class: Vampire Zombie
Reply With Quote #11

Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <zombieplague>

// Plugin stuff
new const PLUGIN[] = "[ZP] Zombie Class: Vampire Zombie"
new const VERSION[] = "1.0"
new const AUTHOR[] = "NiHiLaNTh"

// Zombie parametres
new const zclass_name[] = { "Vampire Zombie" } // name
new const zclass_info[] = { "Gain health with each hit" } // description
new const zclass_model[] = { "zombie_source" } // player model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 1500 // health
const zclass_speed = 220 // speed
const Float:zclass_gravity = 0.7 // gravity
const Float:zclass_knockback = 1.5 // knockback

// Class ID
new g_zclass_vampire;

// CVAR pointers
new pcv_multi;

// Zombie classes must be registered on plugin precache
public plugin_precache()
{
    g_zclass_vampire = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback);
}

// Plugin initialization
public plugin_init()
{
    // Register our plugin
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    // Forward
    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
    
    // CVAR
    pcv_multi = register_cvar("zp_vampire_multi", "2") // additional health multiplier
}

// Target has been injected...
public zp_user_infected_post(id, infector, nemesis)
{
    // Our zm class
    if (zp_get_user_zombie_class(id) == g_zclass_vampire)
    {
        client_print(id, print_chat, "[ZP] Damage or infect someone to get additional health.");
        VampireInit(id);
    }
    
    // Vampire zombie cannot damage anyone on Single/Multi infection rounds so...
    if (zp_get_user_zombie_class(infector) == g_zclass_vampire)
    {
        set_user_health(infector, get_user_health(attacker) + 1000)
    }
}

// Victim took damage from entity
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
    // Not alive
    if (!is_user_alive(victim))
        return;
        
    
    if (zp_get_user_zombie_class(attacker) == g_zclass_vampire)
    {
        // Calculate additional health
        static ExtraHealth;
        ExtraHealth = floatround(damage * get_pcvar_num(pcv_multi))
        
        // Set new health
        set_user_health(attacker, get_user_health(attacker) + ExtraHealth)
    }
    else return;
}        

// Vampire zombie was born...
public VampireInit(id)
{
    // Not alive
    if (!is_user_alive(id))
        return PLUGIN_CONTINUE;
    
    // Not our zombie class
    if (zp_get_user_zombie_class(id) != g_zclass_vampire)
        return PLUGIN_CONTINUE;
    
    return PLUGIN_CONTINUE;
}
Try that. I took out fakemeta (idk how to use it completely) and put fun, I think it's easier to use. But that's my opinion. Also, took out the check if(!get_user_zombie(attacker)) || !get_user_nemesis(attacker)) because the next thing checks if their class is the vampire zombie, and I just put an else statement that returned.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
SwInGeR
Member
Join Date: Jan 2008
Location: Russia
Old 10-13-2010 , 05:58   Re: [ZP] Zombie Class: Vampire Zombie
Reply With Quote #12

For nikhilgupta345
public zp_user_infected_post(id, infector, nemesis)

is not contain var attacker!

see errors:
Quote:
//// zp_zclass_vampire.sma
// amxmodx1.8\scripting\zp_zclass_vampire.sma(59 ) : error 017: undefined symbol "attacker"
// 1 Error.
// Could not locate output file compiled\zp_zclass_vampire.amx (compile failed).
Then:
Quote:
L 10/13/2010 - 20:54:21: [AMXX] Displaying debug trace (plugin "zp_zclass_vampire.amxx")
L 10/13/2010 - 20:54:21: [AMXX] Run time error 10: native error (native "zp_get_user_zomb
L 10/13/2010 - 20:54:21: [AMXX] [0] zp_zclass_vampire.sma::fw_TakeDamage (line 71)
L 10/13/2010 - 20:54:21: [AMXX] Displaying debug trace (plugin "zombie_plague40.amxx")
L 10/13/2010 - 20:54:21: [AMXX] Run time error 4: index out of bounds
L 10/13/2010 - 20:54:21: [AMXX] [0] zombie_plague40.sma::native_get_user_zombie_c lass
L 10/13/2010 - 20:54:21: Unhandled dynamic native error

Last edited by SwInGeR; 10-13-2010 at 09:21.
SwInGeR is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 09-25-2011 , 01:56   Re: [ZP] Zombie Class: Vampire Zombie
Reply With Quote #13

Quote:
Originally Posted by Bummps View Post
dude, this class is a default zombie. '-'
And its the zp_zclass_example too or something like Zombie class example
__________________
Snaker beatter is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 09-25-2011 , 06:30   Re: [ZP] Zombie Class: Vampire Zombie
Reply With Quote #14

Quote:
Originally Posted by Snaker beatter View Post
And its the zp_zclass_example too or something like Zombie class example
stop spamming please? You keep reviving a dead thread
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 09-25-2011 , 16:31   Re: [ZP] Zombie Class: Vampire Zombie
Reply With Quote #15

Quote:
Originally Posted by Snaker beatter View Post
And its the zp_zclass_example too or something like Zombie class example
GOD !!!! thread has been revived
Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 09-25-2011 , 18:21   Re: [ZP] Zombie Class: Vampire Zombie
Reply With Quote #16

Wow, it wil be usefull in swarm/plague mode
__________________

Hatsune Miku~
tei1995 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:40.


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