PDA

View Full Version : Centering dialog lines


Melktert
15/04/2017, 03:24 PM
So basically "\\c" centers the line in the dialog, for some reason, the last few lines don't center.. from "Level 4 Commands"

ShowPlayerDialog(playerid, DIALOG_AHELP, DIALOG_STYLE_MSGBOX, "\\cAdmin Help", "\\c{FF0000}NOTE: {FFFFFF} You do not have access to higher level commands if you are a lower level.\n\n\\c{FFFF00}Level 1 Commands{FFFFFF}\n\\c/kick, /goto, /achat, /aduty, /ahelp\n\n\\c{FFFF00}Level 2 Commands{FFFFFF}\n\\cN/A\n\n\\c{FFFF00}Level 3 Commands{FFFFFF}\n\\c/ban, /givemoney\n\n\\c{FFFF00}Level 4 Commands{FFFFFF}\n\\c/setscore\n\n\\c{FFFF00}Level 5 Commands{FFFFFF}\n\\c/setadmin", "Close", "");

khRamin78
15/04/2017, 05:44 PM
be cuse using this \n\ well act like you push enter !
i mean
like
"Something\nsomthing"
"SomeThing\n\
Something"
so using \n\\c will be have some problems

RIDE2DAY
15/04/2017, 05:52 PM
It depends on how you write the new line characters actually. Doing this it should work:

ShowPlayerDialog(x, 999, DIALOG_STYLE_MSGBOX, "\\cAdmin Help",
"\\c{FF0000}NOTE: {FFFFFF} You do not have access to higher level commands if you are a lower level.\n \n\
\\c{FFFF00}Level 1 Commands{FFFFFF}\n\
\\c/kick, /goto, /achat, /aduty, /ahelp\n \n\
\\c{FFFF00}Level 2 Commands{FFFFFF}\n\
\\cN/A\n \n\
\\c{FFFF00}Level 3 Commands{FFFFFF}\n\
\\c/ban, /givemoney\n \n\
\\c{FFFF00}Level 4 Commands{FFFFFF}\n\
\\c/setscore\n \n\
\\c{FFFF00}Level 5 Commands{FFFFFF}\n\
\\c/setadmin",
"Close", ""
);

Notice that I let a space between double \n\n. I don't know if this is a bug or if that's how it works, ask Ivan_Ino in his thread (http://forum.sa-mp.com/showthread.php?t=625090).

Melktert
15/04/2017, 09:08 PM
It depends on how you write the new line characters actually. Doing this it should work:

ShowPlayerDialog(x, 999, DIALOG_STYLE_MSGBOX, "\\cAdmin Help",
"\\c{FF0000}NOTE: {FFFFFF} You do not have access to higher level commands if you are a lower level.\n \n\
\\c{FFFF00}Level 1 Commands{FFFFFF}\n\
\\c/kick, /goto, /achat, /aduty, /ahelp\n \n\
\\c{FFFF00}Level 2 Commands{FFFFFF}\n\
\\cN/A\n \n\
\\c{FFFF00}Level 3 Commands{FFFFFF}\n\
\\c/ban, /givemoney\n \n\
\\c{FFFF00}Level 4 Commands{FFFFFF}\n\
\\c/setscore\n \n\
\\c{FFFF00}Level 5 Commands{FFFFFF}\n\
\\c/setadmin",
"Close", ""
);

Notice that I let a space between double \n\n. I don't know if this is a bug or if that's how it works, ask Ivan_Ino in his thread (http://forum.sa-mp.com/showthread.php?t=625090).


Thanks mate, it worked well.