AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Added hp not GIVE (https://forums.alliedmods.net/showthread.php?t=120982)

Legend 03-10-2010 09:13

Added hp not GIVE
 
Is it even possible to add hp like if you have 100 and lose 10 and then you get +15 so you get 105 not like this command:

PHP Code:

set_user_health(id105


edward0810 03-10-2010 09:21

Re: Added hp not GIVE
 
Code:
new hp = get_user_health(id) set_user_health(id, hp - 10 + 15)

xPaw 03-10-2010 09:23

Re: Added hp not GIVE
 
set_user_health( id, get_user_health( id ) + 15 );

Legend 03-10-2010 09:45

Re: Added hp not GIVE
 
Thanks

Legend 03-11-2010 04:22

Re: Added hp not GIVE
 
Is it possible to add hp every 2. seconds in 10 seconds?

edward0810 03-11-2010 04:59

Re: Added hp not GIVE
 
Code:
set_task (2, "MyFunction", id, "", 0, a, 5)

ConnorMcLeod 03-11-2010 06:44

Re: Added hp not GIVE
 
Use this stock :

Add_User_Hps(id, 15)

PHP Code:

Add_User_Hps(idHpsMaxHps=100)
{
    if( !
is_user_alive(id) )
    {
        return 
0
    
}

    new 
iNewHealth

    
if( MaxHps >= )
    {
        if( 
MaxHps == )
        {
            
MaxHps pev(idpev_max_health)
        }
        
iNewHealth min(get_user_health(id) + HpsMaxHps)
    }
    else
    {
        
iNewHealth =get_user_health(id) + Hps
    
}

    
set_user_health(idiNewHealth)

    return 
1



Legend 03-11-2010 09:25

Re: Added hp not GIVE
 
thanks


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

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