SA-MP Forums Archive
How to make /healme command - 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: How to make /healme command (/showthread.php?tid=614882)



How to make /healme command - Immortal99 - 14.08.2016

How do i make a heal me command and takes 500$ from players money and if player doesnt have 500$ it should say you dont have 500$ using zcmd

Sorry For My Poor English


Re: How to make /healme command - Stinged - 14.08.2016

Код:
CMD:healme(playerid)
{
    if (GetPlayerMoney(playerid) < 500)
        return SendClientMessage(playerid, -1, "You do not have $500.");

    SetPlayerHealth(playerid, 100.0);
    GivePlayerMoney(playerid, -500);
    SendClientMessage(playerid, -1, "You have payed $500 to heal.");
    return 1;
}



Re: How to make /healme command - LifeRah - 14.08.2016

Well, here's the CMD and I've added one more system that if player already got full health he will get a message saying "You already have full health".
PHP код:
CMD:healme(playerid,params[])
{
    new 
Float:health;
    
GetPlayerHealth(playerid,health);
    if(
health == 100.0) return SendClientMessage(playerid, -1"Your health is already full.");
    if(
GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, -1"You do not enough cash.");
    
SetPlayerHealth(playerid100.0);
    
SendClientMessage(playerid, -1"You have healed yourself for 500$.");
    
GivePlayerMoney(playerid, -500);
    return 
1;