29.03.2018, 01:22
Hello guys I need help on how to separate numbers with 1 comma example on this command I want to add commas
it's set that if price is higher then 50000 it should send message to all that "ID has donated 50,000 to charity" but I want to make it shows "ID has donated $50,000 to charity"
Код:
CMD:charity(playerid, params[]) { new string[128], moneys; if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /charity [amount]"); moneys = strval(params); if(moneys < 0) return SendClientMessage(playerid, COLOR_GRAD1, "That's not enough!"); if(GetPlayerCash(playerid) < moneys) return SendClientMessage(playerid, COLOR_GRAD1, "You don't have that much money."); GivePlayerCash(playerid, -moneys); format(string, sizeof(string), "%s, thank you for your donation of $%d.",GetPlayerNameEx(playerid), moneys); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_YELLOW, string); if(moneys < 50000) if(GetPlayerCash(playerid) < moneys) return SendClientMessage(playerid, COLOR_GRAD1, "You don't have that much money."); GivePlayerCash(playerid, -moneys); format(string, sizeof(string), "CHARITY: %s has donated $%d to the San Andreas Charity ((/charity)).",GetPlayerNameEx(playerid), moneys); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SendClientMessageToAll(COLOR_DBLUE, string); return 1; }