Bro how can i add the export to ESX itself
which means when i spawn car from txadmin or /car it need a key and i tried alot of solutions but it didn’t work , may you help me please ?
In your es_extended/client/functions.lua
after line 401 where you create the vehicle add the export of giving keys.
Soon XD_Locksystem V2 will be released ![]()
i can’t wait to see it <3
Still not working bro
I’m currently using No1_freecar to give out free cars but it’s not giving out the keys along side it causing the player to hotwire them first.
ESX.Game.SpawnVehicle(Config.Vehicle["model"], Config.Locations["SpawnCoords"], Config.Locations["SpawnCoords"].w, function(spawnedVehicle)
if DoesEntityExist(spawnedVehicle) then
local plate = exports['esx_vehicleshop']:GeneratePlate()
SetVehicleNumberPlateText(spawnedVehicle, plate)
exports['xd_locksystem']:givePlayerKeys(plate)
TaskWarpPedIntoVehicle(PlayerPedId(), spawnedVehicle, -1)
local vehicleProps = ESX.Game.GetVehicleProperties(spawnedVehicle)
TriggerServerEvent("no1_freecar:server:SetOwnedVehicle", plate, vehicleProps)
end
end)
I think i found the problem it looks like when the vehicle plate is not 8characters its not providing out keys to the owner / when I mess with the plate and change it to an 8 character plate number it gave me the key.
I was able to somewhat fix it by adding a whitespace filter which removes the whitespace on the value of GetVehicleNumberPlateText.
New improved version have released please have a look
xd_locksystem v2