Thread: Health Restore
View Single Post
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 11-26-2011 , 11:05   Re: Health Restore
Reply With Quote #7

Quote:
Originally Posted by kotinha View Post
PHP Code:
#include <amxmodx>
#include <fun>

public plugin_init()
{
    
register_plugin("Restore Damage""0.1""kramesa")
    
register_clcmd("say /restore-health""Restore_Damage")
}
public 
Restore_Damage(id)
{
    if(
get_user_health(id) == 100)
        
client_print(idprint_chat"Your life already is 100")
    else
    {
        
set_user_health(id100)
        
client_print(idprint_chat"Your life changed to 100")
    }

kramesa, you have to put {} if you want more that one line of code in the condition.
And if(get_user_health(id) <= 100) means if user health is LOWER or equal to 100. You must use == instead of <=
Ok! Thanks
__________________
kramesa is offline