SA-MP Forums Archive
Centering dialog lines - 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)
+--- Thread: Centering dialog lines (/showthread.php?tid=632509)



Centering dialog lines - Melktert - 15.04.2017

So basically "\\c" centers the line in the dialog, for some reason, the last few lines don't center.. from "Level 4 Commands"

PHP Code:
ShowPlayerDialog(playeridDIALOG_AHELPDIALOG_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"""); 



Re: Centering dialog lines - khRamin78 - 15.04.2017

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


Re: Centering dialog lines - RIDE2DAY - 15.04.2017

It depends on how you write the new line characters actually. Doing this it should work:
PHP Code:
ShowPlayerDialog(x999DIALOG_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.


Re: Centering dialog lines - Melktert - 15.04.2017

Quote:
Originally Posted by RIDE2DAY
View Post
It depends on how you write the new line characters actually. Doing this it should work:
PHP Code:
ShowPlayerDialog(x999DIALOG_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.
Thanks mate, it worked well.