fix(runcode): timeout sweep and ped-money-drops cleanup (#231)

* fix(runcode): use pairs for codes timeout sweep

Signed-off-by: matti.bat <[email protected]>

* fix(ped-money-drops): match entityRemoved cleanup key

Signed-off-by: matti.bat <[email protected]>

---------

Signed-off-by: matti.bat <[email protected]>
This commit is contained in:
Matti
2026-09-23 21:52:35 +02:00
committed by GitHub
parent 39b91b14ce
commit c6afa3909c
2 changed files with 2 additions and 2 deletions
@@ -34,5 +34,5 @@ RegisterNetEvent('money:tryPickup', function(entity)
end) end)
AddEventHandler('entityRemoved', function(entity) AddEventHandler('entityRemoved', function(entity)
safePositions[entity] = nil safePositions[NetworkGetNetworkIdFromEntity(entity)] = nil
end) end)
+1 -1
View File
@@ -144,7 +144,7 @@ CreateThread(function()
while true do while true do
Wait(100) Wait(100)
for k, v in ipairs(codes) do for k, v in pairs(codes) do
if GetGameTimer() > v.timeout then if GetGameTimer() > v.timeout then
source = nil source = nil
returnCode(k, '', 'Timed out waiting on the target client.') returnCode(k, '', 'Timed out waiting on the target client.')