08.07.2010, 00:19
The givecash that I'm using for my server doesn't work, when I try to send someone money, no matter how much it doesn't send them it, and it says "You have sent blablabla $0"
Here's the code..
Thanks
Here's the code..
Код:
dcmd_givecash(playerid,params[]) { new giveplayerid, amount; if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, COLOR_WHITE, "Usage: /givecash [id] [amount]"); else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ID!"); else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Funds"); else { GivePlayerMoney(giveplayerid, amount); GivePlayerMoney(playerid, 0 - amount); new string[128]; format(string, sizeof(string), "%s has sent you $%d", ReturnPlayerName(playerid),amount); SendClientMessage(giveplayerid, COLOR_YELLOW, string); format(string, sizeof(string),"$%d sent to %s", amount,ReturnPlayerName(giveplayerid)); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; }