Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge): statebag spam #157

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions bridge/qb/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ local function giveKeys(source, plate)
local vehicles = plate and GetVehiclesFromPlate(plate) or {GetVehiclePedIsIn(GetPlayerPed(source), false)}
local success = false
for i = 1, #vehicles do
if GiveKeys(source, vehicles[i], true) then
success = true
local vehicle = vehicles[i]
if DoesEntityExist(vehicle) then
if GiveKeys(source, vehicles[i], true) then
success = true
end
Wait(20)
end
end
if success then
Expand All @@ -20,8 +24,12 @@ local function removeKeys(source, plate)
local vehicles = GetVehiclesFromPlate(plate)
local success = false
for i = 1, #vehicles do
if RemoveKeys(source, vehicles[i], true) then
success = true
local vehicle = vehicles[i]
if DoesEntityExist(vehicle) then
if RemoveKeys(source, vehicle, true) then
success = true
end
Wait(20)
end
end
if success then
Expand Down
Loading