Heal CMD
#1

Hey,

How would i make the heal command with a payout? because at the moment the player will receive 1k ever heal so this means if the player is 99% health the will still get 1000$ how can i edit this so that the player will receive say 10$ ?

This is the command i am using:

pawn Код:
CMD:heal(playerid,params[])
{
    new pID;
    if(gTeam[playerid] == Medic) return SendClientMessage(playerid,COLOR_RED,"You must be a medic to use this command");
    else if(sscanf(params, "u", pID)) SendClientMessage(playerid,COLOR_YELLOW,"Please use /heal [playerid]");
    else if(GetPlayerHealthEx(pID) == 100) SendError(playerid,"This player is already full health");
    else if(PlayerFromPlayer(playerid,pID,4)) SendClientMessage(playerid,COLOR_YELLOW,"%s is not close enough to heal");
    else if(!IsPlayerConnected(pID)) SendClientMessage(playerid,COLOR_YELLOW,"That player is not connected!");
    else if(pID == playerid) SendClientMessage(playerid,COLOR_YELLOW,"You cannot use this command to heal your self");
    else
    {
    SetPlayerHealth(pID,100);
    GivePlayerMoney(playerid,1000);
    GivePlayerMoney(pID,-1000);
    SendClientMessageFormatted(playerid,COLOR_YELLOW,"You have healed %s", ReturnPlayerName(pID),pID);
    SendClientMessageFormatted(pID,COLOR_YELLOW,"You have been healed by %s for $1000", ReturnPlayerName(playerid),playerid);
    }
    return 1;
}
Reply


Messages In This Thread
Heal CMD - by Michael[NBK] - 25.10.2011, 16:04
Re: Heal CMD - by Kingunit - 25.10.2011, 16:07
Re: Heal CMD - by Gamer_Z - 25.10.2011, 16:12
Re: Heal CMD - by =WoR=Varth - 25.10.2011, 16:14
Re: Heal CMD - by Michael[NBK] - 25.10.2011, 16:15
Re: Heal CMD - by =WoR=Varth - 25.10.2011, 16:29
Re: Heal CMD - by Michael[NBK] - 25.10.2011, 16:30
Re: Heal CMD - by =WoR=Varth - 25.10.2011, 16:33
Re: Heal CMD - by Michael[NBK] - 25.10.2011, 16:36

Forum Jump:


Users browsing this thread: 2 Guest(s)