SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/04/2017, 03:24 PM   #1
Melktert
Big Clucker
 
Melktert's Avatar
 
Join Date: Oct 2015
Location: ProgramData
Posts: 123
Reputation: 8
Default Centering dialog lines

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"""); 
Melktert is offline   Reply With Quote
Old 15/04/2017, 05:44 PM   #2
khRamin78
Huge Clucker
 
khRamin78's Avatar
 
Join Date: Jun 2015
Location: IRI/LA
Posts: 321
Reputation: 30
Default Re: Centering dialog lines

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
khRamin78 is offline   Reply With Quote
Old 15/04/2017, 05:52 PM   #3
RIDE2DAY
Huge Clucker
 
RIDE2DAY's Avatar
 
Join Date: Jul 2015
Location: Modena, Italy
Posts: 213
Reputation: 381
Default Re: Centering dialog lines

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.
RIDE2DAY is offline   Reply With Quote
Old 15/04/2017, 09:08 PM   #4
Melktert
Big Clucker
 
Melktert's Avatar
 
Join Date: Oct 2015
Location: ProgramData
Posts: 123
Reputation: 8
Default Re: Centering dialog lines

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.
Melktert is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dialog Multi Lines Rodri99 Scripting Help 1 27/12/2015 10:05 PM
centering dialog text jackx3rx Server Support 1 30/07/2014 10:31 PM
Dialog lines. Anak Scripting Help 3 15/06/2013 04:08 PM
Surely there is a shorter way of doing this dam dialog... 172,380 Lines... Deal-or-die Scripting Help 5 01/05/2012 03:58 PM
Centering Menu will_92 Help Archive 0 28/01/2010 01:46 AM


All times are GMT. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.