[ESX] stasiek_vehiclekeys - A new better vehicle key locksystem based on decors

stasiek_vehiclekeys

Still using esx_locksystem? A new better vehicle key locksystem based on decors

  • server-sync

  • best optymalization

  • no database interference

  • only client-side script

requirements

  • es_extended
  • change CreateVehicle native to ESX.Game.SpawnVehicle() in your scripts or add DecorSetInt(vehicle, "owner", GetPlayerServerId(PlayerId())) to your scripts to set vehicle owner

Add this line to es_extended/client/functions.lua#ESX.Game.SpawnVehicle


DecorSetInt(vehicle, "owner", GetPlayerServerId(PlayerId()))

esx error?

Try adding below code into es_extended/client/functions.lua


ESX.PlayAnim = function(dict, anim, speed, time, flag)
    ESX.Streaming.RequestAnimDict(dict, function()
        TaskPlayAnim(PlayerPedId(), dict, anim, speed, speed, time, flag, 1, false, false, false)
    end)
end

Download

6 Likes

One problem with decors might be the famous Networking issue, where the network id is in controle of another person, that tends to give some issues.

Possibility to have Inventory Keys and dupe Keys for Friends for example?

there’s a /givekeys command

Is this not an overwrite of the owner?
Bc I want to stay the owner but want that I can give him the Key so he can park the car out of his garage but is’nt the owner of it, for example If I don’t use the Car he can use it. And If he’s not using it I can park it out, you get me?

Just set decor to second player and they both have a keys. Use DecorSetInt(vehicle, "owner", GetPlayerServerId(PlayerId()))

1 Like

I added the code to es_extended function.lua and when I try to lock my vehicles, it says “No vehicles to lock nearby”

I dont get any errors in the console or anything. What would cause that?

What is the button or command to lock and unlock the car?

No funciona xd

and what about if a players being dropped from session ( restart / crash ) and trying to get back into his car?

owner = DecorGetInt(vehicle, "owner")
    if owner ~= GetPlayerServerId(PlayerId()) then

i cant seem to change the keybind, does anyone know?

doesn’t work /givekeys keys don’t work