Raised This Month: $ Target: $400
 0% 

Help / Support [ZP] Zclass : Zombie Regenerator (BUG)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
luankc
Junior Member
Join Date: Mar 2011
Old 03-02-2012 , 17:51   [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #1

Quote:
L 03/02/2012 - 04:59:09: [AMXX] Displaying debug trace (plugin "zp_zclass_regeneration.amxx")
L 03/02/2012 - 04:59:09: [AMXX] Run time error 10: native error (native "zp_get_user_zombie_class")
L 03/02/2012 - 04:59:09: [AMXX] [0] zp_zclass_regeneration.sma::zp_user_infected_ post (line 73)
How can I fix this error?

SMA:
Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>


new g_zclass_regen_toggle, g_time, g_amount

new const zclass8_name[] = { "xxx" }
new const zclass8_info[] = { "xxx" }
new const zclass8_model[] = { "xxx" }
new const zclass8_clawmodel[] = { "xxx.mdl" }
const zclass8_health = xxx
const zclass8_speed = xxx
const Float:zclass8_gravity = xxx
const Float:zclass8_knockback = xxx

new g_zclass_Regen

public plugin_init() 
{
	g_zclass_regen_toggle = register_cvar("zp_zclass_regen", "x")
	g_time = register_cvar("zp_regen_time", "x")
	g_amount = register_cvar("zp_regen_amount", "xx")
	
	register_event("Damage", "SetRegeneration", "be", "x>0")
}

public plugin_precache()
{
	register_plugin("[ZP] Zclass : Zombie Regenerator", "1.0", "The_Thing")
	
	g_zclass_Regen = zp_register_zombie_class(zclass8_name, zclass8_info, zclass8_model, zclass8_clawmodel, zclass8_health, zclass8_speed, zclass8_gravity, zclass8_knockback)
}

public SetRegeneration(player)
{
	if (!get_pcvar_num(g_zclass_regen_toggle) || !is_user_alive(player) || !zp_get_user_zombie(player))
	return PLUGIN_CONTINUE
	
	if (zp_get_user_zombie_class(player) != g_zclass_Regen)
	return PLUGIN_CONTINUE
	
	if (get_user_health(player) < zp_get_zombie_maxhealth(player))
		set_task(get_pcvar_float(g_time), "Regenerate", player, _, _, "b")
	
	return PLUGIN_CONTINUE
}

public Regenerate(player)
{
	if (!get_pcvar_num(g_zclass_regen_toggle) || !is_user_alive(player) || !zp_get_user_zombie(player))
	return PLUGIN_CONTINUE
	
	if (zp_get_user_zombie_class(player) != g_zclass_Regen)
	return PLUGIN_CONTINUE
	
	new regen_health = get_user_health(player)
	new max_health = zp_get_zombie_maxhealth(player) - regen_health
	
	if (max_health <= get_pcvar_num(g_amount))
	{
		set_pev(player, pev_health, regen_health + float(max_health))
		remove_task(player)
	}
	
	set_pev(player, pev_health, regen_health + get_pcvar_float(g_amount))
	
	return PLUGIN_CONTINUE
}

public zp_user_infected_post(player, infector)
{
	if (zp_get_user_zombie_class(infector) == g_zclass_Regen)
	{	
		new regen_health = get_user_health(player)
		new max_health = zp_get_zombie_maxhealth(player) - regen_health
	
		if (max_health <= get_pcvar_num(g_amount))
		{
			set_pev(infector, pev_health, regen_health + float(max_health))
			remove_task(infector)
			
			return PLUGIN_CONTINUE
		}
	
		set_pev(infector, pev_health, regen_health + get_pcvar_float(g_amount))
	}
	return PLUGIN_CONTINUE
}
luankc is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 03-02-2012 , 18:29   Re: [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #2

Try changing in the public SetRegeneration( ) changing all returns with PLUGIN_HANDLED;
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
luankc
Junior Member
Join Date: Mar 2011
Old 03-04-2012 , 09:49   Re: [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #3

Quote:
Originally Posted by lucas_7_94 View Post
Try changing in the public SetRegeneration( ) changing all returns with PLUGIN_HANDLED;
you could make this issue for me, please?
thank you
luankc is offline
luankc
Junior Member
Join Date: Mar 2011
Old 03-20-2012 , 15:33   Re: [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #4

UP!
luankc is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-20-2012 , 17:32   Re: [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #5

Here.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>


new g_zclass_regen_toggleg_timeg_amount

new const zclass8_name[] = { "xxx" }
new const 
zclass8_info[] = { "xxx" }
new const 
zclass8_model[] = { "xxx" }
new const 
zclass8_clawmodel[] = { "xxx.mdl" }
const 
zclass8_health 1000
const zclass8_speed 100
const Float:zclass8_gravity 1.0
const Float:zclass8_knockback 1.0

new g_zclass_Regen

public plugin_init() 
{
    
g_zclass_regen_toggle register_cvar("zp_zclass_regen""x")
    
g_time register_cvar("zp_regen_time""x")
    
g_amount register_cvar("zp_regen_amount""xx")
    
    
register_event("Damage""SetRegeneration""be""x>0")
}

public 
plugin_precache()
{
    
register_plugin("[ZP] Zclass : Zombie Regenerator""1.0""The_Thing")
    
    
g_zclass_Regen zp_register_zombie_class(zclass8_namezclass8_infozclass8_modelzclass8_clawmodelzclass8_healthzclass8_speedzclass8_gravityzclass8_knockback)
}

public 
SetRegeneration(player)
{
    if (!
get_pcvar_num(g_zclass_regen_toggle) || !is_user_alive(player) || !zp_get_user_zombie(player))
    return 
PLUGIN_CONTINUE
    
    
if (zp_get_user_zombie_class(player) != g_zclass_Regen)
    return 
PLUGIN_CONTINUE
    
    
if (get_user_health(player) < zp_get_zombie_maxhealth(player))
        
set_task(get_pcvar_float(g_time), "Regenerate"player__"b")
    
    return 
PLUGIN_CONTINUE
}

public 
Regenerate(player)
{
    if (!
get_pcvar_num(g_zclass_regen_toggle) || !is_user_alive(player) || !zp_get_user_zombie(player))
    return 
PLUGIN_CONTINUE
    
    
if (zp_get_user_zombie_class(player) != g_zclass_Regen)
    return 
PLUGIN_CONTINUE
    
    
new regen_health get_user_health(player)
    new 
max_health zp_get_zombie_maxhealth(player) - regen_health
    
    
if (max_health <= get_pcvar_num(g_amount))
    {
        
set_pev(playerpev_healthregen_health float(max_health))
        
remove_task(player)
    }
    
    
set_pev(playerpev_healthregen_health get_pcvar_float(g_amount))
    
    return 
PLUGIN_CONTINUE
}

public 
zp_user_infected_post(playerinfector)
{
     if(
is_user_alive(player) && is_user_alive(infector))
     {
    if (
zp_get_user_zombie_class(infector) == g_zclass_Regen)
    {    
        new 
regen_health get_user_health(player)
        new 
max_health zp_get_zombie_maxhealth(player) - regen_health
    
        
if (max_health <= get_pcvar_num(g_amount))
        {
            
set_pev(infectorpev_healthregen_health float(max_health))
            
remove_task(infector)
            
            return 
PLUGIN_CONTINUE
        
}
    
        
set_pev(infectorpev_healthregen_health get_pcvar_float(g_amount))
    }
     }
     return 
PLUGIN_CONTINUE

__________________
H.RED.ZONE is offline
ViBE
Member
Join Date: Jul 2011
Location: Somewhere over the...
Old 12-26-2015 , 21:11   Re: [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #6

i have a ZM config and i'm planning to rebuild my old server but i have no clue where did i found this plugin (attachment). i guess H.RED.ZONE's edited version is based on this. i'm a bit out of time so i had no time yet to figure out where is the latest version if exist. where can i found the latest version and does it work with ZP 4.3 5a? or does my attachment work fine with this mod?
Attached Files
File Type: sma Get Plugin or Get Source (zp_zclass_regeneration.sma - 900 views - 3.3 KB)
ViBE is offline
Send a message via ICQ to ViBE
TickTack
Member
Join Date: Dec 2009
Old 12-29-2015 , 07:39   Re: [ZP] Zclass : Zombie Regenerator (BUG)
Reply With Quote #7

Would be nice to have a good clean zombie regen code that works after zombie takes damage (timed) not at all times.
TickTack 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 16:55.


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