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

restore zombies healt


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Viera
Senior Member
Join Date: Sep 2008
Location: Poland
Old 10-15-2008 , 15:13   restore zombies healt
Reply With Quote #1

Hey enybody write mi plugin who restore hp zombies if ther're hurt ?
It's look if zombi was hurt and have 1000HP (max 3000HP) healt was restore 30hp past one second and if healt was full, restore was stoped.
My mod Zombie Plagues 4.06
Thanks for help
Viera is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-15-2008 , 15:18   Re: restore zombies healt
Reply With Quote #2

http://forums.alliedmods.net/showpos...05&postcount=2.
__________________
hleV is offline
Viera
Senior Member
Join Date: Sep 2008
Location: Poland
Old 10-15-2008 , 15:26   Re: restore zombies healt
Reply With Quote #3

this isn't work I write you.

Someone else help me ?

Last edited by Viera; 10-15-2008 at 15:29.
Viera is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-15-2008 , 15:56   Re: restore zombies healt
Reply With Quote #4

Did you try it after I fixed it?
__________________
hleV is offline
Viera
Senior Member
Join Date: Sep 2008
Location: Poland
Old 10-15-2008 , 16:11   Re: restore zombies healt
Reply With Quote #5

nooo hmm so I try
Viera is offline
Viera
Senior Member
Join Date: Sep 2008
Location: Poland
Old 10-15-2008 , 16:16   Re: restore zombies healt
Reply With Quote #6

I have bad new still no working
Viera is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-15-2008 , 17:28   Re: restore zombies healt
Reply With Quote #7

I've tested it and it works fine.

You can try my new, optimized version.
PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define TASK_REGENERATION 1024
 
new g_Regenerationg_MaxHealth;
 
public 
plugin_init()
{
        
register_plugin("Zombie Regeneration""2.0""hleV");
 
        
g_Regeneration register_cvar("amx_regeneration""10");
        
g_MaxHealth register_cvar("amx_maxhealth""100");
 
        
register_event("Damage""SetRegeneration""be""2>0");
}
 
public 
SetRegeneration(Client)
{
        if (!
get_pcvar_num(g_Regeneration) || !get_pcvar_num(g_MaxHealth) || !is_user_connected(Client) || !is_user_alive(Client) || get_user_team(Client) != 1)
                return;
 
        new 
Health get_user_health(Client);
 
        if (
Health get_pcvar_num(g_MaxHealth))
                
set_task(1.0"Regenerate"Client TASK_REGENERATION__"b");
}
 
public 
Regenerate(Task)
{
        if (!
get_pcvar_num(g_Regeneration) || !get_pcvar_num(g_MaxHealth))
                return;
 
        new 
Client Task TASK_REGENERATION;
        new 
Health get_user_health(Client);
 
        if (!
is_user_connected(Client) || !is_user_alive(Client) || get_user_team(Client) != || Health >= get_pcvar_num(g_MaxHealth))
                return;
 
        new 
NeededHealth get_pcvar_num(g_MaxHealth) - Health;
 
        if (
NeededHealth get_pcvar_num(g_Regeneration))
        {
                
set_pev(Clientpev_healthHealth float(NeededHealth));
                
remove_task(Client TASK_REGENERATION);
 
                return;
        }
 
        
set_pev(Clientpev_healthHealth get_pcvar_float(g_Regeneration));

__________________
hleV is offline
Old 10-15-2008, 17:44
Churchboy587
This message has been deleted by v3x. Reason: OT
Viera
Senior Member
Join Date: Sep 2008
Location: Poland
Old 10-16-2008 , 04:17   Re: restore zombies healt
Reply With Quote #8

ok it's working some my plugin's blocks your.

Last edited by Viera; 10-16-2008 at 04:23.
Viera is offline
Viera
Senior Member
Join Date: Sep 2008
Location: Poland
Old 10-16-2008 , 04:44   Re: restore zombies healt
Reply With Quote #9

Sorry it's working on empty amxx with out plugins zombie...
But it not working with zombie plague
Viera is offline
MEN
Junior Member
Join Date: Nov 2007
Old 10-20-2008 , 10:02   Re: restore zombies healt
Reply With Quote #10

The plug-in works in that case when for all zombies same HP but if classes of the zombie differ then quantity HP will be recycled to that level which specified in amx_maxhealth Please could you clean MaxHealth in a plug-in and leave only regeneration for the zombies
MEN is offline
Old 10-20-2008, 11:26
hleV
This message has been deleted by hleV. Reason: Check post below.
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 00:08.


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