07.12.2009, 17:24
Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
|
pawn Код:
stock ChangePlayerHealth(playerid, method=increase, Float:amount)
{
new Float:health;
if(GetPlayerHealth(playerid, health))
{ //EDIT
switch(method)
{
case increase: return SetPlayerHealth(playerid, health+amount);
case decrease: return SetPlayerHealth(playerid, health-amount);
}
}
}
pawn Код:
if(ChangePlayerHealth(playerid, increase, strval(tmp))) //it will actually return if SetPlayerHealth succeeded.
{
SendClientMessage(playerid, COLOR_WHAT, "Changing player health successful!");
}//so it's not always returning true.