Too long line..
#1

Hi. My line is too long:
Code:
Dialog_ShowCallback(pid, using inline dialog5, DIALOG_STYLE_LIST, "Valdymas",f("Leidimas vairuoti infernus(%s)\nLeidimas vairuoti elegy(%s)\nLeidimas pilotuoti Hunter(%s)\nLeidimas pilotuoti Hydra(%s)\nLeidimas vairuoti nrg-500(sunkveћimis)(%s)\nLeidimas vairuoti turismo(%s)\nLeidimas vairuoti super-gt(valtis)(%s)\nLeidimas pilotuoti sanchez(%s)\nLeidimas vairuoti bmx(%s)\nLeidimas vairuoti test(%s)", (Rangs[prang][tr1]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr2]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr3]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr4]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr5]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr6]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr7]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr8]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr9]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr10]) ? ("Yra") : ("Nėra")), "Toliau", "Iљeiti");
I know, that I need use strcmp, but dont know how. Maybe somebody can show me, how this line must be? Thanks a lot.
Reply
#2

Quote:
Originally Posted by ,TomY'
View Post
Hi. My line is too long:
Code:
Dialog_ShowCallback(pid, using inline dialog5, DIALOG_STYLE_LIST, "Valdymas",f("Leidimas vairuoti infernus(%s)\nLeidimas vairuoti elegy(%s)\nLeidimas pilotuoti Hunter(%s)\nLeidimas pilotuoti Hydra(%s)\nLeidimas vairuoti nrg-500(sunkveћimis)(%s)\nLeidimas vairuoti turismo(%s)\nLeidimas vairuoti super-gt(valtis)(%s)\nLeidimas pilotuoti sanchez(%s)\nLeidimas vairuoti bmx(%s)\nLeidimas vairuoti test(%s)", (Rangs[prang][tr1]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr2]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr3]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr4]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr5]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr6]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr7]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr8]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr9]) ? ("Yra") : ("Nėra"),(Rangs[prang][tr10]) ? ("Yra") : ("Nėra")), "Toliau", "Iљeiti");
I know, that I need use strcmp, but dont know how. Maybe somebody can show me, how this line must be? Thanks a lot.
It must be something like this:
PHP Code:
new string1[128],string2[128],string3[128],stringt[1024];
format(string1sizeof(string1), "blah blah blah");
format(string2sizeof(string2), "blah2 blah2 blah2");
format(string3sizeof(string3), "blah3 blah3 blah3");
format(stringtsizeof(stringt), "%s\n%s\n%s"string1string2string3);
ShowPlayerDialog(playeridDIALOG_X,DIALOG_STYLE_LIST"Title"stringt"Done Button""Cancel Button"); 
Reply
#3

Quote:
Originally Posted by Alpay0098
View Post
It must be something like this:
PHP Code:
new string1[128],string2[128],string3[128],stringt[1024];
format(string1sizeof(string1), "blah blah blah");
format(string2sizeof(string2), "blah2 blah2 blah2");
format(string3sizeof(string3), "blah3 blah3 blah3");
format(stringtsizeof(stringt), "%s\n%s\n%s"string1string2string3);
ShowPlayerDialog(playeridDIALOG_X,DIALOG_STYLE_LIST"Title"stringt"Done Button""Cancel Button"); 
Why should he using alot of strings?

take this as example

PHP Code:
new string[1024];
format(stringsizeof(string), "%sLeidimas vairuoti infernus(%s)\n",string, (Rangs[prang][tr1]) ? ("Yra") : ("Nera"));
format(stringsizeof(string), "%sLeidimas vairuoti elegy(%s)\n",string, (Rangs[prang][tr2]) ? ("Yra") : ("Nera"));
//Here can add more string messages
ShowPlayerDialog(playeridDDIALOG_XDIALOG_STYLE_LIST"Title"string"BUTTON1""BUTTON2"); 
Reply
#4

Or just use this:
Code:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Buy Weapon",
"Item 0\n\
Item 1\n\
Item 2\n\
"Select", "Cancel");
Reply
#5

@Napst34:
No, it won't work, because the compile put this into one line when it will compile the script.
You have to work with format or strcat.
Reply
#6

Use strcat.
Reply
#7

Quote:
Originally Posted by Meller
View Post
Use strcat.
of course this feature should be used. not format
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)