Jump to content

Saving Variables to file


Blood Tiger

Recommended Posts

Blood Tiger

I have problem with this, look on this code

 

:LOAD_FILE

if
0@ = file.Open("CLEO\FILE.dat", 25202)
jf @LOAD_FILE
file.write(0@,400,$CHECKPONT_X[$INDEX])
file.write(0@,400,$CHECKPONT_Y[$INDEX])
file.write(0@,400,$CHECKPONT_Z[$INDEX])
file.Close(0@)
0A93: end_custom_thread

The are i open the file "FILE.DAT" and save the float variables to file and close it, 400 - the size of variable, i have question, which size i do write here?Please, tell me, sometimes when i read this variables, values are messed up!

Edited by Muxan
Link to comment
Share on other sites

Blood Tiger

Finally, i saved all variables normally.But all the same talk me what size i would be write?

Link to comment
Share on other sites

0A9D and 0A9E always start from file head, so file.dat only stored $CHECKPONT_Z[0-99] eventually. You need three files to store three arrays.

Link to comment
Share on other sites

A single SCM variable has 4 bytes.
Also check out this.

0A9D and 0A9E always start from file head, so file.dat only stored $CHECKPONT_Z[0-99] eventually. You need three files to store three arrays.

Nope, it continues from the last operation.

Edited by LINK/2012
Link to comment
Share on other sites

Blood Tiger

A single SCM variable has 4 bytes.

Also check out this.

I know it now, i saved and red all variables normally

Edited by Muxan
Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.