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

Zombie class health zp 5.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nunuxer
Junior Member
Join Date: Jan 2021
Old 02-10-2021 , 15:35   Zombie class health zp 5.0
Reply With Quote #1

Hello !

I have this plugin for a zombie class, but when I change const zclass_health the zombie still have the default amount (2600), can somebody help me out ?

PHP Code:
#include <amxmodx>
#include <engine>
#include <zombie_plague_special>
#include <zombiexp>

new bool:caughtJump[33]
new 
bool:doJump[33]
new 
Float:jumpVeloc[33][3]
new 
newButton[33]
new 
numJumps[33]
new 
g_zclass_spider

//====================================================================================================
static const TITLE[] = "[ZP] Spider Zombie"
static const VERSION[] = "0.6"
static const AUTHOR[] = "OneEyed+Roadrage"
//====================================================================================================


new const zclass_name[] = { "Undercover Zombie" }
new const 
zclass_info[] = { "\rHuman model + jumps" }
new const 
zclass_model[] = { "groaza_terror" }
new const 
zclass_clawmodel[] = { "v_demi_hands.mdl" }
const 
zclass_health 2600// health
const zclass_speed 360 // speed
const Float:zclass_gravity 0.78 // gravity
const Float:zclass_knockback 0.9 // knocback
const zclass_level // level required

public plugin_init()
{
    
register_plugin(TITLE,VERSION,AUTHOR)
    
    
register_cvar("walljump_str","600.0")
    
register_cvar("walljump_num","10")
    
    
register_touch("player""worldspawn""Touch_World")
    
register_touch("player""func_wall""Touch_World")
    
register_touch("player""func_breakable""Touch_World")


public 
plugin_precache()
{
    
g_zclass_spider zpxp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockbackzclass_level)
}
public 
client_disconnect(id) {
    
caughtJump[id] = false
    doJump
[id] = false
    
for(new x=0;x<3;x++)
        
jumpVeloc[id][x] = 0.0
    newButton
[id] = 0
    numJumps
[id] = 0
}

public 
client_PreThink(id)
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
    
if(zp_get_user_zombie_class(id) != g_zclass_spider) return PLUGIN_CONTINUE 
    
    newButton
[id] = get_user_button(id)
    new 
oldButton get_user_oldbutton(id)
    new 
flags get_entity_flags(id)

    if(
caughtJump[id] && (flags FL_ONGROUND)) 
    {
        
numJumps[id] = 0
        caughtJump
[id] = false
        
return PLUGIN_CONTINUE
    
}    
        
    
//begin when we jump
    
if((newButton[id] & IN_JUMP) && (flags FL_ONGROUND) && !caughtJump[id] && !(oldButton IN_JUMP) && !numJumps[id]) 
    {
        
caughtJump[id] = true
        entity_get_vector
(id,EV_VEC_velocity,jumpVeloc[id])
        
jumpVeloc[id][2] = get_cvar_float("walljump_str")
        return 
PLUGIN_CONTINUE
    
}    
    return 
PLUGIN_CONTINUE
}

public 
client_PostThink(id
{
    
    if(!
is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
    
if(zp_get_user_zombie_class(id) != g_zclass_spider) return PLUGIN_CONTINUE
    
    
//do velocity if we walljumped
    
if(doJump[id]) 
    {
        
entity_set_vector(id,EV_VEC_velocity,jumpVeloc[id])
        
doJump[id] = false
        
return PLUGIN_CONTINUE
    
}
    if(
numJumps[id] >= get_cvar_num("walljump_num")) //reset if we ran out of jumps
    
{
        
numJumps[id] = 0
        caughtJump
[id] = false
        
return PLUGIN_CONTINUE
    
}    
    return 
PLUGIN_CONTINUE
}

public 
Touch_World(idworld
{
    if(
is_user_alive(id)) 
    {
        
//if we touch wall and have jump pressed, setup for jump
        
if(caughtJump[id] && (newButton[id] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND)) 
        {
            
            
//reverse velocity
            
for(new x=0;x<2;x++)
                
jumpVeloc[id][x] *= -1.0
                
            numJumps
[id]++
            
doJump[id] = true
        
}    
    }

nunuxer is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-10-2021 , 18:35   Re: Zombie class health zp 5.0
Reply With Quote #2

You should edit zp_zombieclasses.ini instead. You can find it in addons/amxmodx/configs/
__________________









Last edited by CrazY.; 02-10-2021 at 18:36.
CrazY. is offline
nunuxer
Junior Member
Join Date: Jan 2021
Old 02-11-2021 , 12:18   Re: Zombie class health zp 5.0
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
You should edit zp_zombieclasses.ini instead. You can find it in addons/amxmodx/configs/
I managed to do it but seems like the health is duplicating (I set 5000, the class get 10000).
nunuxer is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 02-11-2021 , 13:32   Re: Zombie class health zp 5.0
Reply With Quote #4

try to change const in new
lexzor is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-11-2021 , 13:52   Re: Zombie class health zp 5.0
Reply With Quote #5

Quote:
Originally Posted by lexzor View Post
try to change const in new
How does that make any sense?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
lexzor
Veteran Member
Join Date: Nov 2020
Old 02-11-2021 , 14:07   Re: Zombie class health zp 5.0
Reply With Quote #6

i know that value of const can't be changed so maybe it will work if he try to use with new and cvars
lexzor is offline
nunuxer
Junior Member
Join Date: Jan 2021
Old 02-11-2021 , 14:16   Re: Zombie class health zp 5.0
Reply With Quote #7

Quote:
Originally Posted by lexzor View Post
i know that value of const can't be changed so maybe it will work if he try to use with new and cvars
zp_zombie_first_hp 4.0 // First zombie HP multiplier (2.0 = double health)

From zombie_plague_ultimate.cfg, that was the problem. Fixed .
nunuxer is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-11-2021 , 14:38   Re: Zombie class health zp 5.0
Reply With Quote #8

Quote:
Originally Posted by lexzor View Post
i know that value of const can't be changed so maybe it will work if he try to use with new and cvars
I think you quite misunderstood what "to change value" means here.
__________________

Last edited by OciXCrom; 02-11-2021 at 14:38.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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