02.08.2012, 07:33
Hey,what's wrong here? The command is not working,the dialog is showing but when I select,nothing happends.
Код:
#define CONVERTING 1600 public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == CONVERTING) { if(response) { if(listitem == 0) { if ( GetPVarInt( playerid, "Money" ) < 1000000 ) return SendClientMessage( playerid, -1, "You need 1000000$ to get 100 Coins!"); SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") + 100); SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") - 1000000); } if(listitem == 1) { if ( GetPVarInt( playerid, "Money" ) < 1000000 ) return SendClientMessage( playerid, -1, "You need 1000000$ to get 1 Score!"); SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") + 1); SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") - 1000000); } if(listitem == 2) { if ( GetPVarInt( playerid, "Coins" ) < 100 ) return SendClientMessage( playerid, -1, "You need 100 Coins to get 1000000$!"); SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") + 1000000); SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") - 100); } if(listitem == 3) { if ( GetPVarInt( playerid, "Coins" ) < 100 ) return SendClientMessage( playerid, -1, "You need 100 Coins to get 1 Score!"); SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") + 1); SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") - 100); } if(listitem == 4) { if ( GetPVarInt( playerid, "Score" ) < 2 ) return SendClientMessage( playerid, -1, "You need minimum 2 Score to get 1000000$!"); SetPVarInt(playerid, "Money", GetPVarInt(playerid,"Money") + 1000000); SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") - 1); } if(listitem == 5) { if ( GetPVarInt( playerid, "Score" ) < 2 ) return SendClientMessage( playerid, -1, "You need minimum 2 Score to get 100 Coins!"); SetPVarInt(playerid, "Coins", GetPVarInt(playerid,"Coins") + 100); SetPVarInt(playerid, "Score", GetPVarInt(playerid,"Score") - 1); } } else { SCM(playerid,COLOR_DGREY,"You closed."); } } return 1; } CMD:convert( playerid, params[ ] ) { ShowPlayerDialog(playerid, CONVERTING, DIALOG_STYLE_LIST, "Converting Money,Coins,Score.",""COLOR_LIGHTBLUE"1000000$ {FFFFFF}-> {5D66CC}100 Coins\n"COLOR_LIGHTBLUE"1000000$ {FFFFFF}-> {5D66CC}1 Score\n"COLOR_LIGHTBLUE"100 Coins {FFFFFF}-> {5D66CC}1000000$\n"COLOR_LIGHTBLUE"100 Coins {FFFFFF}-> {5D66CC}1 Score\n"COLOR_LIGHTBLUE"1 Score {FFFFFF}-> {5D66CC}1000000$\n"COLOR_LIGHTBLUE"1 Score {FFFFFF}-> {5D66CC}100 Coins","Convert","Cancel"); }