SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/10/2014, 07:46 PM   #1
[XPG]MarlonCS
Huge Clucker
 
[XPG]MarlonCS's Avatar
 
Join Date: Jun 2012
Location: Magé, RJ
Posts: 223
Reputation: 30
Unhappy DOF2 and NewLine - Help me Please

Hello everyone
I have a problem with newline and DOF2.
Exemple:
when I pull the sentence from the file:
"Hello world\nWelcome to my server"
It appears like this:
"Hello world\nWelcome to my server" oO

\n not work.

Code:
Code:
DOF2_GetString(file, "phrase");
In the file:
Code:
phrase = Hello world\nWelcome to my server

Last edited by [XPG]MarlonCS; 26/10/2014 at 07:48 PM. Reason: Title
[XPG]MarlonCS is offline   Reply With Quote
Old 26/10/2014, 07:57 PM   #2
mkmk
Big Clucker
 
Join Date: Mar 2014
Posts: 170
Reputation: 3
Default Re: DOF2 and NewLine - Help me Please

For the second one, maybe you're looking for something along the lines of this?

pawn Code:
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, -1, "Hello world\nWelcome to my server!");
}

rep if I helped please - reason I'm asking is because I need 15 reps to ad my server.
mkmk is offline   Reply With Quote
Old 26/10/2014, 08:13 PM   #3
[XPG]MarlonCS
Huge Clucker
 
[XPG]MarlonCS's Avatar
 
Join Date: Jun 2012
Location: Magé, RJ
Posts: 223
Reputation: 30
Default Re: DOF2 and NewLine - Help me Please

Quote:
Originally Posted by mkmk View Post
For the second one, maybe you're looking for something along the lines of this?

pawn Code:
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, -1, "Hello world\nWelcome to my server!");
}

rep if I helped please - reason I'm asking is because I need 15 reps to ad my server.
But friend ...
I want to pull this message from the file, cause my Gamemode have 3 languages.

Exemple: Message to all players about any player entered in the server:

Code:
//OnPlayerConnect
format(string, sizeof(string), DOF2_GetString(LANG1, "WELCOME_ENTERED_ON_SERVER"), pnome(playerid), playerid, hora, minu, seg);
In the file en-us.lang
Code:
WELCOME_ENTERED_ON_SERVER = [SERVER] {00FF00}%s{C0C0C0} [{00FF00}%d{C0C0C0}] entered the server {00FF00}[%02d:%02d:%02d]
In the file pt-br.lang
Code:
WELCOME_ENTERED_ON_SERVER = [SERVER] {00FF00}%s{C0C0C0} [{00FF00}%d{C0C0C0}] entrou no servidor {00FF00}[%02d:%02d:%02d]
[XPG]MarlonCS is offline   Reply With Quote
Old 26/10/2014, 08:15 PM   #4
[XPG]MarlonCS
Huge Clucker
 
[XPG]MarlonCS's Avatar
 
Join Date: Jun 2012
Location: Magé, RJ
Posts: 223
Reputation: 30
Default Re: DOF2 and NewLine - Help me Please

Quote:
Originally Posted by ****** View Post
"\n" is actually converted by the PAWN compiler in to a true new line (ASCII 10 (or 0x10, I forget which)). Thus typing that in game or in files will get you exactly what you typed - a backslash then an "n", because that text hasn't gone through the compiler. That sequence isn't magical, if you want a newline you will need to scan for and convert them yourselves.
How?
Can you help me?
[XPG]MarlonCS 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
error: undefine symbol "j" and expected token ";" but found "]" JEkvall95 Scripting Help 9 27/07/2013 10:09 AM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 12:08 PM
Admin script requires "ReturnUser", "strtok" and "IsNumeric" Rubennnnn Help Archive 1 02/12/2009 06:08 PM
"Bots", "AI", "NPCs"... Computer-controlled pedestrians and traffic! ssflsnoob General 2 23/11/2008 06:06 PM


All times are GMT. The time now is 02:48 AM.


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