Raised This Month: $ Target: $400
 0% 

Vip problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 03-12-2010 , 02:27   Vip problem
Reply With Quote #1

I got a problem with a vip plugin: when i hurt once health doesn't rengenrate when i hurt second time my health rengenrates what can be the problem ?

Code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("GunGame Vip""1.0""TBagT")

        
RegisterHamHam_TakeDamage"player""TakeDamage_player"
}
    
public 
health(idplayer)
{
    if (
get_user_flags(player) & ADMIN_LEVEL_H)
    {
        new 
hp get_user_health(id);
    
        if(
hp 100)
        { 
            
set_user_health(id100);
        }
        else
        {
            
client_print(idprint_chat"[GunGame]: No more health for you."hp)
            return 
PLUGIN_HANDLED;
        }
        return 
PLUGIN_HANDLED;
    }
}

public 
TakeDamage_player(idplayer

    if(
is_user_alive(id))
    {
        if (
get_user_flags(player) & ADMIN_LEVEL_H)
        {
            new 
hp get_user_health(id);
                
            if(
hp 100)
            {
                
set_task(15.0,"health"id);
            }
            
client_print(idprint_chat"[GunGame]: Health Will Regenerate in 15Seconds!")
        }
    }

DoviuX is offline
Send a message via Skype™ to DoviuX
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 03-13-2010 , 05:38   Re: Vip problem
Reply With Quote #2

The event is called before he is actually hurt. When you check hes health its still 100.
__________________
I am out of order!
grimvh2 is offline
Reply


Thread Tools
Display Modes

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 08:42.


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