19.12.2012, 07:04
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
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;
}