Raised This Month: $51 Target: $400
 12% 

leech zombie / problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
seerax
Member
Join Date: Apr 2009
Old 05-23-2009 , 09:08   leech zombie / problem
Reply With Quote #1

hi, I have a problem with leech zombie class, I've set him to get 200 hp when he infects someone, but he gets only 30 hp, like all other classes. if you could help me, plugin included.

Code:
/*================================================================================
    
    -----------------------------------
    -*- [ZP] Default Zombie Classes -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This plugin adds the default zombie classes to Zombie Plague.
    Feel free to modify their attributes to your liking.
    
    Note: If zombie classes are disabled, the first registered class
    will be used for all players (by default, Classic Zombie).
    
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

// Classic Zombie Attributes
new const zclass1_name[] = { "Classic Zombie" }
new const zclass1_info[] = { "[klasyczny zombie]" }
new const zclass1_model[] = { "zombie_source" }
new const zclass1_clawmodel[] = { "v_knife_zombie_drowned.mdl" }
const zclass1_health = 1700
const zclass1_speed = 265
const Float:zclass1_gravity = 1.0
const Float:zclass1_knockback = 0.5

// Raptor Zombie Attributes
new const zclass2_name[] = { "Raptor Zombie" }
new const zclass2_info[] = { "[-zycie] [+odrzut] [+szybkosc]" }
new const zclass2_model[] = { "HunterZ_frk_14" }
new const zclass2_clawmodel[] = { "HunterZ.mdl" }
const zclass2_health = 1200
const zclass2_speed = 305
const Float:zclass2_gravity = 1.0
const Float:zclass2_knockback = 0.9

// Big Zombie Attributes
new const zclass3_name[] = { "Big Zombie" }
new const zclass3_info[] = { "[+zycie] [-odrzut] [-szybkosc]" }
new const zclass3_model[] = { "zombie_smoker" }
new const zclass3_clawmodel[] = { "v_ubcs_l4d_bommer_hands.mdl" }
const zclass3_health = 2000
const zclass3_speed = 205
const Float:zclass3_gravity = 1.0
const Float:zclass3_knockback = 0.2

// Leech Zombie Attributes
new const zclass4_name[] = { "Leech Zombie" }
new const zclass4_info[] = { "[+zycia przy zarazaniu innych]" }
new const zclass4_model[] = { "Witch_L4D_frk_14" }
new const zclass4_clawmodel[] = { "v_ubcs_l4d_witch_hands.mdl" }
const zclass4_health = 1500
const zclass4_speed = 265
const Float:zclass4_gravity = 1.0
const Float:zclass4_knockback = 0.5
const zclass4_infecthp = 200 // extra hp for infections

/*============================================================================*/

// Class IDs
new g_zclass_leech

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    register_plugin("[ZP] Default Zombie Classes", "4.2", "MeRcyLeZZ")
    
    // Register all classes
    zp_register_zombie_class(zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, zclass1_knockback)    
    zp_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, zclass2_knockback)
    zp_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, zclass3_knockback)
    zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
}

// User Infected forward
public zp_user_infected_post(id, infector)
{
    // If attacker is a leech zombie, gets extra hp
    if (zp_get_user_zombie_class(infector) == g_zclass_leech)
        set_pev(infector, pev_health, float(pev(infector, pev_health) + zclass4_infecthp))
}
seerax is offline
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 05-23-2009 , 11:09   Re: leech zombie / problem
Reply With Quote #2

Quote:
Originally Posted by seerax View Post
hi, I have a problem with leech zombie class, I've set him to get 200 hp when he infects someone, but he gets only 30 hp, like all other classes. if you could help me, plugin included.

Code:
/*================================================================================
 
    -----------------------------------
    -*- [ZP] Default Zombie Classes -*-
    -----------------------------------
 
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
 
    This plugin adds the default zombie classes to Zombie Plague.
    Feel free to modify their attributes to your liking.
 
    Note: If zombie classes are disabled, the first registered class
    will be used for all players (by default, Classic Zombie).
 
================================================================================*/
 
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
 
