[ESX] How can i have a "Permanent" Player ID?

My crew are developing a ESX based server, and we thought that using id’s to identify will help us to manage players easier… with GetPlayerServerId( ) code… but…
*Everytime a player restarts, changes it’s ID automatically to the next empty value
considering we are 3, (so id = 1,2,3), if id=1 restart their client, it connects with id=4, not 1 (same player, same steam, spawn with same loadout etc…)

Is there a way to use GetPlayerServerId( ) and catch id info from ‘users’ table in my database??! i created a column called “id” with primary key and auto_increment, it saves the info that i need…

bc im not familiar with mysql-async code, i dont know how to implement this in a scoreboard or idoverhead scripts.

3 Likes

I have the same problem, did you solve it?

Not yet, just a little progress…
I used esx_shop sql implementation code, and adapted to search my db and pick up an user ID, but still can’t understand how i can show it, i got it working but it’s showing the same ID for everyone.
I’ll try again this weekend, for now i need to code a comparison using playername in-game with DB, so it returns only their specific ID.
If everything works out, i’ll release it as a script.

1 Like

Why?
You can create a UNIQUE ID for every steam id or license in the database…
And get that ID value when player connects, by the identifiers.
But i think this is useless in my opinion

1 Like

could be super useful when it comes to creating a voting script to vote for someone to be a mayor they can do /vote [unique ID]
so it saves in database that their uniqueID had so many votes and its linked to their steam in the database so that you can see who has how many votes ect…

Useles, you dont really need a UniqueID to do that voting script…

1 Like

It’s more convenient with UniqueID’s, to a player identify another player besides their usernames…

Let’s try with a basic example.
If someone didn’t follow our rules and offended another player… idk… , server id numbers are random right? and he can change his steam name whenever he wants right?
So how this “victim” can report it to an admin? bc that guy can restart his client (to auto change ID number), and change steam name, there’s no way to a normal player identify him and report if admin is offline.

I don’t think there’s another way to do this, or im looking the wrong way…

And of course you can implement something different like @KrizFrost said…

2 Likes

did you ever get one sorted out would love to have it myself

1 Like

to be honest i actually like that! i’d love to see this in action.

I would appreciate this aswell! :slight_smile:

id love this if anyone does get round to it let us know here

1 Like

This topic was automatically closed after 32 hours. New replies are no longer allowed.