Vehicle Spawns
#1

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

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

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

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

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

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

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

Код:
};.
Reply
#8

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:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)