server/common.lua

๐Ÿ‡ซ๐Ÿ‡ท Ici, vous allez ajouter les jobs2 et les charger dans votre serveur.

๐Ÿ‡บ๐Ÿ‡ธ Here, you will add the jobs2 and load them into your server.

  • ๐Ÿ‡ซ๐Ÿ‡ท Au dรฉbut de votre fichier, vous avez ceci:

  • ๐Ÿ‡บ๐Ÿ‡ธ At the beginning of your file, you have this:

ESX.Players = {}
ESX.Jobs = {}
ESX.Items = {}
  • ๐Ÿ‡ซ๐Ÿ‡ท En dessous de ESX.Jobs, ajoutez ceci:

  • ๐Ÿ‡บ๐Ÿ‡ธ Below ESX.Jobs, add this:

ESX.Jobs2 = {}
  • ๐Ÿ‡ซ๐Ÿ‡ท Cherchez la fonction MySQL.ready(function()

  • ๐Ÿ‡บ๐Ÿ‡ธ Find the function MySQL.ready(function()

    • ๐Ÿ‡ซ๐Ÿ‡ท Puis, remplacez la fonction entiรจre par celle-ci:

    • ๐Ÿ‡บ๐Ÿ‡ธ Then, replace the entire function with this one:

MySQL.ready(function()
    Core.DatabaseConnected = true
    if not Config.CustomInventory then
        local items = MySQL.query.await("SELECT * FROM items")
        for _, v in ipairs(items) do
            ESX.Items[v.name] = { label = v.label, weight = v.weight, rare = v.rare, canRemove = v.can_remove }
        end
    end

    ESX.RefreshJobs()
    ESX.RefreshJobs2()

    print(("[^2INFO^7] ESX ^5Legacy %s^0 initialized! ^7(^2Version job2 by FW Scripts^7)^0"):format(GetResourceMetadata(GetCurrentResourceName(), "version", 0)))

    StartDBSync()
    if Config.EnablePaycheck then
        StartPayCheck()
    end
end)

Last updated