T1GER Library
Documentation, troubleshooting and support for T1GER Library
Note
This resource will be used in all T1GER resources as a dependency. The main purpose of the library is to add configurable support between frameworks, inventories, target systems and etc. for the gameplay resources. All options must be set in config.lua
.
Do not edit/customize functions if you have no knowledge of LUA and FiveM Coding!
Get Player/Owned Vehicles
This is a function to retrieve all owned vehicles for a player. This function will be used throughout T1GER resources. According to what columns you have in your owned_vehicles or player_vehicles table, you might need to update something inside the function.
Navigate to
t1ger_lib/server/framework.lua
.Find the function named:
GetAllVehicles
.You should see a
table.insert()
function containing the keys and values below:
Do not alter the key name, as these key names are used throughout the resources and may break them!
You can alter the values starting with results[i] if your table columns are named something else. Look below for examples.
Example #1: garage column is named t1ger_garage
.
Example #2: stored column is named parked
.
Update Owned Vehicle
This is a function to update owned vehicle, when the respective vehicle is either spawned or stored from/in a garage. According to what columns you have in your owned_vehicles
or player_vehicles
table, you might need to update something inside the function.
Navigate to
t1ger_lib/server/framework.lua
.Find the function named:
UpdateOwnedVehicle
.Do not edit the
'@'
but only the value before the"="
, as it's the exact column-name from your database table.Please read the end-line comments for brief information on the edits you are about to do.
Start with updating the SQL string to your server's preferences:
is it the correct table?
is your stored state called:
'stored'
,'state'
,'parked'
or something else?do you even have a
'garage'
or'parked'
column, if not delete it from the SQL string. If you have it, then make sure to name it the same as your table column.are you using
'vehicle'
,'mods'
or something else for vehicle properties? If so, update it!
After updating the SQL, make sure to update the keys & values inside the MySQL call. Only do this if you've added/removed keys from the SQL string.
That's it - you are now all set.
Please note; if your database column for stored uses other value than boolean, then you need to re-code the true/false to return INT or whatever it may be.
Notifications
You should see a
table.insert()
function containing the keys and values below:
Set the config option UseFrameworkNotification
to either true
or false
. If true, the system will use default ESX or QB notifications. If false, by default it will use ox notifications. Inside utils, you can easily customize/change to your own notification system.
Throughout the gameplay resources, all notification messages will be sent as a table with title, message and type. Integration of your own notifcation system won't get any easier.
If you want to parse more data through the notification, then you'd have to find the specific notification in the gameplay resource and add your extra values.
Create Vehicle Meta
You can use this server sided export to create vehicle meta on spawned vehicles in run-time.
The vehicle must be added to the database as an owned vehicle, when using this.
Parameters:
plate(string): the plate string of the vehicle to create metadata for.
src(int): the player handle (player server id)
EXAMPLE #1
This example will make sure that when /admincar
command is used in qb-core
, the vehicle in question will have metadata created and synced.
Utils
Inside the utils.lua you'll find various functions. Feel free to use these in your resources as you please.
Last updated