BRIDGE
Bridged Frameworks
For frameworks set up in the bridge folder, such as QBCore and ESX (es_extended), this script serves as a direct replacement for their default login scripts. Therefore, you need to remove the following scripts to avoid conflicts.
ESX: esx_identity QBCore: qb-multicharacter
Adding more frameworks
Expanding support for additional frameworks is relatively straightforward! As long as you have a basic understanding of what you're doing, it can be done quite easily.
Overrides
In rat-login, the Override function is utilized to replace existing functions with the ones you define.
Here's an example of how an Override function is used to help you understand its implementation:
Server
GetIdentifier
source : number
string
OnSelect
source : number
identifier : string
cleanup : function
nil
OnDelete
source : number
identifier : string
reload : function
nil
OnCreate
source : number
charData: table
cleanup : function
nil
OnOpenLogin
source : number
nil
OnCloseLogin
source : number
nil
Client
SetSkin
ped : number / entity skin : table
nil
SetWeatherOverride
state
nil
Argument Functions
These functions require no parameters.
reload
call reload when you want to reload the players characters
cleanup
call cleanup when you want to close the login menu
Character Data Layout / charData
Example
In this example we'll use a framework called rat
Bridged Skin Scripts
For external third-party skin scripts, you are required to register a callback function inside the bridge/skin.lua file. Below is an example code snippet.
Now, let's say we want to add support for a skin script called rat-skin. It could look something like this:
Now that we've defined the function, all we need to do is let the script know we want to use it! Inside the config.lua file, find the line Config.SkinScript and set it as follows:
Notice how the name we've set inside the config.lua file matches what we defined in bridge/skin.lua.
Last updated