jimathy / jim-recycle

74 stars 62 forks source link

scrap search issue #17

Closed tcantrell closed 1 year ago

tcantrell commented 1 year ago

current lines.

elseif Config.Minigame == "ps-ui" then exports['ps-ui']:Circle(function(success) if success then TriggerEvent("QBCore:Notify", Loc[Config.Lan].success["get_trash"], "success") startSearching(GetEntityCoords(dumpster)) searched[i+1] = dumpster else TriggerEvent("QBCore:Notify", Loc[Config.Lan].error["nothing"], "error") searched[i+1] = dumpster ClearPedTasks(PlayerPedId()) end end, 2, 15) -- NumberOfCircles, MS end break end end end end end end)

changed to

elseif Config.Minigame == "ps-ui" then exports['ps-ui']:Circle(function(success) if success then TriggerEvent("QBCore:Notify", Loc[Config.Lan].success["get_scrap"], "success") startSearching(GetEntityCoords(scrapped)) searched[i+1] = scrapped else TriggerEvent("QBCore:Notify", Loc[Config.Lan].error["nothing"], "error") searched[i+1] = scrapped ClearPedTasks(PlayerPedId()) end end, 2, 15) -- NumberOfCircles, MS end break end end end end end end)

or else user can search scrap unlimited times since the the line is looking for searched dumpsters rather then searched scrap. Changes fix the issue for possible abuse.

searched[i+1] = scrapped