mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
update(vehicle): lockpick event & alarm
This commit is contained in:
@@ -243,15 +243,12 @@ RegisterNetEvent("ND_Vehicles:blip", function(netid, status)
|
|||||||
EndTextCommandSetBlipName(blip)
|
EndTextCommandSetBlipName(blip)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("ND_Vehicles:syncAlarm", function(netid, success, action)
|
RegisterNetEvent("ND_Vehicles:syncAlarm", function(netid)
|
||||||
local veh = NetToVeh(netid)
|
local veh = NetToVeh(netid)
|
||||||
if not veh then return end
|
if not veh then return end
|
||||||
SetVehicleAlarmTimeLeft(veh, 1)
|
SetVehicleAlarmTimeLeft(veh, 1)
|
||||||
SetVehicleAlarm(veh, true)
|
SetVehicleAlarm(veh, true)
|
||||||
StartVehicleAlarm(veh)
|
StartVehicleAlarm(veh)
|
||||||
if success and action == "lockpick" then
|
|
||||||
setVehicleLocked(veh, false)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("ND_VehicleSystem:setOwnedIfNot", function(netid)
|
RegisterNetEvent("ND_VehicleSystem:setOwnedIfNot", function(netid)
|
||||||
|
|||||||
@@ -231,10 +231,13 @@ function NDCore.saveVehicleProperties(source, veh, properties)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent("ND_Vehicles:syncAlarm", function(netid, success, action)
|
RegisterNetEvent("ND_Vehicles:lockpick", function(netId, success)
|
||||||
local veh = NetworkGetEntityFromNetworkId(netid)
|
local veh = NetworkGetEntityFromNetworkId(netId)
|
||||||
local owner = NetworkGetEntityOwner(veh)
|
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)
|
end)
|
||||||
|
|
||||||
if Config.useInventoryForKeys then
|
if Config.useInventoryForKeys then
|
||||||
|
|||||||
Reference in New Issue
Block a user