[SOLVED] Loading vehicles from a file
#1

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?
Reply
#2

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
Reply
#3

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 ;
Reply
#4

Take a look on the GrandLarc.pwn there you see how there has been loaded vehicles from a file.
Reply
#5

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...
Reply
#6

I've taken a look, & modified the Grand Larceny include. It's now working.
Thanks guys.
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)