Skip to content

Conversation

@SNAILX808
Copy link

@SNAILX808 SNAILX808 commented Oct 22, 2025

Description

implemented nationalities system


Implementation Details

  • Integrated nationality data into player data structure in es_extended
  • Nationality stored as string identifier in database for flexibility
  • stored nationalities in countries.json
  • Added server-side security check to validate only countries listed in countries.json

Usage Example

-- client-side usage 
ESX.GetPlayerData().nationality

-- server-side usage
-- get nationality
xPlayer.getNationality()
or 
xPlayer.nationality
-- set nationality
xPlayer.setNationality("esx")

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.

- converted countries to lua table
- applied numeric loop in isValidNationality function
- added countries.lua

RegisterNUICallback("ready", function(_, cb)
ready = true
SendNUIMessage({ type = "config", data = Config })
Copy link

Choose a reason for hiding this comment

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

Use the cb param to send the data. So something like cb({ data = Config }) No need to have another event sending the config, unnecessary.

Yep, that's a good idea. Thank you very much! Slipped my mind.


RegisterNUICallback("ready", function(_, cb)
ready = true
SendNUIMessage({ type = "config", data = Config })
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the cb param to send the data. So something like cb({ data = Config }) No need to have another event sending the config, unnecessary.

Kenshiin13 and others added 6 commits October 23, 2025 18:12
feat(es_extended): add xPlayer.updatePlayerData
- setNationality func to set the nationality and used updatePlayerData to sync the nationality on the client-side
- getNationality func to return nationality as string value

- removed the parts that use state bag
@SNAILX808 SNAILX808 requested a review from Zykem October 25, 2025 18:29
Copy link
Contributor

@Zykem Zykem left a comment

Choose a reason for hiding this comment

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

Tested, LGTM

@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 all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ SNAILX808
✅ Kenshiin13
❌ Zykem
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.

5 participants