You can no longer put people in vehicle if they're not handcuffed

This commit is contained in:
ElPumpo
2018-07-17 21:18:56 +02:00
parent 206509a46c
commit 6144990abf
2 changed files with 23 additions and 20 deletions
+22 -20
View File
@@ -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')
+1
View File
@@ -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~!',