Need help with Enc0ded persistence vehicles 2.0.2

So ive recently purchased the encoded persistence mod, but I cannot for the life of me figure out where to put the trigger events on client side ive searched everywhere.

If anyone could help i would really appreciate it thank you.

Hey ! :slightly_smiling_face:
The readme seems pretty straight forward.
You just need to trigger the ‘EncodedPersistent’ event where you create the vehicle you want to be persistant.

For example, if you have a garage that works with esx somewhere in you garage’s client script files you will have the following code :

ESX.Game.SpawnVehicle('blista', vector3(120.0, -200.0, 30.0), 100.0, function(vehicle)
    print(DoesEntityExist(vehicle), 'Vehicle as been created !')
end)

This code is the esx function that creates a vehicle.

In order to make the vehicle created by your garage (or car dealer or else), you just have to find in the code similar to the example above and add the Trigger for the event as I show you under here :

ESX.Game.SpawnVehicle('blista', vector3(120.0, -200.0, 30.0), 100.0, function(vehicle)
    -- Here we are in the callBack function, there will mostlikely be some code but you just have to add your trigger 
    TriggerEvent('persistent..../register....', vehicle)
end)

For the update and the removing of the persistance it’s pretty much the same. You just need to hook the different events where the vehicle is updated or deleted (ls custom, garage (when vehicle is stored) etc…)

1 Like