Skip to content

feat(es_extended): add SSN#1702

Merged
Kenshiin13 merged 4 commits into
devfrom
ssn
Aug 19, 2025
Merged

feat(es_extended): add SSN#1702
Kenshiin13 merged 4 commits into
devfrom
ssn

Conversation

@Kenshiin13

@Kenshiin13 Kenshiin13 commented Aug 15, 2025

Copy link
Copy Markdown
Contributor

Description

Adds a new ssn field to the users table and updates player logic to handle Social Security Numbers (SSNs). Introduces a utility function to generate valid, unique SSNs, ensures uniqueness via a database constraint, and integrates SSN handling into player creation and loading.


Motivation

To provide each player with a unique SSN that behaves like a real-world identifier, enabling RP mechanics such as identity verification, criminal records, and administrative checks. This enhances immersion and supports gameplay features that rely on unique player identities.


Implementation Details

  • Added ssn column to users table in both SQL schemas, with a unique constraint.
  • Updated player creation logic to generate and store a unique SSN when a new player joins.
  • Modified player loading functions to fetch and attach SSN to the player object.
  • Added a utility function generateSSN() in Lua that ensures valid formatting and uniqueness (with database check using MySQL.scalar.await).
  • All SSNs are stored and handled with dashes for readability (e.g., 123-45-6789).

Usage Example

-- Server-side
print(xPlayer.getSSN()) -- e.g., "123-45-6789"

-- Client-side
print(ESX.PlayerData.ssn) -- e.g., "123-45-6789"

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.

@Kenshiin13

Copy link
Copy Markdown
Contributor Author

@Kr3mu Kr3mu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@Kenshiin13 Kenshiin13 merged commit 713d9bc into dev Aug 19, 2025
3 checks passed
@Kenshiin13 Kenshiin13 deleted the ssn branch August 19, 2025 21:53
@Snovna

Snovna commented Apr 26, 2026

Copy link
Copy Markdown

Hi @Kenshiin13 I just came across this new feature whilst upgrading my esx server to the newest version. Do you know of any ressources using this function or is it just provided as a building block for developers to integrate into their systems?

@Kenshiin13

Copy link
Copy Markdown
Contributor Author

Hi @Kenshiin13 I just came across this new feature whilst upgrading my esx server to the newest version. Do you know of any ressources using this function or is it just provided as a building block for developers to integrate into their systems?

Not aware of any scripts using it, but it's available for anyone to build on. SSN is just another unique player identifier, and there are lots of RP use cases for it (banking, IDs, background checks, etc.).

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