Capsinurass Posted January 23, 2008 Share Posted January 23, 2008 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
danifer Posted January 23, 2008 Share Posted January 23, 2008 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
Capsinurass Posted January 23, 2008 Author Share Posted January 23, 2008 ohhhh Thanks danifer the first one worked but the other 2 didnt ill release this soon because i know that alot of people have wanted this and ill post a link Link to comment
eAi Posted January 25, 2008 Share Posted January 25, 2008 I know this is a bit late, but we don't have built in support for XML... Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now