Skip to content

feat(es_extended): add SSN#1702

Merged
Kenshiin13 merged 4 commits intodevfrom
ssn
Aug 19, 2025
Merged

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

Conversation

@Kenshiin13
Copy link
Copy Markdown
Contributor

@Kenshiin13 Kenshiin13 commented Aug 15, 2025

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

Copy link
Copy Markdown
Member

@Kr3mu Kr3mu left a comment

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
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.

3 participants