SA-MP Forums Archive
Vehicle Spawns - 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: Vehicle Spawns (/showthread.php?tid=134694)



Vehicle Spawns - deather - 17.03.2010

I have 1776 spawn positions for vehicles:
they are like this
new Float:VehicleSpawns[1776][7] = {
modelid, x, y, z, angle, color1, color2
...
...
};

When i test them it says no error with the array size.

But when i use them to spawn with this code under OnGameModeInit()
Код:
for(new i=0; i<1777; i++)
{
 AddStaticVehicle(VehicleSpawns[i][0],VehicleSpawns[i][1],VehicleSpawns[i][2],VehicleSpawns[i][3],VehicleSpawns[i][4],VehicleSpawns[i][5],VehicleSpawns[i][6]);
}
it shows tag mismatch error.


Re: Vehicle Spawns - biltong - 17.03.2010

Why not just use AddStaticVehicle? Much faster and easier to deal with imo.

Still, that code should work. I don't see anything wrong with it. Do you know which tag it's complaining about?


Re: Vehicle Spawns - [MWR]Blood - 17.03.2010

Quote:
Originally Posted by biltong
Why not just use AddStaticVehicle? Much faster and easier to deal with imo.

Still, that code should work. I don't see anything wrong with it. Do you know which tag it's complaining about?
Yes, use AddStaticVehicle... don't waste your time with hard codes when you can make it very simple


Re: Vehicle Spawns - deather - 17.03.2010

let me give the code:
http://www.deather.pastebin.com/y3uAqwGe


Re: Vehicle Spawns - adsy - 17.03.2010

split it into batchs of 400ish and run the script for each 400


Re: Vehicle Spawns - deather - 17.03.2010

For any value of i, it shows the same error.


Re: Vehicle Spawns - adsy - 17.03.2010

umm hold on a sec, just having a second look but i think i know...


looking

..
..
..

try replacing ALL the " with { on one side and } on the other

example:

" 468,-2508.1077,-1892.6254,297.1185,25.0147,46,46 "

to

{ 468,-2508.1077,-1892.6254,297.1185,25.0147,46,46 }
its a tedious job but if you seperate it out in MS Excel or equiv you should be able to replace the column then re export it.

also why is there a . at the very end

Код:
};.



Re: Vehicle Spawns - biltong - 17.03.2010

So why don't you do what we suggested and just use AddStaticVehicle for each line? Why do you NEED such complicated and slow code?

But, if you want to use your code, I think:

A) Your formatting is wrong. Methinks it doesn't like having those tabs.
B) I think you're supposed to use {}s instead of ""s, like:
pawn Код:
new gVehicles[1776][7] =
{513,291.1346,2535.5850,17.3778,180.2974,21,36},
{512,324.4324,2535.6506,17.5121,181.8785,89,91},
//etc etc
Oh, and I also think the fact that you used Float:gVehicles. Model ids and colours are not float values. Try it without the Float: