Help.. GetPlayerHealth - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help.. GetPlayerHealth (
/showthread.php?tid=514967)
Help.. GetPlayerHealth -
thaKing - 24.05.2014
Fixed.
Re : Help.. GetPlayerHealth -
S4t3K - 24.05.2014
Wrong bracket.
if(health <25)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -75);
{
You open twice a statement, instead of closing it.
Re: Re : Help.. GetPlayerHealth -
thaKing - 24.05.2014
Quote:
Originally Posted by S4t3K
Wrong bracket.
if(health <25)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -75);
{
You open twice a statement, instead of closing it.
|
Can you show me how?
Re : Help.. GetPlayerHealth -
S4t3K - 24.05.2014
You just have to replace the second "{" with a "}"
Re: Help.. GetPlayerHealth -
thaKing - 24.05.2014
Ok.. thanks!
-Lock, if can.
Re: Help.. GetPlayerHealth -
TazmaNiax - 24.05.2014
Try this
Код:
CMD:heal(playerid, params[])
{
new Float:health;
GetPlayerHealth(playerid, health);
if(health <25)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -75);
}
else if(health <50)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -50);
}
else if(health <75)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -25);
}
else if(health <100)
{
SendClientMessage(playerid, red, "Doctor says: You do not need medical attention!");
}
return 1;
}
Re: Help.. GetPlayerHealth -
TazmaNiax - 24.05.2014
Sory for double post
Re: Help.. GetPlayerHealth -
thaKing - 24.05.2014
Quote:
Originally Posted by TazmaNiax
Sory for double post
|
Thanks.