es_extended - throwables, parachutes and gas canisters are not removed by the server
Describe the bug Parachutes, Gasoline canisters, Throwables etc. aren't removed by the server from the player, when using them all out. You could just reconnect or relog and have atleast 1 of them again. Works for parachutes in a way that grants infinite parachutes.
To Reproduce Steps to reproduce the behavior:
- Have a parachute
- Use it
- See it's gone
- Rejoin
- It's back
Expected behavior Misc items getting removed by the server after reaching the end of them.
Screenshots None needed
Debug Info (please complete the following information): Irrelevant
Additional context Not needed
Fixed in #394
that fix was rejected?
It wasn't finished. But no comment from anyone tho.
Yea I was waiting for maintainers feedback on which path to go before commiting the followup solution regarding the possible cheater abuse discussed in the PR. Got closed for whatever reason though.
Hi! @mcNuggets1 Thank you for create issue. I honestly don't know why this issue was closed, but I'm here now and we can talk about it.
If I understand correctly, the problem is that certain items are not deleted by the server when they are used up?
What is now the status of this fix?
Thank you for answers.
Items are not removed and the fix was closed
@mcNuggets1 Why must it always run? Can't we check if someone has thrown something away/used it up? What do you think about this?
I honestly don't know any game events that do alert us of that event.
I see.
CreateThread(function()
while ESX.PlayerLoaded do
for i, weapon in ipairs(ESX.GetPlayerData().loadout) do
local playerHasWeapon = HasPedGotWeapon(ESX.GetPlayerData().ped, GetHashKey(weapon.name), false)
if not playerHasWeapon then
TriggerServerEvent('esx:removeWeapon', weapon.name)
end
end
Wait(1000)
end
end)
That's what I meant. That's always the run for cycle but really you should only be holding a gun shouldn't you?
I didn't create the code. Optimising the code would look the following:
- check only for a few weapons, that actually can be removed from inventory
- allow serverside removal only of these weapons
- optimise the poorly written code and maybe don't update every second (also maybe do it serverside, not clientside)
@mcNuggets1 Oh sorry you just commented there. #394 Could you then write it as you say and if it's good we'll accept it?
Whenever I get the time, I could take a look at it. Currently Im a little bit busy however.
No problem, thank you on behalf of the ESX team.