[SOLVED] Loading vehicles from a file - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Loading vehicles from a file (
/showthread.php?tid=108372)
[SOLVED] Loading vehicles from a file -
Abernethy - 13.11.2009
Hey guys, I know this seems kind of newbie but how would I go about loading a file full of vehicle co-ordinates and/or map icons into my script?
Re: Loading vehicles from a file -
dice7 - 13.11.2009
You read from a file with fread and then use something like sscanf to extract the data correctly from the line
https://sampwiki.blast.hk/wiki/Scripting...ions_Old#fread
https://sampwiki.blast.hk/wiki/File_Functions
https://sampwiki.blast.hk/wiki/Fast_Commands#sscanf
Re: Loading vehicles from a file -
JonyAvati - 13.11.2009
Quote:
Originally Posted by Abernethy❶❸❸❼
Hey guys, I know this seems kind of newbie but how would I go about loading a file full of vehicle co-ordinates and/or map icons into my script?
|
Here you got an example:
LoadStaticVehiclesFromFile("vehicles/vehicles.txt");
Example of syntax of coordinates inside the file:
Код:
485,-1644.8495,-593.8191,13.8045,244.2475,1,74 ;
Re: Loading vehicles from a file -
Benne - 13.11.2009
Take a look on the GrandLarc.pwn there you see how there has been loaded vehicles from a file.
Re: Loading vehicles from a file -
JonyAvati - 13.11.2009
Quote:
Originally Posted by Benne
Take a look on the GrandLarc.pwn there you see how there has been loaded vehicles from a file.
|
Yes, with LoadStaticVehiclesFromFile function...
Re: Loading vehicles from a file -
Abernethy - 13.11.2009
I've taken a look, & modified the Grand Larceny include. It's now working.
Thanks guys.
Re: Loading vehicles from a file -
JonyAvati - 13.11.2009
Quote:
Originally Posted by Abernethy❶❸❸❼
I've taken a look, & modified the Grand Larceny include. It's now working.
Thanks guys.
|
No problem
.
Good luck