start keys serverside
This commit is contained in:
1 parent
17d68505a6
commit
75216f538e
4 files changed
+23
-6
No files matched your search
@@ -2,7 +2,7 @@ if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end
|
|||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|
||||||
VehicleKey.GiveKeys = function(vehicle, plate)
|
VehicleKey.GiveKeys = function(vehicle, plate)
|
||||||
if not DoesEntityExist(vehicle) then return false end
|
if not DoesEntityExist(vehicle) and not plate then return false end
|
||||||
return exports.MrNewbVehicleKeys:GiveKeys(vehicle)
|
return exports.MrNewbVehicleKeys:GiveKeys(vehicle)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,19 @@ if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end
|
|||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|
||||||
VehicleKey.GiveKeys = function(src, vehicle, plate)
|
VehicleKey.GiveKeys = function(src, vehicle, plate)
|
||||||
--wip
|
if vehicle then
|
||||||
|
local netId = NetworkGetNetworkIdFromEntity(vehicle)
|
||||||
|
return exports.MrNewbVehicleKeys:GiveKeys(src, netId)
|
||||||
|
elseif plate then
|
||||||
|
return exports.MrNewbVehicleKeys:GiveKeysByPlate(src, plate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
VehicleKey.RemoveKeys = function(src, vehicle, plate)
|
VehicleKey.RemoveKeys = function(src, vehicle, plate)
|
||||||
-- wip
|
if vehicle then
|
||||||
|
local netId = NetworkGetNetworkIdFromEntity(vehicle)
|
||||||
|
return exports.MrNewbVehicleKeys:RemoveKeys(src, netId)
|
||||||
|
elseif plate then
|
||||||
|
return exports.MrNewbVehicleKeys:RemoveKeysByPlate(src, plate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -3,9 +3,12 @@ if GetResourceState('qbx_vehiclekeys') == 'started' then return end
|
|||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|
||||||
VehicleKey.GiveKeys = function(vehicle, plate)
|
VehicleKey.GiveKeys = function(vehicle, plate)
|
||||||
|
if plate == nil and vehicle and DoesEntityExist(vehicle) then
|
||||||
|
plate = GetVehicleNumberPlateText(vehicle)
|
||||||
|
end
|
||||||
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
|
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
|
||||||
end
|
end
|
||||||
|
|
||||||
VehicleKey.RemoveKeys = function(vehicle, plate)
|
VehicleKey.RemoveKeys = function(vehicle, plate)
|
||||||
return true
|
TriggerEvent('qb-vehiclekeys:client:RemoveKeys', plate)
|
||||||
end
|
end
|
||||||
@@ -3,9 +3,13 @@ if GetResourceState('qbx_vehiclekeys') == 'started' then return end
|
|||||||
VehicleKey = VehicleKey or {}
|
VehicleKey = VehicleKey or {}
|
||||||
|
|
||||||
VehicleKey.GiveKeys = function(src, vehicle, plate)
|
VehicleKey.GiveKeys = function(src, vehicle, plate)
|
||||||
--wip
|
if plate then
|
||||||
|
return exports["qb-vehiclekeys"]:GiveKeys(src, plate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
VehicleKey.RemoveKeys = function(src, vehicle, plate)
|
VehicleKey.RemoveKeys = function(src, vehicle, plate)
|
||||||
-- wip
|
if plate then
|
||||||
|
return exports["qb-vehiclekeys"]:RemoveKeys(src, plate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user