Spawn car via an .ini file.
#2

In my script I spawn all the vehicles form a txt, it looks like this:
pawn Код:
new File:vehicles=fopen("vehicles.txt", io_read);
new idx;
while(fread(vehicles, string)){
    idx = 0
    modelid = strval(strtok(string,idx));
    X = floatstr(strtok(string,idx));
    Y = floatstr(strtok(string,idx));
    Z = floatstr(strtok(string,idx));
    rot = floatstr(strtok(string,idx));
    c1 = strval(strtok(string,idx));
    c2 = strval(strtok(string,idx));
    AddStaticVehicle(modelid,X,Y,Z,rot,c1,c2);
}
vehicles.txt:
Код:
(...)411 2034.5016 1912.5874 11.9048 0.2909 123 1
411 2172.1682 1988.8643 10.5474 89.9151 116 1(...)
Hope this could help you.
Reply


Messages In This Thread
Spawn car via an .ini file. - by Biesmen - 06.11.2010, 13:35
Re: Spawn car via an .ini file. - by [HUN]Jaki - 06.11.2010, 13:59
Re: Spawn car via an .ini file. - by Hiddos - 06.11.2010, 14:06
Re: Spawn car via an .ini file. - by Biesmen - 06.11.2010, 14:19

Forum Jump:


Users browsing this thread: 2 Guest(s)