Raised This Month: $ Target: $400
 0% 

Added hp not GIVE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Legend
Member
Join Date: Mar 2010
Location: Denmark
Old 03-10-2010 , 09:13   Added hp not GIVE
Reply With Quote #1

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
__________________
Legend is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-10-2010 , 09:21   Re: Added hp not GIVE
Reply With Quote #2

Code:
new hp = get_user_health(id) set_user_health(id, hp - 10 + 15)
__________________
I am a newbie. Don't blame for my stupid question

Last edited by edward0810; 03-10-2010 at 09:23.
edward0810 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-10-2010 , 09:23   Re: Added hp not GIVE
Reply With Quote #3

set_user_health( id, get_user_health( id ) + 15 );
__________________
xPaw is offline
Legend
Member
Join Date: Mar 2010
Location: Denmark
Old 03-10-2010 , 09:45   Re: Added hp not GIVE
Reply With Quote #4

Thanks
__________________
Legend is offline
Legend
Member
Join Date: Mar 2010
Location: Denmark
Old 03-11-2010 , 04:22   Re: Added hp not GIVE
Reply With Quote #5

Is it possible to add hp every 2. seconds in 10 seconds?
__________________
Legend is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-11-2010 , 04:59   Re: Added hp not GIVE
Reply With Quote #6

Code:
set_task (2, "MyFunction", id, "", 0, a, 5)
__________________
I am a newbie. Don't blame for my stupid question
edward0810 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-11-2010 , 06:44   Re: Added hp not GIVE
Reply With Quote #7

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

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Legend
Member
Join Date: Mar 2010
Location: Denmark
Old 03-11-2010 , 09:25   Re: Added hp not GIVE
Reply With Quote #8

thanks
__________________
Legend 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 08:37.


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