From bde1f5b0bb8cb10be0acba2ec9e3a6178c3e130b Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Sun, 27 Aug 2023 01:22:27 +0200 Subject: [PATCH] update(vehicle): lockpick event & alarm --- client/vehicle.lua | 5 +---- server/vehicle.lua | 9 ++++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/vehicle.lua b/client/vehicle.lua index 32f4684..1af87e9 100644 --- a/client/vehicle.lua +++ b/client/vehicle.lua @@ -243,15 +243,12 @@ RegisterNetEvent("ND_Vehicles:blip", function(netid, status) EndTextCommandSetBlipName(blip) end) -RegisterNetEvent("ND_Vehicles:syncAlarm", function(netid, success, action) +RegisterNetEvent("ND_Vehicles:syncAlarm", function(netid) local veh = NetToVeh(netid) if not veh then return end SetVehicleAlarmTimeLeft(veh, 1) SetVehicleAlarm(veh, true) StartVehicleAlarm(veh) - if success and action == "lockpick" then - setVehicleLocked(veh, false) - end end) RegisterNetEvent("ND_VehicleSystem:setOwnedIfNot", function(netid) diff --git a/server/vehicle.lua b/server/vehicle.lua index 63aaf00..cd735ea 100644 --- a/server/vehicle.lua +++ b/server/vehicle.lua @@ -231,10 +231,13 @@ function NDCore.saveVehicleProperties(source, veh, properties) end end -RegisterNetEvent("ND_Vehicles:syncAlarm", function(netid, success, action) - local veh = NetworkGetEntityFromNetworkId(netid) +RegisterNetEvent("ND_Vehicles:lockpick", function(netId, success) + local veh = NetworkGetEntityFromNetworkId(netId) local owner = NetworkGetEntityOwner(veh) - TriggerClientEvent("ND_Vehicles:syncAlarm", owner, netid, success, action) + TriggerClientEvent("ND_Vehicles:syncAlarm", owner, netId) + if not success then return end + local state = Entity(veh).state + state.locked = false end) if Config.useInventoryForKeys then