[Release] Delete Weapon Drops from NPC

Surprised to not see this already posted. After hearing about some servers still having issues with players farming weapons from AI, figure I’d share this. Simple script to clean up weapon drops.

Simply drop it in a client side script. As far as I could tell only the pistol, shotgun and carbine rifle ever dropped. Add hashes as needed.

Citizen.CreateThread(function()
  while true do
    Citizen.Wait(1)
    -- List of pickup hashes (https://pastebin.com/8EuSv2r1)
    RemoveAllPickupsOfType(0xDF711959) -- carbine rifle
    RemoveAllPickupsOfType(0xF9AFB48F) -- pistol
    RemoveAllPickupsOfType(0xA9355DCD) -- pumpshotgun
  end
end)
10 Likes

This will probably conflict with weapondrop.

I’m sure it would. We don’t use it, so could not confirm.

Yeah just to let people know, neat release though :slight_smile:

1 Like

here a script that removes npc weapon drops:
no weapon drop by npc

7 Likes

What’s the benefit of that one? Seems overly complicated for the same thing.

Edit: Ok I see now. It prevents the weapon drop from happening. Cool. Nice share.

no problem :slight_smile:

thanks for sharing jager :wink: but in which file should I add these lines

Yeah im wondering the same thing. Where can i put these lines in?

nomewhere clientsided in a script you want

1 Like

how i add it plz tell me

1 Like
  1. Download nonpcdrop.rar (765 Bytes)
  2. Go to server resources and extract the files
  3. Locate server.cfg and add start nonpcdrop

I take no credit for the script

10 Likes

lol you just took what i shared lol and you’ve put it in a useless ressourec, just put the code somewhere in clientside in a script, and you won’t have to add a ressource (to much ressources makes your server lag)

Well no one helped him? So I did. any problems?

4 Likes

Thank you so mush
:joy::joy::joy:

Great script! Thank you for sharing.
Long time ago, I tried to find a way to iterate peds, and NOW. F… YEAH!

Thank you once again! :slight_smile:

1 Like

Where do I put this?

i a script you want client sided

Currently receiving this error after like 10 minutes into the game. Any idea what to do about it?

3 Likes

I bet you have a big number of npc’s in-game, since almost every npc drops “something” script needs to block almost every npc and this is why this script is takieing a lot of FPS (in my opinion)