i make some thing like this but error like this
PHP код:
error 001: expected token: ";", but found "if"
PHP код:
COMMAND:eventbank(playerid, params[])
{
new money,string[128],str1[100],string1[100];
if(sscanf(params, "sd[100]","donate",money))return SendClientMessage(playerid, COLOR_RED, "[USAGE]:{FFFFFF}/eventbank donate [AMOUNT]");
{
if(money < 1000) return SendClientMessage(playerid, COLOR_RED,"[ERROR]:{FFFFFF}You can donate at least $1000");
if(GetPlayerMoney(playerid) < money) return SendClientMessage(playerid,COLOR_RED,"[ERROR]:{FFFFFF} You don't have this money");
format(string,sizeof(string),"[EVENT BANK]:{ffffff}%s(%d) have donate $%d to the event bank.",Name(playerid),playerid,money);
SendClientMessageToAll(COLOR_YELLOW,string);
SetPlayerMoney(playerid,GetPlayerMoney(playerid)-money);
eventbank += money;
return 1;
}
else if(sscanf(params, "sd", "withdraw", money))return SendClientMessage(playerid,COLOR_RED, "[USAGE]:{FFFFFF}/eventbank withdraw [AMOUNT]");
{
format(str1,sizeof(str1),"[ERROR]:{FFFFFF}There are only $%d in event bank.",eventbank);
if(money > GetInfo(playerid,"Bank")) return SendClientMessage(playerid,COLOR_RED,str1);
format(string,sizeof(string),"[EVENT BANK]:{ffffff}%s(%d) have withdraw $%d from the event bank.",Name(playerid),playerid,money);
SendClientMessage(playerid,COLOR_YELLOW,string);
eventbank -= money;
SetPlayerMoney(playerid, GetPlayerMoney(playerid) + money );
return 1;
}
else if(sscanf(params,"s","balance"))
{
#pragma unused params
format(string1,sizeof(string1),"[EVENTBANK]:{ffffff}There are $%d in event bank",eventbank);
SendClientMessage(playerid,COLOR_YELLOW,string1);
return 1;
}
return SendClientMessage(playerid, 0xff0000AA, "[USAGE]:{FFFFFF}/eventbank [donate/withdraw/balance]");
}