[problem] Multiple cars having the same id
#1

I know it's sounds not good , but i have 2 cars and they have the same carid ( id taked with /oldcar)
And it's annoyng because they don't respawn , and can't use them in other actions.

The script have 300vehicles , and the 2 vehicles supose to bee vehid 301 and vehid 302 .
they look like this
pawn Код:
AddStaticVehicleEx(406,-2069.4924,-83.6286,35.2438,178.9685,2,2, 60000);
AddStaticVehicleEx(406,-2065.3347,-82.2186,33.3438,178.3711,2,2, 60000);
Any suggestions ?
Reply
#2

Don't use AddStaticVehicle... ever, you never need it. You CreateVehicle. AddStaticVehicle(Ex) doesn't give vehicles an ID.
Reply
#3

Well the previous vehicles are the same , and they have uniqe ID.
Reply
#4

but there is no way for you to keep track of those id... if you load a new FS you might change your usual car ID
hes right, if you need to keep track of those car ID you should use like
pawn Код:
new ThatCar;

on...init()
{
   ThatCar = CreateVehicle(type, x, y, z, rot, c1, c2, respawn_delay);
}
Reply
#5

Yea use

new car1;

and

car1 = addstaticvehicle(...);

The id of the car is "car1"
Reply
#6

no, you can use
pawn Код:
new Car[500]; // You can change the 500 with the maximum of server cars

Car[0] = CreateVehicle(....
Car[1] = CreateVehicle(...
Reply
#7

Quote:
Originally Posted by Zafire1410
Yea use

new car1;

and

car1 = addstaticvehicle(...);

The id of the car is "car1"
AddStaticVehicle doesn't give a number, so car1 = addstaticvehicle will give you nothing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)