AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Vip problem (https://forums.alliedmods.net/showthread.php?t=121135)

DoviuX 03-12-2010 02:27

Vip problem
 
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!")
        }
    }



grimvh2 03-13-2010 05:38

Re: Vip problem
 
The event is called before he is actually hurt. When you check hes health its still 100.


All times are GMT -4. The time now is 08:42.

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