vehicle saving coordinates
#1

Hello, I am creating a vehicle saving system, however I can't find a good way to save vehicle pos.

The way I currently use is

Vehicle1PosX =
Vehicle1PosY =
Vehicle1PosZ =
Vehicle2PosX =
Vehicle2PosY =
Vehicle2PosZ =
Vehicle3PosX =
Vehicle3PosY =
Vehicle3PosZ =
Vehicle4PosX =
Vehicle4PosY =
Vehicle4PosZ =
Vehicle5PosX =
Vehicle5PosY =
Vehicle5PosZ =
etc, but id like it to be on one line so it'd be like
Vehicle1Pos = 2305.32 -1543.63 13.37
Vehicle2Pos = 1241.42 -1211.42 16.44
etc..

Any tips on how I can do that?

I am using Y_INI by the way.
Reply
#2

you can do it like this:
pawn Code:
new vehiclepos[3][64];
format(vehiclepos[0],64,"%fx%fx%fx",posx,posy,posz);
format(vehiclepos[1],64,"%fx%fx%fx",posx,posy,posz);
format(vehiclepos[2],64,"%fx%fx%fx",posx,posy,posz);
then you save those three strings.

Then at load,
you just use split with the character 'x' , and you use floatstr(); with the 3 results from the split for each vehicle.+
Reply
#3

How do I split it? I'd like to use it in
INI_WriteString
and
INI_String
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)