01.12.2015, 21:39
Hello guys i am trying to make a /donate command which will donate amount i enter to the charity but it not working because it dosent matter if i enter $100 or $100000 it will donate $65535 by default
here is my code:
here is my code:
PHP код:
CMD:donate(playerid, params[])
{
new money, string[128];
if(sscanf(params, "u", money)) return SendClientMessage(playerid, -1, "/Donate [Amount]");
if(money > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1, "You dont have that much money");
GivePlayerMoney(playerid, money);
PlayerInfo[playerid][pCharity] = PlayerInfo[playerid][pCharity]+money;
format(string, sizeof(string), "%s(%d) {A9C4E4}has donated $%d for the charity.", GetPlayerNameEx(playerid), playerid, money);
SendMessageToAll(-1, string);
return 1;
}