1
Script Discussion / Re: Can we use XML for 0.4?
« on: October 13, 2014, 05:56:16 pm »
I dont know about XML but you can use .ini file if you want to save location
save by
They are from Warcheif.
If you want a timer that save the pos automaticly than you also have to make a integer outside the timer and add 1 to it at the end of timer.
For reading u will use a for loop and u will ++ the number and get the positon.
also dont forget to split it in x,y,z
by
save by
Code: [Select]
WriteIniString( "yourfile.ini", "Position", "Pos", format( "%.4f %.4f %.4f", player.Pos.x, player.Pos.y, player.Pos.z ) );
and get byCode: [Select]
local coord = ReadIniString( "yourfile.ini", "Position", "Pos" );
They are from Warcheif.
If you want a timer that save the pos automaticly than you also have to make a integer outside the timer and add 1 to it at the end of timer.
Code: [Select]
local i=0;
function mytimer(player)
{
WriteIniString( "yourfile.ini", "Position" + i, "Pos" + i , format( "%.4f %.4f %.4f", player.Pos.x, player.Pos.y, player.Pos.z ) );
i++
}
dont forget to add i in the Position and Pos.we add it so the name dont match with any previous save as it will replace the previous other than making a new.For reading u will use a for loop and u will ++ the number and get the positon.
also dont forget to split it in x,y,z
by
Code: [Select]
local splitpos = split( coord, " " );
local pos = Vector(split[0].tofloat(), split[1].tofloat(), split[2].tofloat());