Stellet 7 Odesláno: 22. Prosinec, 2014 Share Odesláno: 22. Prosinec, 2014 Ahoj udělal jsem si Admin Příkazy přes dialog DIALOG_STYLE_LIST více níže: Tady je příkaz: public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/admin", cmdtext, true, 10) == 0) { { ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_LIST, "Admin Příkazy", "Admin level 1\nAdmin level 2\nAdmin level 3\nAdmin level 4\nAdmin level 5", "OK", "CANCEL"); } return 1; } return 0; } Tady je OnDialogResponse: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_ADMIN) { if(response) { switch(listitem) { case 0: ShowPlayerDialog(playerid, DIALOG_A1, DIALOG_STYLE_MSGBOX, "Admin Level 1", "/say /text /clear /getmypos /oall /hpall /aall /var", "OK", ""); case 1: ShowPlayerDialog(playerid, DIALOG_A2, DIALOG_STYLE_MSGBOX, "Admin Level 2", "/mute /unmute /freeze /unfreeze /cheattest", "OK", ""); case 2: ShowPlayerDialog(playerid, DIALOG_A3, DIALOG_STYLE_MSGBOX, "Admin Level 3", "/kick /tune /goto /get /spec /unspec /setskin /respawn", "OK", ""); case 3: ShowPlayerDialog(playerid, DIALOG_A4, DIALOG_STYLE_MSGBOX, "Admin Level 4", "/ban /hp /player /getall /disarmall /car /cardestroy /mappoin /dmcreate /dmjoin /dmstart /dmend /setweather", "OK", ""); case 4: ShowPlayerDialog(playerid, DIALOG_A5, DIALOG_STYLE_MSGBOX, "Admin Level 5", "/gm /gw /setadmin /serverinfo /gmx /setvip /removevip /hidetds /showtds /shownt /setrespect /setskill", "OK", ""); } } return 1; } return 0; Potom dám příkaz ve hře a zobrazí se: Dám třeba Admin Level 1 a OK a nic se neděje vypne se dialog a nic Děkuji předem Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 23. Prosinec, 2014 Share Odesláno: 23. Prosinec, 2014 public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_ADMIN) { if(response) { if(listitem == 0) //zistí či dal prvú vec(Admin 1) { ShowPlayerDialog(playerid, DIALOG_A1, DIALOG_STYLE_MSGBOX, "Admin Level 1", "/say /text /clear /getmypos /oall /hpall /aall /var", "OK", ""); } else if(listitem == 1) //2 vec(Admin 2) { bla bla } } } return 1; } return 0; Link to comment Share on other sites More sharing options...
0 Hlavní moderátor vEnd 279 Odesláno: 23. Prosinec, 2014 Hlavní moderátor Share Odesláno: 23. Prosinec, 2014 public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_ADMIN) { if(response) { if(listitem == 0) //zistí či dal prvú vec(Admin 1) { ShowPlayerDialog(playerid, DIALOG_A1, DIALOG_STYLE_MSGBOX, "Admin Level 1", "/say /text /clear /getmypos /oall /hpall /aall /var", "OK", ""); } else if(listitem == 1) //2 vec(Admin 2) { bla bla } } } return 1; } return 0; nechápu, proč by nemohl používat switch, nemusí to nutně řešit přes podmínky pro autora: jaké používáš ID dialogů? Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 23. Prosinec, 2014 Share Odesláno: 23. Prosinec, 2014 Mimochodom, v tom príkaze máš nepotrebnú zátvorku: public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/admin", cmdtext, true, 10) == 0) { { /* Tu */ ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_LIST, "Admin Příkazy", "Admin level 1\nAdmin level 2\nAdmin level 3\nAdmin level 4\nAdmin level 5", "OK", "CANCEL"); } return 1; } Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 23. Prosinec, 2014 Share Odesláno: 23. Prosinec, 2014 s tou zatvorkou som si tiež všimol Link to comment Share on other sites More sharing options...
0 Tedy 8 Odesláno: 23. Prosinec, 2014 Share Odesláno: 23. Prosinec, 2014 Dle mého názoru bude problém v tom,že se ti shodují DIALOGY - změň ID dialogu na nějaké vyšší číslo a mělo by to jíti vEnd,již tuto chybu "nakousl" Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 23. Prosinec, 2014 Author Share Odesláno: 23. Prosinec, 2014 Furt to nejde Link to comment Share on other sites More sharing options...
0 Robin 67 Odesláno: 23. Prosinec, 2014 Share Odesláno: 23. Prosinec, 2014 Napis co je v pawne nadefinovane ako "DIALOG_ADMIN" a kde vsade DIALOG_ADMIN pouzivas Link to comment Share on other sites More sharing options...
0 Hlavní moderátor vEnd 279 Odesláno: 23. Prosinec, 2014 Hlavní moderátor Share Odesláno: 23. Prosinec, 2014 mohl bys prosím udělat to, o co jsem tě už dřív žádal, tj. ukázat nám ID tvých dialogů? Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 23. Prosinec, 2014 Author Share Odesláno: 23. Prosinec, 2014 Mám tam jen "new DIALOG_ADMIN;" a pak to "new DIALOG_A1" a to až do 5 Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 23. Prosinec, 2014 Globální moderátor Share Odesláno: 23. Prosinec, 2014 řekl bych že to je trochu blbost má tam být #define DIALOG_ADMIN hodnota/číslo stejně jako u ostatních Link to comment Share on other sites More sharing options...
0 Noob14_ 7 Odesláno: 24. Prosinec, 2014 Share Odesláno: 24. Prosinec, 2014 Dle mého názoru,resp. podle určité funkce mně napadá ještě jedna mosžnost, listitem už ti to tam psali tak proč to neuděláš, potom se mohlo stát ještě to, že ti opravdu shodují DIALOG ID. a to je problém. Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 24. Prosinec, 2014 Share Odesláno: 24. Prosinec, 2014 #define DIALOG_ADMIN 1000 #define DIALOG_A1 1001 atd.. Link to comment Share on other sites More sharing options...
Dotaz
Stellet 7
Ahoj udělal jsem si Admin Příkazy přes dialog DIALOG_STYLE_LIST více níže:
Tady je příkaz:
Tady je OnDialogResponse:
Potom dám příkaz ve hře a zobrazí se:
Dám třeba Admin Level 1 a OK a nic se neděje vypne se dialog a nic
Děkuji předem
Link to comment
Share on other sites
12 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now