/*================================================================================
 [Plugin Customization]
=================================================================================*/
 
// Classic Zombie Attributes
new const zclass1_name[] = { "Classic Zombie" }
new const zclass1_info[] = { "[klasyczny zombie]" }
new const zclass1_model[] = { "zombie_source" }
new const zclass1_clawmodel[] = { "v_knife_zombie_drowned.mdl" }
const zclass1_health = 1700
const zclass1_speed = 265
const Float:zclass1_gravity = 1.0
const Float:zclass1_knockback = 0.5
 
// Raptor Zombie Attributes
new const zclass2_name[] = { "Raptor Zombie" }
new const zclass2_info[] = { "[-zycie] [+odrzut] [+szybkosc]" }
new const zclass2_model[] = { "HunterZ_frk_14" }
new const zclass2_clawmodel[] = { "HunterZ.mdl" }
const zclass2_health = 1200
const zclass2_speed = 305
const Float:zclass2_gravity = 1.0
const Float:zclass2_knockback = 0.9
 
// Big Zombie Attributes
new const zclass3_name[] = { "Big Zombie" }
new const zclass3_info[] = { "[+zycie] [-odrzut] [-szybkosc]" }
new const zclass3_model[] = { "zombie_smoker" }
new const zclass3_clawmodel[] = { "v_ubcs_l4d_bommer_hands.mdl" }
const zclass3_health = 2000
const zclass3_speed = 205
const Float:zclass3_gravity = 1.0
const Float:zclass3_knockback = 0.2
 
// Leech Zombie Attributes
new const zclass4_name[] = { "Leech Zombie" }
new const zclass4_info[] = { "[+zycia przy zarazaniu innych]" }
new const zclass4_model[] = { "Witch_L4D_frk_14" }
new const zclass4_clawmodel[] = { "v_ubcs_l4d_witch_hands.mdl" }
const zclass4_health = 1500
const zclass4_speed = 265
const Float:zclass4_gravity = 1.0
const Float:zclass4_knockback = 0.5
const zclass4_infecthp = 200 // extra hp for infections
 
/*============================================================================*/
 
// Class IDs
new g_zclass_leech
 
// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    register_plugin("[ZP] Default Zombie Classes", "4.2", "MeRcyLeZZ")
 
    // Register all classes
    zp_register_zombie_class(zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, zclass1_knockback)    
    zp_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, zclass2_knockback)
    zp_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, zclass3_knockback)
    zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
}
 
// User Infected forward
public zp_user_infected_post(id, infector)
{
    // If attacker is a leech zombie, gets extra hp
    if (zp_get_user_zombie_class(infector) == g_zclass_leech)
        set_pev(infector, pev_health, float(pev(infector, pev_health) + zclass4_infecthp))
}
I'd like to know 3 things :
1. How come you only have 4 classes in the code?
2. How does your other zombie classes heal 30HP only? At default its 100 for all other classes.
3. And did you know that the g_zclass_leech is supposed to be used to register your class 4?

And I dont understand how it is possible that your leech zombie only heals 30HP... No help from me, so sorry.
__________________
Zombie Lurker is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 05-23-2009 , 16:26   Re: leech zombie / problem
Reply With Quote #3

Code:
    zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
--->
Code:
   g_zclass_leech =  zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
@Zombie lurker: he probably set zp_zombie_infect_health to 30 instead of default value, notice he said "only 30 hp, like all other classes"
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 05-23-2009 , 20:07   Re: leech zombie / problem
Reply With Quote #4

Quote:
Originally Posted by G-Dog View Post
Code:
    zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
--->
Code:
   g_zclass_leech =  zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
@Zombie lurker: he probably set zp_zombie_infect_health to 30 instead of default value, notice he said "only 30 hp, like all other classes"
Oh ok. I thought he wouldnt change that... lol

<----------------------------------------------EDIT ---------------------------------------------->
I still dont understand something. How come his default classes plugin has only 4 classes? I thought there was 5?
__________________

Last edited by Zombie Lurker; 05-23-2009 at 20:12.
Zombie Lurker 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 02:14.


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