qb-core icon indicating copy to clipboard operation
qb-core copied to clipboard

Feat: Add discord to players DB table

Open Cocodrulo opened this issue 1 year ago • 13 comments

Description

Nowadays most servers using QBCore uses discord whitelist, so the player will have their discord linked to FiveM. To ease integration with webapges I think discord information in main qbcore database table (players) should be kept to easy locate characters linked to a player.

Checklist

  • [x] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [x] My code fits the style guidelines.
  • [x] My PR fits the contribution guidelines.

Cocodrulo avatar Jul 20 '24 20:07 Cocodrulo

Just updated, I dont really know if QBCore.Functions.GetIdentifier does retrieve null because if we follow the documentation of the function GetPlayerIdentifierByType and it is right, it always return a string so, the sub will happen in a string, but change it if the docs are not correct

Cocodrulo avatar Jul 26 '24 16:07 Cocodrulo

QBCore.Functions.GetIdentifier can very much return nil.

image

nick-perry14 avatar Jul 26 '24 16:07 nick-perry14

You will be correct if you are talking about old qbcore, now it uses the native:

https://github.com/qbcore-framework/qb-core/blob/e488cbe61e661dc86d16d9e9e7ed4b3e1e341cea/server/functions.lua#L24-L27

Cocodrulo avatar Aug 04 '24 11:08 Cocodrulo

Maybe add something to the config.lua to turn this on and off

Irishstevie avatar Sep 08 '24 03:09 Irishstevie

Well, because the SQL file was change, I feel that it shouldn't be optional

Cocodrulo avatar Sep 08 '24 15:09 Cocodrulo

This PR has had 60 days of inactivity & will close within 7 days

github-actions[bot] avatar Nov 07 '24 15:11 github-actions[bot]

What about this?

Cocodrulo avatar Nov 11 '24 17:11 Cocodrulo

Could you possibly elaborate on the use case example you mentioned?

Qwerty1Verified avatar Nov 12 '24 22:11 Qwerty1Verified

Could you possibly elaborate on the use case example you mentioned?

Yes, for example if u want to get have an admin menu to see all players data (no matters they are online or not) it is always easier, mostly for RP servers, to locate players based on discord Id.

Also if u want to integrate your sv with a discord bot or maybe a Webpage with discord login this will be helpful.

Discord is the main way gaming communities get along right now, and a better integration with this programme providing more critical data storing can become handy.

Cocodrulo avatar Nov 12 '24 22:11 Cocodrulo

The idea is fine but needs more thought instead of just saving additional information

GhzGarage avatar Nov 13 '24 22:11 GhzGarage

As I said before, is not only for just saving data, is for future scripts functionality and for easier Web integration

Cocodrulo avatar Nov 13 '24 22:11 Cocodrulo

I think it really should be added. This will allow new scripts with new innovations

Cocodrulo avatar Nov 26 '24 18:11 Cocodrulo