Version 3. Works with ESX, QBCore, and Standalone.
If you encounter any issues, create a bug report in my discord or open an issue .
Install all the requirements
Download the latest release
Extract the zip file into your resources folder
Run keysystem.sql
Modify the config/config.lua to your liking
Add start loaf_keysystem to your server.cfg
Done!
Usage for resource developers
Export
Parameters
Returns
GetKeys
source: number
the user's keys (table)
GetKey
uniqueId: string
the key (table)
HasKey
source: number, keyId: string
if the user has the specified key (boolean)
RemoveKey
uniqueId: string
if the key was removed (boolean)
RemoveAllKeys
keyId: string
void
TransferKey
uniqueId, player to transfer to
if the key was transferred (boolean)
GenerateKey
source: number, keyId: string, keyLabel: string, eventtype?: string ("server" or "client"), eventname?: string
the generated key's unique id (string)
Export
Parameters
Returns
SetKeyUsage
keyId: string, cb: function
void
HasKey
keyId: string
if the player has the specified key (boolean)
GetKeys
all keys the player has (table)
GetKey
uniqueId: string
the key (table)
UseKey
uniqueId: string
void