Posts: 216
Threads: 55
Joined: Feb 2016
Reputation:
0
When i get into a vehicle it says i need to be a police officer even if i get into a different faction vehicle like EMS vehicle, i am new to scripting so still learning alot and was just wondering anyone know common problems plus what code it is i want to look for to change? lol sorry for being noobie...
Posts: 6,242
Threads: 8
Joined: Jun 2008
Depends what gamemode it is.
Most use OnPlayerStateChange to check, then have a check such as IsCopCar or IsAmbulance.
In those 2 functions (IsCopCar & IsAmulance) they'll check either the model of the vehicle, or the Vehicle ID of the vehicle. If you've added cars in to the script then the IDs will be out of whack if it uses VehicleIDs, rather than the Model ID.
Vehicle IDs are from the order they are spawned into the server. ModelID is directly about what car it actually is.
I use a Vehicle Team variable on all my cars to make it simpler.