Need Help
#6

pawn Код:
CMD:pay(playerid, params[])
{
    new otherid, cash;
    if (sscanf(params, "dd", otherid, cash)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /pay [ID] [Cash]");
    else
    {
        if(GetPlayerMoney(playerid) < cash) SendClientMessage(playerid, COLOR_RED, "You don't have that much!");
        if(!IsPlayerConnected(otherid)) SendClientMessage(playerid, COLOR_RED, "That PlayerID is not connected!");
        if(otherid == playerid) SendClientMessage(playerid, COLOR_RED, "It is pointless to pay yourself..");
        else
        {
             new Float:X, Float:Y, Float:Z;
             GetPlayerPos(otherid, X, Y, Z);
             if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z);
             {
                 GivePlayerMoney(playerid, -cash);
                 GivePlayerMoney(otherid, cash);
             }
             else return SendClientMessage(playerid, -1, "You are not close enough to the specified player!");
          }
    }
    return 1;
}
Try this
Reply


Messages In This Thread
Need Help - by rumen98 - 27.07.2012, 10:57
Re: Need Help - by Devilxz97 - 27.07.2012, 10:59
Re: Need Help - by rumen98 - 27.07.2012, 11:01
Re: Need Help - by Ranama - 27.07.2012, 11:04
Re: Need Help - by rumen98 - 27.07.2012, 11:07
Re: Need Help - by rscaerzx - 27.07.2012, 11:12
Re: Need Help - by rumen98 - 27.07.2012, 12:04
Re: Need Help - by avivelkayam - 27.07.2012, 12:14

Forum Jump:


Users browsing this thread: 3 Guest(s)