|
Veteran Member
Join Date: Feb 2011
Location: Brazil
|
11-26-2011
, 11:05
Re: Health Restore
|
#7
|
Quote:
Originally Posted by kotinha
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(id, print_chat, "Your life already is 100")
else
{
set_user_health(id, 100)
client_print(id, print_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
__________________
|
|
|
|