mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 18:58:54 +00:00
You can no longer put people in vehicle if they're not handcuffed
This commit is contained in:
+22
-20
@@ -1468,35 +1468,37 @@ end)
|
||||
|
||||
RegisterNetEvent('esx_policejob:putInVehicle')
|
||||
AddEventHandler('esx_policejob:putInVehicle', function()
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
if not IsHandcuffed then
|
||||
return
|
||||
end
|
||||
|
||||
if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then
|
||||
if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then
|
||||
|
||||
local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71)
|
||||
local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71)
|
||||
|
||||
if DoesEntityExist(vehicle) then
|
||||
if DoesEntityExist(vehicle) then
|
||||
|
||||
local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle)
|
||||
local freeSeat = nil
|
||||
local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle)
|
||||
local freeSeat = nil
|
||||
|
||||
for i=maxSeats - 1, 0, -1 do
|
||||
if IsVehicleSeatFree(vehicle, i) then
|
||||
freeSeat = i
|
||||
break
|
||||
end
|
||||
end
|
||||
for i=maxSeats - 1, 0, -1 do
|
||||
if IsVehicleSeatFree(vehicle, i) then
|
||||
freeSeat = i
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if freeSeat ~= nil then
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat)
|
||||
DragStatus.IsDragged = false
|
||||
end
|
||||
if freeSeat ~= nil then
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat)
|
||||
DragStatus.IsDragged = false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_policejob:OutVehicle')
|
||||
|
||||
@@ -35,6 +35,7 @@ Locales['sv'] = {
|
||||
['put_in_vehicle'] = 'sätt in i fordon',
|
||||
['out_the_vehicle'] = 'dra ut ur fordon',
|
||||
['fine'] = 'Ge böter',
|
||||
['unpaid_bills'] = 'se obetalda räkningar',
|
||||
['license_check'] = 'se licenser',
|
||||
['license_revoke'] = 'återkalla licenser',
|
||||
['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~återkallat~s~!',
|
||||
|
||||
Reference in New Issue
Block a user