20.09.2015, 13:05
try this:
PHP код:
CMD:eventbank(playerid, params[])
{
if(!playerData[playerid][playerLoggedIn]) return SCM(playerid, COLOR_WHITE, ""WORD_SERVER"You must be logged in to use this command.");
new selection;
if(sscanf(params, "s", selection)) return SCM(playerid, COLOR_WHITE, ""WORD_SERVER"{B7B7B7}Usage: {FFFFFF}/eventbank [BALANCE\HOST\DONATE]");
if(!strcmp(selection, "donate", true))
{
new amount, string[128];
if(sscanf(params, "i", amount)) return SCM(playerid, COLOR_WHITE, ""WORD_SERVER"{B7B7B7}Usage: {FFFFFF}/eventbank donate [amount]");
if(amount < 1000) return SCM(playerid, COLOR_WHITE, ""WORD_SERVER"You cannot donate less than $1,000.");
format(string, sizeof(string), ""WORD_SERVER"Thanks for donating $%s to the event bank, %s(%d).", FormatNumber(amount), GetName(playerid), playerid);
SendClientMessageToAll(COLOR_WHITE, string);
IncreaseEBBalance(amount);
}
if(!strcmp(selection, "host", true))
{
new string[128];
format(string, sizeof(string), ""WORD_SERVER"The event bank host is: %s", eventBank[host]);
SCM(playerid, COLOR_WHITE, string);
}
if(!strcmp(selection, "balance", true))
{
new string[128];
format(string, sizeof(string), ""WORD_SERVER"The event bank balance is: $%s", FormatNumber(eventBank[balance]));
SCM(playerid, COLOR_WHITE, string);
}
return 1;
}