Setting up vehicles
Each vehicle you wish to use a police tracker on must be configured beforehand in the config.lua file. To begin, navigate to the vehicles = { section.
Configuring vehicles beforehand is required as this sets the position on the vehicle for the tracker unit to spawn on, ensuring it is right for each different vehicle model and not incorrectly positioned. This may take some trial and error to find the right position for each vehicle.
We'll use the model name police2 as an example to configure:
To begin, the model name must be wrapped in this symbol: `.
This allows for runtime hashing of the model name, improving efficiency of the overall resource. The resource will not work if it is not wrapped in those symbols.
The name line allows you to set a description of the vehicle. This is mainly used for logging purposes so you'll know which vehicle a tracker was deployed onto or removed from.
The boneName line is the bone that the tracker should attach to. This should be a bone that exists on the vehicle. If you aren't sure, we recommend using the bone name engine as this exists on most vehicle models and it can be found at the front, exactly where we need the tracker unit to be!
For a list of bone names, take a look here. Each one will not exist on every vehicle and it depends on the model you're using.
This section is where things may get confusing! We need to setup the offSet and rotation of the bumper relative to the boneName. Whilst the engine may be located at the front of the vehicle, we still might need to move the tracker forward slightly so it isn't sticking out as much. This allows us to do that.
offSet = {x, y, z}
- This is the format of setting the offset. X moves left and right. Y moves forward and backwards, Z moves up and down. In the example, we've moved 1.0 forwards and 0.4 downwards (-).
rotation = {x, y, z}
- This allows you to rotate the grappler prop along three different exis, which will likely not be required unless your bone has been incorrectly rotated on the vehicle model.
We're also here to help and if you're struggling to setup the offSet and rotation for your fleet of vehicles, we can provide assistance. To get in touch, join our Discord server, email us or send us a message on the FiveM forum.
Developer Command
We've added a developer command built into the resource to help you position the tracker onto your vehicles. To begin, head to the config.lua file and enable developerMode.
This enables the /installtracker command in-game. To start, get into the vehicle you want to position the tracker for and run the command.
This will spawn in a new tracker unit prop connected to the vehicle, you can then move it around with the following keys:
Page Up / Page Down - Up and Down
Arrow Up / Arrow Down - Moving Forwards and Backwards
Arrow Left / Arrow Right - Moving Left and Right
B and N - Rotating Left and Right
Once you are happy with the positioning of the tracker, you can press ENTER to confirm the position. Next, you can use the same controls to adjust the rotation, pressing ENTER to confirm the rotation.
The offSet and rotation values will then be printed for you on screen and also in the F8 console to copy easily into the config.lua file, ready to be used when you restart the resource.
Last updated