Skip to content

Policejob major update:#75

Open
MaitreAntho wants to merge 2 commits intoesx-framework:mainfrom
MaitreAntho:fix-policejob
Open

Policejob major update:#75
MaitreAntho wants to merge 2 commits intoesx-framework:mainfrom
MaitreAntho:fix-policejob

Conversation

@MaitreAntho
Copy link

Changes

  • Refactored client/main.lua (FreezePlayer, PlayerPedId usage, thread cleanup)
  • Refactored server/main.lua (secured buyWeapon/buyVehicle, account choice, MySQL checks)
  • Added Config.ArmoryAccount (money/bank) for armory purchases
  • Improved shared/permissions.lua and constants.lua handling
  • Fixed weapon purchase error and removed redundant code

Description

  • This PR improves esx_policejob by cleaning redundant code, adding configuration options, and securing sensitive logic. The goal is to provide a more maintainable and secure implementation while fixing common issues related to weapon purchases and performance.

Motivation

  • Prevent potential exploits in weapon and vehicle purchases
  • Provide flexibility in payment method configuration (money or bank)
  • Improve overall code quality and maintainability
  • Implementation Details
  • Unified usage of PlayerPedId
  • Added validation and SQL checks for purchases
  • Introduced Config.ArmoryAccount to manage purchase account source
  • Cleaned unnecessary threads and code duplication

- Refactored client/main.lua (FreezePlayer, PlayerPedId, threads cleanup)
- Refactored server/main.lua (secure buyWeapon/buyVehicle, account choice, MySQL checks)
- Added Config.ArmoryAccount (money/bank) for purchases
- Improved shared/permissions.lua and constants.lua handling
- Fixed weapon purchase error and cleaned redundant code
}

Config.Cuffs = {
FreezePlayer = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a soft and hard cuff option instead of freezeplayer with controls that are disabled or not for each?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, that's a good idea, I didn't have it at the time. I'll take care of it in the afternoon.

@N0tNvll
Copy link
Contributor

N0tNvll commented Oct 5, 2025

I see different things that you can continue refactorizing and separate in different files to have a better readable

At the same time i see this news implementations
[esx_addons]/esx_policejob/shared/constants.lua
[esx_addons]/esx_policejob/shared/permissions.lua

Did you test it that it works good?

@N0tNvll
Copy link
Contributor

N0tNvll commented Oct 12, 2025

Did you check the script at all?
{36539067-9488-49FA-9A4F-7389D2C230F6}
{139A8EF7-4D19-4DE8-B32D-4C58F934DE53}

Its using different languages some parts are taking the convar and others the english language check that

{6DDD7187-62D3-4C3D-A4F8-22FB6759A442} imagen Use POLICE var directly pls imagen

The rest apparently to have a good readable like expected

@CLAassistant
Copy link

CLAassistant commented Nov 16, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

4 participants