Skip to content

feat(es_extended): add Config.EnablePickup to disable/enable this feature#1798

Open
mysbryce wants to merge 1 commit into
esx-framework:devfrom
mysbryce:dev
Open

feat(es_extended): add Config.EnablePickup to disable/enable this feature#1798
mysbryce wants to merge 1 commit into
esx-framework:devfrom
mysbryce:dev

Conversation

@mysbryce

@mysbryce mysbryce commented Jul 4, 2026

Copy link
Copy Markdown

Description

This PR introduces a new configuration option, Config.EnablePickup, to es_extended. This toggle gives server owners the flexibility to choose whether a physical pickup object drops on the ground when an item or weapon is removed from a player's inventory.


Motivation

Currently, removing an item or a weapon automatically forces a ground pickup to spawn. While this fits some server styles, many developers prefer to delete items silently (e.g., for clean-up scripts, custom inventory wipes, or specific roleplay scenarios) without cluttering the map or allowing players to immediately scoop the item back up. This change solves that issue by putting the control directly in the config.


Implementation Details

  • Added Config.EnablePickup to config.lua (defaulting to true to preserve original framework behavior).
  • Wrapped the pickup spawning logic inside the item/weapon removal functions with a simple conditional check. If set to false, the item is removed cleanly without executing the object creation code.

Usage Example

In your config.lua:

-- Set to true to drop a pickup on the ground when items/weapons are removed (Default)
-- Set to false to silently delete them without spawning a ground pickup
Config.EnablePickup = false 

PR Checklist

  • My commit messages and PR title follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant