Skip to content

feat(esx_policejob): integrate esx_inventory storage - #166

Closed
yuu-2k wants to merge 1 commit into
esx-framework:mainfrom
yuu-2k:main
Closed

yuu-2k wants to merge 1 commit into
esx-framework:mainfrom
yuu-2k:main

Conversation

@yuu-2k

@yuu-2k yuu-2k commented Oct 14, 2026

Copy link
Copy Markdown

Integrate esx_inventory storage support into esx_policejob to allow police officers to open the society_police inventory.

Description

This PR updates the police inventory event to use the storage system provided by esx_inventory. Police officers can access the society_police shared storage through the existing inventory event.

Motivation

Ensure compatibility with the esx_inventory resource and allow police officers to access their society storage using the updated inventory system.

Implementation Details

  • Replaced the previous inventory handling with exports.esx_inventory:OpenStorage().
  • Opened the society_police storage for authorized police officers.
  • Added a server-side job validation check to prevent players without the police job from accessing the storage.
  • Added a warning message when an unauthorized access attempt is detected.

Usage Example

RegisterNetEvent('esx_policejob:openInventory')
AddEventHandler('esx_policejob:openInventory', function()
    local source = source
    local xPlayer = ESX.Player(source)

    if not xPlayer or xPlayer.getJob().name ~= 'police' then
        print(('[^3WARNING^7] Player ^5%s^7 attempted to exploit the police inventory!'):format(source))
        return
    end

    exports.esx_inventory:OpenStorage(xPlayer.src, "society_police")
end)

PR Checklist

  • My commit messages and PR title follow the Conventional Commits 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.

Integrate esx_inventory storage support into esx_policejob to allow police officers to open the society_police inventory. Add a job validation check to prevent unauthorized access.
@CLAassistant

CLAassistant commented Oct 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yuu-2k yuu-2k closed this Oct 15, 2026
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.

2 participants