SA-MP Forums Archive
MSG dialog box! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MSG dialog box! (/showthread.php?tid=109327)



MSG dialog box! - addysnow1 - 19.11.2009

Hello, I made a dialog box, but how can i make a bigger box with more text? i got this now:

ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX," Server Rules:","Don't use Hacks/Cheats\nDon't Spamming/Insulting/Discriminate\nDon't abuse bugs or commands!\nDon't dm outside the dmzone!\nDon't ask for admin levels\nBreaking Rules = Warn > Ban\n","Agree","Disagree");

When i add more things, I get a error that the line is to long...
??


Re: MSG dialog box! - yom - 19.11.2009

One solution is to cut the string is smaller parts and join those parts together with format:

pawn Код:
new s1[] = "first part of the looooooooooooooong string";
new s2[] = "second part of the loooooooooooong string";
   
new s[1024];
format(s, sizeof s, "%s%s", s1, s2);

ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Server Rules:",s,"Agree","Disagree");
Another solution is to put the long string in a text file and fread it. You choose.


Re: MSG dialog box! - addysnow1 - 19.11.2009

lol wtf? can you give a example of it? I tried someshit but didn't work...
Thats not clear for me :P


Re: MSG dialog box! - Joe Staff - 19.11.2009

pawn Код:
ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Server Rules:","Don't use Hacks/Cheats\nDon't Spamming/Insulting/Discriminate\nDon't abuse bugs or commands!\nDon't dm outside the dmzone!\nDon't ask for admin levels\nBreaking Rules = Warn > Ban\n","Agree","Disagree");
is the same as
pawn Код:
ShowPlayerDialog(playerid,
10,DIALOG_STYLE_MSGBOX,"Server Rules:",
"Don't use Hacks/Cheats\nDon't Spamming/Insulting/Discriminate\nDon't abuse bugs or commands!\nDon't dm outside the dmzone!\nDon't ask for admin levels\nBreaking Rules = Warn > Ban\n",
"Agree","Disagree");



Re: MSG dialog box! - addysnow1 - 19.11.2009

Lol yeah this not what i mean I want to make a carlist, so I need something like this:
Код:
	if (strcmp(cmdtext, "/carlist", true) == 0)
	{
ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"Server Rules:",
"A list with vehicle names/ids usage /car to get them!\n",
"sultan 560\nInfernus 411\nTurismo 451 \nSuperGT 506\nFlash  565\n",
"Hotknife 434\n",
"Next","Close");
return 1;
}
ofc this doesnt works, how i can do it then?


Re: MSG dialog box! - Correlli - 19.11.2009

You got it wrong.

pawn Код:
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Server Rules:", "Don't use Hacks/Cheats\nDon't Spamming/Insulting/Discriminate\
\nDon't abuse bugs or commands!\nDon't dm outside the dmzone!\
\nDon't ask for admin levels\nBreaking Rules = Warn > Ban\n"
, "Agree", "Disagree");



Re: MSG dialog box! - addysnow1 - 19.11.2009

Ok thanks!


Re: MSG dialog box! - addysnow1 - 19.11.2009

Man I'm sorry but it doesnt work:
Код:
 		ShowPlayerDialog(playerid, 400, DIALOG_STYLE_MSGBOX, "Vehicle Commmads,", "/nos /nitro    - Get Nitro on your car!\
		\n/car [name]    - Spawn a vehicle.\
		\n/Tune       - Tune your vehicle. \
		\n/flip       - Flip your vehicle. \
		\n/repair      - Repairs the visual damage on a vehicle \
		\n/sultan      - Spawn a tuned Sultan\
		\n/nrg       - Create a personaly Nrg-500 \
		\n/lock /unlock   - Unlock or Lock your Vehicle \
		\n/parachute    - Get a parachute \
		\n/carlist     - Get a list with vehicle names and IDs\n", "Ok");



Re: MSG dialog box! - yom - 19.11.2009

Re-read my post please, i've edited it since. These are the only 2 solutions, as far as i know.


Re: MSG dialog box! - Kyosaur - 19.11.2009

Quote:
Originally Posted by 0rb
One solution is to cut the string is smaller parts and join those parts together with format:

pawn Код:
new s1[] = "first part of the looooooooooooooong string";
new s2[] = "second part of the loooooooooooong string";
   
new s[1024];
format(s, sizeof s, "%s%s", s1, s2);

ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Server Rules:",s,"Agree","Disagree");
Another solution is to put the long string in a text file and fread it. You choose.
hmm why bother with format, just use strcat .