18.06.2013, 22:16
is it possible to add health to like a player like +50 something like SetPlayerHealth(playerid,+50);? is this possible?
new Health = GetPlayerHealth ( playerid ) ;
SetPlayerHealth ( playerid , Health+50 ) ;
if(listitem == 6) { if(GetPlayerMoney(playerid) > 5000) { GivePlayerMoney(playerid,-5000); return cmd_thelp(playerid, params[]); } else { SendClientMessage(playerid,SERVER_COL, "You don't have enough money to buy this item");}}}
how can i make it so they don't go over 100 health?
also i got this error i don't want to spam another topic so i will post here Код:
if(listitem == 6) { if(GetPlayerMoney(playerid) > 5000) { GivePlayerMoney(playerid,-5000); return cmd_thelp(playerid, params[]); } else { SendClientMessage(playerid,SERVER_COL, "You don't have enough money to buy this item");}}} |
new Float:Health = GetPlayerHealth ( playerid , Health ) ;
if ( Health < 100 )
{
SetPlayerHealth ( playerid , Health+50 ) ;
return 1;
}
if(listitem == 6)
{
if(GetPlayerMoney(playerid) > 5000)
{
GivePlayerMoney(playerid,-5000);
return cmd_thelp(playerid, params);
}
else
{
SendClientMessage(playerid,SERVER_COL, "You don't have enough money to buy this item");
}
}
if(listitem == 6) { if(GetPlayerMoney(playerid) > 5000) { GivePlayerMoney(playerid,-5000); return cmd_thelp(playerid, params); } else { SendClientMessage(playerid,SERVER_COL, "You don't have enough money to buy this item");}}}
stock GivePlayerHealth(playerid,Amount)
{
new Float:health;
GetPlayerHealth(playerid,health);
new fcalc; fcalc = health + Amount;
if(fcalc > 100)
{
fcalc = fcalc - 100;
SetPlayerHealth(playerid,100);
return fcalc;
}else SetPlayerHealth(playerid,fcalc);
}
stock GivePlayerHealth(playerid,Amount)
{
new Float:health;
GetPlayerHealth(playerid,health);
new fcalc; fcalc = health + Amount;
if(fcalc > 100) return SetPlayerHealth(playerid,100);
SetPlayerHealth(playerid,fcalc);
return 1;
}