How to disable the /drop command in DarkRP on Garry's M
| Thread |

π¨ Creator π Posts: 177 β©οΈ Replies: 80 β€οΈ Reactions: 25 |
Norda Scripts
Posted 1754895207 (6 views)How to Disable the /drop Command in DarkRP on Garry's Mod
The /drop command in DarkRP allows players to drop their weapons.
However, on some servers this feature can cause problems (abuse, duplication, gameplay balance issues) or conflicts with other addons.
Let's see how to properly disable /drop, whether through configuration or with a custom addon.
Why disable /drop in the DarkRP gamemode?
- Prevent abuse: Players can give away weapons for free.
- Limit duplication: Certain exploits allow duplication of dropped weapons.
- Enhance gameplay: On some RP servers, itβs more immersive to prevent weapon dropping.
- Avoid conflicts: Stops issues with other addons that also use /drop.
1. Disable /drop via DarkRP configuration
If you're using a recent version of DarkRP, open the main configuration file:
Path: darkrp_config/settings.lua
Look for or add the following line:
GM.Config.allowdrop = false
Setting it to false will completely disable the /drop command for all players.
2. Block /drop with a Lua script
If you want to be 100% sure no one can drop a weapon, even through a key bind, create a small Lua addon.
Steps:
- Create a folder in garrysmod/addons/ called disable_drop.
- Inside it, create the file: disable_drop/lua/autorun/server/disable_drop.lua
Add this code:
-- Block weapon dropping
hook.Add("canDropWeapon","DisableDropWeapon",function(ply,weapon) return false end)
-- Remove the /drop command
DarkRP.removeChatCommand("drop")
With this script:
- The canDropWeapon hook blocks all drops, regardless of the method used.
- The /drop chat command is removed entirely.
3. Conclusion
By disabling /drop, you protect your DarkRP server from unwanted weapon transfers and exploits.
For maximum security, combine both the configuration change and the Lua script. |
Sign in or register to reply