25.10.2011, 16:04
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:
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;
}