@@ -80,7 +80,7 @@ local function setVehicleDoorLock(vehicle, state, anim)
80
80
TaskPlayAnim (cache .ped , ' anim@mp_player_intmenu@key_fob@' , ' fob_click' , 3.0 , 3.0 , - 1 , 49 , 0 , false , false , false )
81
81
end
82
82
83
- TriggerServerEvent ( ' InteractSound_SV:PlayWithinDistance ' , 5 , ' lock ' , 0.3 )
83
+ StartVehicleHorn ( vehicle , 1 , ' HELDDOWN ' , false )
84
84
NetworkRequestControlOfEntity (vehicle )
85
85
86
86
local lockstate
@@ -111,14 +111,14 @@ end
111
111
exports (' SetVehicleDoorLock' , setVehicleDoorLock )
112
112
113
113
local function getOtherPlayersInVehicle (vehicle )
114
- local otherPeds = {}
114
+ local otherPlayers = {}
115
115
for seat = - 1 , GetVehicleModelNumberOfSeats (GetEntityModel (vehicle )) - 2 do
116
116
local pedInSeat = GetPedInVehicleSeat (vehicle , seat )
117
- if IsPedAPlayer ( pedInSeat ) and pedInSeat ~= cache .ped then
118
- otherPeds [ # otherPeds + 1 ] = pedInSeat
117
+ if pedInSeat ~= cache .ped and IsPedAPlayer ( pedInSeat ) then
118
+ otherPlayers [ # otherPlayers + 1 ] = GetPlayerServerId ( NetworkGetPlayerIndexFromPed ( pedInSeat ))
119
119
end
120
120
end
121
- return otherPeds
121
+ return otherPlayers
122
122
end
123
123
124
124
local function getPedsInVehicle (vehicle )
@@ -410,7 +410,7 @@ RegisterNetEvent('qb-vehiclekeys:client:GiveKeys', function(id, plate)
410
410
if IsPedSittingInVehicle (cache .ped , targetVehicle ) then -- Give keys to everyone in vehicle
411
411
local otherOccupants = getOtherPlayersInVehicle (targetVehicle )
412
412
for p = 1 , # otherOccupants do
413
- TriggerServerEvent (' qb-vehiclekeys:server:GiveVehicleKeys' , GetPlayerServerId ( NetworkGetPlayerIndexFromPed ( otherOccupants [p ])) , targetPlate )
413
+ TriggerServerEvent (' qb-vehiclekeys:server:GiveVehicleKeys' , otherOccupants [p ], targetPlate )
414
414
end
415
415
else -- Give keys to closest player
416
416
local playerId = lib .getClosestPlayer (GetEntityCoords (cache .ped ), 3 , false )
0 commit comments