Jump to content

New Line, its doesnt work, but it does!


Capsinurass

Recommended Posts

Ok well i was trying to make a script that gets your position and then saves it into a .txt file.( a bit like /save in SA MP) This was to be in the format so that you could copy and paste strate into a .map file and it would spawn a car. I can get it to all work fine but there is only one problem, when i use \n to make a new line. In Notepad there is no new line but in Notepad++ there is... so what is going on. here is some of the code....

    if mapFile then 
     
        while not fileIsEOF ( mapFile ) do 
            fileRead ( mapFile, 500 )    
        end 
         
        fileWrite ( mapFile, "<vehicle id=\"" .. vehName .. "\" model=\"" .. vehID .. "\" posX=\"" .. x .. "\" posY=\"" .. y .. "\" posZ=\"" .. z .. "\" rotX=\"" .. rx .. "\" rotY=\"" .. ry .. "\" rotZ=\"" .. rz .. "\" color=\"" .. color1 .. " " .. color2 .. " " .. color3 .. " " .. color4 .. "\" />\n" ) 
        outputChatBox ( "Position Saved!") 
        fileClose ( mapFile ) 
         
    else 
        outputConsole ( "Unable Read/Write File.") 
         
    end 

and for those people that want to get there hands on this i will release this if/when i can get this bug fixed. This was meant to be a bit of a template for people to make a gamemode

Link to comment

sounds like notepad++ can intererpt single linebreaks (lf) and windows linebreaks (crlf) but notepad can only do windows.

what Ive read \n should translate to the systems respective linebreak sequence..but it looks like its not.

try this instead

\r\n 

or

\n\r 

or perhaps

\x0D\x0A 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...