17.08.2014, 23:11
#1
use
reason? It's like autoincrement.
#2
Of course you will have to fix the code, so that it works for your system
use
Код:
enum { DIALOG_HOWEVER_YOU_CALL_IT,// DIALOG_HOWEVER_YOU_CALL_IT = 500, <- if u write it like this, it will count from 500 up to the limit DIALOG_CREDIT1_CONFIRM }
#2
Код:
CMD:Buycredit.. { //actually you dont need params here #pragma unused params ShowPlayerDialog(playerid,DIALOG_HOWEVER_YOU_CALL_IT,DIALOG_STYLE_LIST," Credits","1 Credit\n2 Credits\n..","Ok","Nope"); return 1; }
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case DIALOG_HOWEVER_YOU_CALL_IT: { if(!response)return 1; switch(listitem) { case 0://1 credit { ShowPlayerDialog(playerid,DIALOG_CREDIT1_CONFIRM,DIALOG_STYLE_MSGBOX,"Credit #1","Buy 1 Credit for 1.000.000.","Confirm","Nope"); } case 1://2 credit { //same ^ } } } case DIALOG_CREDIT1_CONFIRM: { if(!response)return SendClientMessage(playerid,-1," You disagreed"); GivePlayerMoney(playerid,GetPlayerMoney(playerid) -100000); new i,string[60]; format(string,sizeof(string)," %s bought 1 Credit.",NameStuff); for(i;<MAX_PLAYERS;i++) { if(!IsPlayerConnected(i))continue; if(!YourAdminStuff(i))continue; SendClientMessage(i,-1,string); } } } return 1; }