CMD: Heal - 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: CMD: Heal (
/showthread.php?tid=459339)
CMD: Heal -
Giroud12 - 22.08.2013
Work or not?
pawn Код:
CMD:heal(playerid,o[])
{
new str[20],Float:HP;
GetPlayerHealth(playerid,HP);
if (HP > 90.0)
SendClientMessage(playerid, RED, "You can't use this command | Reason: Your HP above 90.0");
{
if (GetPlayerMoney(playerid) <= 500) return SendClientMessage(playerid, RED, #CASH_ERROR);
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, RED, "You have killed yourself");
GetPlayerName(playerid,pname, sizeof(pname));
format(str,sizeof(str), "%s was death | Reason: Own kill using [/kill]", pname);
SendClientMessageToAll(RED, str);
return 1;
}
}
}
Sorry for asking this stupid question.I cant open my gtasa to test this script.
Re: CMD: Heal -
JimmyCh - 22.08.2013
Wouldn't have worked because of brackets, undefined pname, and some more.
pawn Код:
CMD:heal(playerid,params[])
{
new Float:HP;
GetPlayerHealth(playerid,HP);
if (HP > 90.0) return SendClientMessage(playerid, RED, "You can't use this command | Reason: Your HP above 90.0!");
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, RED, "#CASH_ERROR");
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, RED, "You have killed yourself");
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname, sizeof(pname));
new str[128];
format(str,sizeof(str), "%s was death | Reason: Own kill using [/kill]", pname(playerid));
SendClientMessageToAll(RED, str);
return 1;
}
This works.
But I don't get it, why if he's using /heal you are killing him and sending a message to everyone that he used /kill?
Re: CMD: Heal -
Giroud12 - 22.08.2013
I just copy paste.Just asking if its work or not.The pname i have define on top.