18.03.2012, 14:25
Hi, I have a problem with my command i have this :
when i typing in game /donate 100 i receive this:
Help me for this problem.
Код:
CMD:donate(playerid, params[]) { if(IsPlayerConnected(playerid)) { new moneys, string[256]; tmp = strtok(params, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /donate [amount]"); if(PlayerInfo[playerid][pLocal] == 106) return SendClientMessage(playerid, COLOR_GREY, "You can't use this comand right here."); moneys = strval(tmp); if(moneys < 0 || moneys > 1000000) return SendClientMessage(playerid, COLOR_GREY, "You can't donate less than $1.000 or more than $1.000.000!"); if(GetPlayerMoney(playerid) < moneys) return SendClientMessage(playerid, COLOR_GREY, "Transaction amount is invalid."); GivePlayerMoney(playerid, -moneys); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s donated %s!",sendername, FormatMoney(moneys)); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); PayLog(string); format(string, sizeof(string), "~w~Thank you for your donation of~n~~r~~h~%s~w~, ~b~~h~%s ~w~!",sendername, FormatMoney(moneys)); GameTextForPlayer(playerid, string, 3000, 5); format(string, sizeof(string), "* %s donated %s to The Mayor.",sendername, FormatMoney(moneys)); SendFamilyMessage(7, COLOR_YAKUZA, string); } return 1; }
Код:
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /donate [amount]");