PanRožokRohliik 1 Odesláno: 26. Duben, 2017 Share Odesláno: 26. Duben, 2017 (upraveno) Vyřešeno, LOCK Edited 30. Duben, 2017 by PanRožokRohliik Link to comment Share on other sites More sharing options...
0 Globální moderátor HighPrint 177 Odesláno: 26. Duben, 2017 Globální moderátor Share Odesláno: 26. Duben, 2017 Musíš si někam externě uložit první string Link to comment Share on other sites More sharing options...
0 OceT 60 Odesláno: 26. Duben, 2017 Share Odesláno: 26. Duben, 2017 Někam nahoru dej proměnnou: new InputtextSave[50]; Do OnDialogResponse u dialogu 201 dej: format(InputtextSave,sizeof(InputtextSave),inputtext); A pak to použij takto: format(str,128,"Prostě tady bude text - č1 %s č2. %s", InputtextSave, inputtext); Link to comment Share on other sites More sharing options...
0 PanRožokRohliik 1 Odesláno: 26. Duben, 2017 Author Share Odesláno: 26. Duben, 2017 Původně jsem to chtěl zkusit ještě takto, ale to je asi blbost ? ublic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == 200) { if(response == 1) { if(listitem == 0) { new nazev = strval(inputtext); SetPVarInt(playerid, "Nazev", nazev); ShowPlayerDialog(playerid,201,DIALOG_STYLE_INPUT,"Název Eventu","Text č.1","Pokračovat",""); } } } if (dialogid == 201) { if(response == 1) { ShowPlayerDialog(playerid,202,DIALOG_STYLE_INPUT,"Název Eventu","Text č.2","Pokračovat",""); } } if (dialogid == 202) { if(response == 1) { if(!response) return SendClientMessage(playerid,0xFFFFFFFF,"Nezadal si text"); new nazev = SetPVarInt(playerid, "Nazev", nazev); new str[128], castka = strlen(inputtext); format(str,128,"Prostě tady bude text - První %s Druhý %s", nazev, castka); SendClientMessage(playerid,0xFFFFFFFF,str); } } return 1; } Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 26. Duben, 2017 Share Odesláno: 26. Duben, 2017 (upraveno) Původně jsem to chtěl zkusit ještě takto, ale to je asi blbost ? ublic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == 200) { if(response == 1) { if(listitem == 0) { new nazev = strval(inputtext); SetPVarInt(playerid, "Nazev", nazev); ShowPlayerDialog(playerid,201,DIALOG_STYLE_INPUT,"Název Eventu","Text č.1","Pokračovat",""); } } } if (dialogid == 201) { if(response == 1) { ShowPlayerDialog(playerid,202,DIALOG_STYLE_INPUT,"Název Eventu","Text č.2","Pokračovat",""); } } if (dialogid == 202) { if(response == 1) { if(!response) return SendClientMessage(playerid,0xFFFFFFFF,"Nezadal si text"); new nazev = SetPVarInt(playerid, "Nazev", nazev); new str[128], castka = strlen(inputtext); format(str,128,"Prostě tady bude text - První %s Druhý %s", nazev, castka); SendClientMessage(playerid,0xFFFFFFFF,str); } } return 1; } Není to blbost, akorát jsi použil špatnou funkci. http://wiki.sa-mp.com/wiki/SetPVarString http://wiki.sa-mp.com/wiki/GetPVarString Pak když stim už nebudeš muset pracovat tak http://wiki.sa-mp.com/wiki/DeletePVar Edited 26. Duben, 2017 by Steam wallet Link to comment Share on other sites More sharing options...
0 PanRožokRohliik 1 Odesláno: 27. Duben, 2017 Author Share Odesláno: 27. Duben, 2017 Zbytečně nechci zakládat nové téma, tak se chci zeptat, v čem je tady problém...Celkem si nevím rady (podmínky a já no ) new id; if (neco1[id] == 0 || neco[id] == 0) return SendClientMessage(playerid, -1, "Tady patří text, že"); { SetPlayerPos(playerid, poziceX, poziceY, poziceZ); } else if(ks[id] == 1); { SetPlayerPos(playerid, -183.1087,1884.3951,115.7031); } } Errory: (Řádek 76) - else if(ks[id] == 1); error 029: invalid expression, assumed zero warning 215: expression has no effect error 001: expected token: ";", but found "if" error 036: empty statement fatal error 107: too many error messages on one line Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 27. Duben, 2017 Share Odesláno: 27. Duben, 2017 else if(ks[id] == 1); co tam vidíš za znamenko Link to comment Share on other sites More sharing options...
0 PanRožokRohliik 1 Odesláno: 27. Duben, 2017 Author Share Odesláno: 27. Duben, 2017 (upraveno) ENd Edited 27. Duben, 2017 by PanRožokRohliik Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 27. Duben, 2017 Share Odesláno: 27. Duben, 2017 (upraveno) Tak ještě jednou... -.- else if(ks[id] == 1); Edited 27. Duben, 2017 by Steam wallet Link to comment Share on other sites More sharing options...
0 PanRožokRohliik 1 Odesláno: 27. Duben, 2017 Author Share Odesláno: 27. Duben, 2017 Jasné, jasné.. (y) Ale i bez toho mi to nešlo, zkusil jsem to vyřešit jínak, tak jdu zkusit jak to bude fungovat, třeba to ani fungovat, nebude (y) Jínak děkuji za včerejšek Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 27. Duben, 2017 Share Odesláno: 27. Duben, 2017 else if se váže na if, který ti tam chybí, a nemůže tam být takto samostatně https://pawno.cz/topic/53495-6-podmínky-a-větvení/ 1 Link to comment Share on other sites More sharing options...
0 Quiter 99 Odesláno: 27. Duben, 2017 Share Odesláno: 27. Duben, 2017 Zbytečně nechci zakládat nové téma, tak se chci zeptat, v čem je tady problém...Celkem si nevím rady (podmínky a já no ) new id; if (neco1[id] == 0 || neco[id] == 0) return SendClientMessage(playerid, -1, "Tady patří text, že"); { SetPlayerPos(playerid, poziceX, poziceY, poziceZ); } else if(ks[id] == 1); { SetPlayerPos(playerid, -183.1087,1884.3951,115.7031); } } Errory: (Řádek 76) - else if(ks[id] == 1); error 029: invalid expression, assumed zero warning 215: expression has no effect error 001: expected token: ";", but found "if" error 036: empty statement fatal error 107: too many error messages on one line Nemôže použiť IF a hneď naň return ak chceš použiť {} buď: if (....) return haha1; else (...) { haha2; }else haha3; čo by som nedoporučoval nakoľko ak sa splní prvá podmienka, skončí celý public lepšie je : if(...) { haha1; } else if(...) { haha2; } else { haha3; } else if se váže na if, který ti tam chybí, a nemůže tam být takto samostatně https://pawno.cz/topic/53495-6-podmínky-a-větvení/ Nechýba, akurát ho má zle napísané... Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 27. Duben, 2017 Share Odesláno: 27. Duben, 2017 (upraveno) Chybi mu tam if k else if. Muze mit if(...) return; { ... }to je korektni. Problem nastava az v tom else if, kdy blok nad nim se nevztahuje k zadnemu if - chybi mu tam if. Edited 27. Duben, 2017 by Lukasz 2 Link to comment Share on other sites More sharing options...
0 Quiter 99 Odesláno: 27. Duben, 2017 Share Odesláno: 27. Duben, 2017 Chybi mu tam if k else if. Muze mit if(...) return; { ... }to je korektni. Problem nastava az v tom else if, kdy blok nad nim se nevztahuje k zadnemu if - chybi mu tam if. ano, v tom máš síce pravdu, systém ti chybu nevyhodí ale zápis je nezmyseľný {} sú v tomto prípade úplne zbytočné a mätúce Link to comment Share on other sites More sharing options...
Dotaz
PanRožokRohliik 1
Vyřešeno, LOCK
Edited by PanRožokRohliikLink to comment
Share on other sites
13 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