How to save and load from file
#10

Open the file with oi_write or io_append mode (read the wiki for differences), write with fwrite, then close with fclose. To read, you'll need something like sscanf so you can dismantle the string to the integers/floats you want. Also, use something like '|' or ',' between integers/floats when you write so you can extract the data then with the help of that delimiter

https://sampwiki.blast.hk/wiki/Fopen
https://sampwiki.blast.hk/wiki/Scripting...ions_Old#fread
https://sampwiki.blast.hk/wiki/Scripting...ons_Old#fwrite
https://sampwiki.blast.hk/wiki/Scripting...ons_Old#fclose

https://sampwiki.blast.hk/wiki/Fast_Commands#sscanf
https://sampwiki.blast.hk/wiki/Sscanf_code
Reply


Messages In This Thread
How to save and load from file - by CAR - 21.10.2009, 10:19
Re: How to save and load from file - by pagie1111 - 21.10.2009, 10:24
Re: How to save and load from file - by CAR - 21.10.2009, 10:28
Re: How to save and load from file - by saiberfun - 21.10.2009, 11:23
Re: How to save and load from file - by CAR - 21.10.2009, 12:42
Re: How to save and load from file - by saiberfun - 21.10.2009, 12:45
Re: How to save and load from file - by CAR - 21.10.2009, 12:58
Re: How to save and load from file - by CAR - 21.10.2009, 13:16
Re: How to save and load from file - by CAR - 21.10.2009, 13:29
Re: How to save and load from file - by dice7 - 21.10.2009, 13:35

Forum Jump:


Users browsing this thread: 1 Guest(s)