CreateThread(function()
while true do
local ped = PlayerPedId()
local entering = GetVehiclePedIsTryingToEnter(ped)
local sleep = 100
if entering ~= 0 then
sleep = 2000
local driver = GetPedInVehicleSeat(entering, -1)
if driver == 0 then
TriggerServerEvent('keys:server:setVehLockState', NetworkGetNetworkIdFromEntity(entering), 2)
end
end
end
end)
-- Server tarafi
RegisterNetEvent('keys:server:setVehLockState', function(vehNetId, state)
SetVehicleDoorsLocked(NetworkGetEntityFromNetworkId(vehNetId), state)
end)