command help
#1

I added a /pay command to my server and i got my friend to get on and to help test it out and when i do it says " you gave 90 dollars to" and thats it..


this is my command
pawn Код:
CMD:pay(playerid, params[])
{
    new giveplayerid, amount;
    new string[128];
    if (sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /pay [playerid/partname] [amount]");
    else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Funds");
    else if (giveplayerid == playerid) SendClientMessage(playerid, 0xFF0000AA, "You cannot send money to yourself");
    GivePlayerMoney(giveplayerid, amount);
    GivePlayerMoney(playerid, -amount);
    format(string, sizeof string, "[SERVER] %d amount of Money has been Sent to %s", amount, giveplayerid);
    SendClientMessage(playerid, COLOR_RED, string);
    format(string, sizeof string, "[SERVER] %d amount of Money has Sent by %s", amount, playerid);
    SendClientMessage(giveplayerid, COLOR_RED, string);
    return 1;
}
Reply


Messages In This Thread
command help - by Michael_Cuellar - 19.12.2012, 07:04
Re: command help - by Marven - 19.12.2012, 08:38
Re: command help - by RedCrossER - 19.12.2012, 08:45
Re: command help - by Konstantinos - 19.12.2012, 09:18

Forum Jump:


Users browsing this thread: 1 Guest(s)