qbcore-framework / qb-core

FiveM RP Framework Core :muscle:
GNU General Public License v3.0
585 stars 964 forks source link

Add discord to players DB table #1135

Open Cocodrulo opened 3 months ago

Cocodrulo commented 3 months ago

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

Cocodrulo commented 3 months ago

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

nick-perry14 commented 3 months ago

QBCore.Functions.GetIdentifier can very much return nil.

image

Cocodrulo commented 3 months ago

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

Irishstevie commented 1 month ago

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

Cocodrulo commented 1 month ago

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