QBCore

Installation guide

Download Resource

You will receive the script in keymaster.fivem.net profile, after this click in blue "download" button.

After download, put the script in your server files.

Remeber:

You need to be logged with the same cfx.re account you used to buy in my tebex store.

Dependencies Part

Download all the scripts by clicking on their respective names, put them in the server files and start server.cfg

Stash Logs Part:

Open your inventory - server - main.lua Line 598 and add this under:

local src = source
local Player = QBCore.Functions.GetPlayer(src)
local nomejogador = Player.PlayerData.charinfo.firstname.." "..Player.PlayerData.charinfo.lastname
TriggerEvent("jpr-crewsystem:server:adicionarlog", "The item: <b>"..ItemData.label.."</b> has add by: <b>"..nomejogador.."</b> count: <b>"..amount.."x</b>","1", src)

Line 667 and add this under:


local src = source
local Player = QBCore.Functions.GetPlayer(src)
local ItemData = QBCore.Shared.Items[itemName]

local nomejogador = Player.PlayerData.charinfo.firstname.." "..Player.PlayerData.charinfo.lastname
TriggerEvent("jpr-crewsystem:server:adicionarlog", "The item: <b>"..ItemData.label.."</b> has taken by: <b>"..nomejogador.."</b> count: <b>"..amount.."x</b>","0", src)

If you skip this you will not have stash logs working

If you have jpr-inventory you can skip this

Stash Images

To add stash images open: jpr-crewsystem - html - img - items

Here you can add your own images to your items

Level system triggers

To incorporate level system with your custom scripts follow this steps: To remove level: TriggerServerEvent("jpr-crewsystem:server:tirarnivel", here put crew name, here amount of xp to remove) To add level: TriggerServerEvent("jpr-crewsystem:server:darnivel", here put crew name, here amount of xp to add)

Sync with garage script

This step serves to synchronize the vehicles taken from the garage with the vehicles taken from the crew system garage, i will do a example with qb-garages:

Qb-Garages / server / main.lua Find: qb-garage:server:spawnvehicle

Add this inside the callback: TriggerEvent("jpr-crewsystem:server:atualizargaragemcrew", plate, veh) In the end of file, add this little code: RegisterServerEvent('jpr-crewsystem:server:atualizargaragem') AddEventHandler('jpr-crewsystem:server:atualizargaragem', function(plate, veh) if (plate ~= nil and veh ~= nil) then local netId = NetworkGetNetworkIdFromEntity(veh) OutsideVehicles[plate] = {netID = netId, entity = veh} end end)

JPR - Garages buyers can skip this.

This is optional for those who want only one same vehicle running on the server, otherwise you can skip it.

To be compatible with IlleniumAppearance

Open config.lua and set Config.UseIlleniumAppearance = true

Open IlleniumAppearance resource / server / database / playeroutfits and find:

function Database.PlayerOutfits.Add(citizenID, outfitName, model, components, props)
   return MySQL.insert.await("INSERT INTO player_outfits (citizenid, outfitname, model, components, props) VALUES (?, ?, ?, ?, ?)", {
        citizenID,
        outfitName,
        model,
        components,
        props
    })
end

Replace to:

local QBCore                  = exports[----- HERE PUT YOUR CORE NAME ----]:GetCoreObject()
function Database.PlayerOutfits.Add(citizenID, outfitName, model, components, props)
   return MySQL.insert.await("INSERT INTO player_outfits (citizenid, outfitname, model, components, props, outfitId) VALUES (?, ?, ?, ?, ?, ?)", {
        citizenID,
        outfitName,
        model,
        components,
        props,
	"outfit-"..QBCore.Shared.RandomInt(1).."-"..QBCore.Shared.RandomInt(6),
    })
end

SQL

Only need to execute SQL file attached to crewsystem folder.

This is mandatory to avoid errors

Config.lua

Setup all config.lua to your needs, read all comments in green color to be more easier.

You are good to go! Any question open a ticket in my discord server.

Last updated