📄Config preview
Config = {}
-- @type boolean
-- @description If true the script will print debug messages in the console.
Config.DebugMode = false
-- @type string
-- @description Which framework are you using? Only edit if auto detection doesn't work. "auto", "oldESX", "ESX", "QBCore" or "custom"
Config.Framework = "auto"
-- @type string
-- @description You only need to edit this, if you are using oldESX framework and your esx:getSharedObject trigger is different than the default one.
Config.ESXTrigger = "esx:getSharedObject"
-- @type string
-- @description The language of the script. You can find or add translations in this file.
Config.Language = "EN"
-- @type boolean
-- @description If true the script will check for updates when the resource starts.
Config.VersionCheck = true
-- @type string
-- @description The interaction type the script will use. Can be "3d" for 3D text, "ox_target" for ox_target or "qb-target" for qb-target.
Config.Target = "3d"
-- @type string
-- @description Default key for interacting with the treasure chest. Only needed if Config.Target is set to "3d"
Config.InteractKey = "E"
-- @type string
-- @description The location of your inventory images.
Config.InventoryImagesLocation = "nui://qb-inventory/html/images/" -- For ox_inventory use: "nui://ox_inventory/web/images/"
Config.NotificationTypes = {
success = "success",
error = "error",
info = "info"
}
function notify(type, msg)
-- exports['okokNotify']:Alert("Treasurechest", msg, 5000, type) --okok notify (PAID resource)
-- TriggerEvent("mosh_UI:Open", type, msg, "right", true) --Mosh UI / Notify (PAID resource)
-- exports['mythic_notify']:DoHudText(type, msg) --Mythic Notify (Free resource)
-- exports["skeexsNotify"]:TriggerNotification({ ['type'] = type, ['message'] = msg , Treasure}) --skeexsNotify (Free resource)
-- TriggerEvent('QBCore:Notify', msg, type) --Default QBCore notifcation (Free resource)
-- TriggerEvent('esx:showNotification', msg) --Default ESX notification (Free resource)
SetNotificationTextEntry("STRING")
AddTextComponentString(msg)
DrawNotification(false, true)
end
Config.Translations = {
["EN"] = {
text3D = "Treasure Chest [E]",
targetText = "Open Treasure Chest",
gotNotify = "Congratulations! You found a treasure chest and you got %s x%d",
gotLog = "%s opened a chest and found %s x%d",
},
["HU"] = {
text3D = "Kincsesláda [E]",
targetText = "Kincsesláda kinyitása",
gotNotify = "Gratulálunk! Találtál egy kincsesládát, és %d %s-t találtál.",
gotLog = "%s kinyitott egy kincsesládát, és %d %s-t talált.",
},
["DE"] = {
text3D = "Schatztruhe [E]",
targetText = "Schatztruhe öffnen",
gotNotify = "Herzlichen Glückwünsch! Du hast eine Schatztruhe gefunden und du hast %d %s bekommen",
gotLog = "%s hat eine Schatztruhe geöffnet und %d %s gefunden",
},
["FR"] = {
text3D = "Coffre au trésor [E]",
targetText = "Ouvrir le coffre au trésor",
gotNotify = "Félicitations! Vous avez trouvé un coffre au trésor et vous avez obtenu %d %s",
gotLog = "%s a ouvert un coffre et a trouvé %d %s",
},
["ES"] = {
text3D = "Cofre del tesoro [E]",
targetText = "Abrir cofre del tesoro",
gotNotify = "¡Felicidades! Has encontrado un cofre del tesoro y has conseguido %d %s",
gotLog = "%s abrió un cofre y encontró %d %s",
},
["CZ"] = {
text3D = "Truhla s pokladem [E]",
targetText = "Otevřít truhlu s pokladem",
gotNotify = "Gratulujeme! Našel jsi truhlu s pokladem a získal jsi %d %s",
gotLog = "%s otevřel truhlu a našel %d %s",
},
["PL"] = {
text3D = "Skrzynia skarbów [E]",
targetText = "Otwórz skrzynię skarbów",
gotNotify = "Gratulacje! Znalazłeś skrzynię skarbów i otrzymałeś %d %s",
gotLog = "%s otworzył skrzynię i znalazł %d %s",
},
["RO"] = {
text3D = "Cufăr cu comori [E]",
targetText = "Deschide cufărul cu comori",
gotNotify = "Felicitări! Ai găsit un cufăr cu comori și ai primit %d %s",
gotLog = "%s a deschis un cufăr și a găsit %d %s",
},
["IT"] = {
text3D = "Scrigno del tesoro [E]",
targetText = "Apri lo scrigno del tesoro",
gotNotify = "Congratulazioni! Hai trovato uno scrigno del tesoro e hai ottenuto %d %s",
gotLog = "%s ha aperto uno scrigno e ha trovato %d %s",
},
["PT"] = {
text3D = "Baú do tesouro [E]",
targetText = "Abrir baú do tesouro",
gotNotify = "Parabéns! Você encontrou um baú do tesouro e ganhou %d %s",
gotLog = "%s abriu um baú e encontrou %d %s",
},
["TR"] = {
text3D = "Hazine Sandığı [E]",
targetText = "Hazine Sandığını Aç",
gotNotify = "Tebrikler! Bir hazine sandığı buldun ve %d %s kazandın",
gotLog = "%s bir sandık açtı ve %d %s buldu",
},
["GR"] = {
text3D = "Κουτί Θησαυρού [E]",
targetText = "Άνοιγμα Κουτιού Θησαυρού",
gotNotify = "Συγχαρητήρια! Βρήκατε ένα κουτί θησαυρού και κερδίσατε %d %s",
gotLog = "%s άνοιξε ένα κουτί και βρήκε %d %s",
},
["RU"] = {
text3D = "Сундук с сокровищами [E]",
targetText = "Открыть сундук с сокровищами",
gotNotify = "Поздравляем! Вы нашли сундук с сокровищами и получили %d %s",
gotLog = "%s открыл сундук и нашел %d %s",
},
["UA"] = {
text3D = "Скарбниця [E]",
targetText = "Відкрити скарбницю",
gotNotify = "Вітаємо! Ви знайшли скарбницю і отримали %d %s",
gotLog = "%s відкрив скарбницю і знайшов %d %s",
},
["CN"] = {
text3D = "宝箱 [E]",
targetText = "打开宝箱",
gotNotify = "恭喜!你找到一个宝箱,你获得了 %d %s",
gotLog = "%s 打开了一个宝箱,找到了 %d %s",
},
["JP"] = {
text3D = "宝箱 [E]",
targetText = "宝箱を開ける",
gotNotify = "おめでとうございます!宝箱を見つけました。%d %s を手に入れました。",
gotLog = "%s が宝箱を開けて %d %s を見つけました。",
},
["KR"] = {
text3D = "보물 상자 [E]",
targetText = "보물 상자 열기",
gotNotify = "축하합니다! 보물 상자를 찾았고 %d %s 를 얻었습니다.",
gotLog = "%s 가 상자를 열고 %d %s 를 찾았습니다.",
},
["TH"] = {
text3D = "หีบสมบัติ [E]",
targetText = "เปิดหีบสมบัติ",
gotNotify = "ขอแสดงความยินดี! คุณพบหีบสมบัติและได้รับ %d %s",
gotLog = "%s เปิดหีบและพบ %d %s",
},
["VI"] = {
text3D = "Rương kho báu [E]",
targetText = "Mở rương kho báu",
gotNotify = "Chúc mừng! Bạn đã tìm thấy một rương kho báu và nhận được %d %s",
gotLog = "%s đã mở một rương và tìm thấy %d %s",
},
["ID"] = {
text3D = "Petik Harta Karun [E]",
targetText = "Buka Peti Harta Karun",
gotNotify = "Selamat! Kamu menemukan peti harta karun dan mendapatkan %d %s",
gotLog = "%s membuka peti dan menemukan %d %s",
},
["FA"] = {
text3D = "صندوق گنج [E]",
targetText = "باز کردن صندوق گنج",
gotNotify = "تبریک! شما یک صندوق گنج پیدا کردید و %d %s دریافت کردید",
gotLog = "%s یک صندوق را باز کرد و %d %s پیدا کرد",
},
["AR"] = {
text3D = "صندوق الكنز [E]",
targetText = "افتح صندوق الكنز",
gotNotify = "تهانينا! لقد وجدت صندوق كنز وحصلت على %d %s",
gotLog = "%s فتح صندوقًا ووجد %d %s",
},
["HI"] = {
text3D = "खजाने का संदूक [E]",
targetText = "खजाने का संदूक खोलें",
gotNotify = "बधाई हो! आपको एक खजाने का संदूक मिला है और आपको %d %s मिला है",
gotLog = "%s ने एक संदूक खोला और %d %s पाया",
},
["MS"] = {
text3D = "Petak Harta Karun [E]",
targetText = "Buka Peti Harta Karun",
gotNotify = "Tahniah! Anda telah menemui peti harta karun dan anda mendapat %d %s",
gotLog = "%s membuka peti dan menemui %d %s",
},
["NL"] = {
text3D = "Schatkist [E]",
targetText = "Open Schatkist",
gotNotify = "Gefeliciteerd! Je hebt een schatkist gevonden en je hebt %d %s gekregen",
gotLog = "%s heeft een kist geopend en %d %s gevonden",
},
["SV"] = {
text3D = "Skattkista [E]",
targetText = "Öppna Skattkista",
gotNotify = "Grattis! Du hittade en skattkista och du fick %d %s",
gotLog = "%s öppnade en kista och hittade %d %s",
}
}
SConfig = {}
-- @type string
-- @description Your discord webhook where the logs will be sent
SConfig.discord = "YOUR_DISCORD_WEBHOOK_HERE"
-- @type table
-- @description Any item you want to be winnible by players. Type can be "item", "weapon", "money" or "vehicle" Chance 1-100 (1 = 1% chance, 100 = 100% chance)
SConfig.Winnables = {
{type = "item", name = "binoculars", label = "Binoculars", amount = 5, chance = 15},
{type = "item", name = "bandage", label = "Bandage", amount = 3, chance = 15},
{type = "weapon", name = "WEAPON_PISTOL", label = "Pistol", amount = 1, chance = 5},
{type = "money", name = "money", label = "Money", amount = math.random(5000, 8000), chance = 40},
{type = "money", name = "money", label = "Money", amount = math.random(8000, 10000), chance = 20},
{type = "vehicle", name = "cheburek", label = "Cheburek", amount = 1, chance = 3}
}
-- @description Function to give vehicle to player. This function supports ESX and QBCore by default. It's only made public because almost every garage system has different database structure.
function giveVehicle(player, vehicleName, Framework)
if Framework == "ESX" or Framework == "oldESX" then
local xPlayer = ESX.GetPlayerFromId(player)
local plate = genPlate()
MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle, type, job) VALUES (@owner, @plate, @vehicle, @type, @job)', {
['@owner'] = xPlayer.identifier,
['@plate'] = plate,
['@vehicle'] = json.encode({model = vehicleName}),
['@type'] = 'car',
['@job'] = 'all'
}, function(rowsChanged)
if rowsChanged == 0 then
errorPrint("Failed to give vehicle to player: " .. GetPlayerName(player))
end
end)
elseif Framework == "QBCore" then
local Player = QBCore.Functions.GetPlayer(player)
local plate = genPlate()
MySQL.Async.execute('INSERT INTO player_vehicles (license, citizenid, plate, vehicle, hash, garage, mods) VALUES (@license, @citizenid, @plate, @vehicle, @hash, @garage, @mods)', {
['@license'] = GetPlayerIdentifierByType(player, 'license'),
['@citizenid'] = Player.PlayerData.citizenid,
['@plate'] = plate,
['@vehicle'] = vehicleName,
['@hash'] = GetHashKey(vehicleName),
['@garage'] = 'pillboxgarage',
['@mods'] = '{}'
}, function(rowsChanged)
if rowsChanged == 0 then
errorPrint("Failed to give vehicle to player: " .. GetPlayerName(player))
end
end)
else
--If you are using a custom framework you can add your vehicle giving method here
warnPrint("Vehicle giving not implemented for custom framework. Make sure to edit the giveVehicle function in sconfig.lua")
end
end
-- @description Only needed if you are using custom framework
function customItemCheck(player, itemName)
-- You can add your custom item check method here if you are using a custom framework.
warnPrint("Key check not implemented for custom framework. Make sure to edit the customItemCheck function in sconfig.lua")
local hasItem = true
return hasItem
end
-- @description Only needed if you are using custom framework
function customAddItem(player, itemName, amount)
-- You can add your custom item giving method here if you are using a custom framework.
warnPrint("Item giving not implemented for custom framework. Make sure to edit the customAddItem function in sconfig.lua")
end
-- @description Only needed if you are using custom framework
function customAddWeapon(player, weaponName, amount)
-- You can add your custom weapon giving method here if you are using a custom framework.
warnPrint("Weapon giving not implemented for custom framework. Make sure to edit the customAddWeapon function in sconfig.lua")
end
-- @description Only needed if you are using custom framework
function customAddMoney(player, amount)
-- You can add your custom money giving method here if you are using a custom framework.
warnPrint("Money giving not implemented for custom framework. Make sure to edit the customAddMoney function in sconfig.lua")
end
-- @type table
-- @description The locations of the treasure chests and their model.
-- @param x The x coordinate of the treasure chest
-- @param y The y coordinate of the treasure chest
-- @param z The z coordinate of the treasure chest
-- @param model The model of the treasure chest
-- @param key The item name what the player needs to have to open a chest. If nil then no key is needed.
-- @param del If true the chest will be deleted when opened. If false then it will stay but can't be opened again while refill time isn't over
-- @param refill How much time player need to wait to open a chest again (in minute). Only needed if del = false
-- @param respawn How much time (in minute) need to pass until the chest will respawn. Only needed if del = true
-- @param dist The distance the player need to be to open the chest
SConfig.Treasures = {
{x = 499.63, y = 5607.63, z = 795.67, model = "xm_prop_x17_chest_closed", key = "treasurekey", del = true, refill = 3, respawn = 3, dist = 2.0}, --1
{x = 455.46, y = -839.52, z = 26.65, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --2
{x = -336.02, y = -958.33, z = 30.61, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --3
{x = 694.34, y = 551.54, z = 128.05, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --4
{x = -1577.89, y = -970.92, z = 16.41, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --5
{x = -1888.38, y = -582.74, z = 10.83, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --6
{x = -2293.29, y = 209.6, z = 166.6, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --7
{x = -1350.04, y = 21.74, z = 52.45, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --8
{x = 3604.26, y = 3736.03, z = 27.69, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --9
{x = 2136.27, y = 4831.88, z = 40.64, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --10
{x = 1710.66, y = 3611.14, z = 34.09, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --11
{x = 781.72, y = -3187.66, z = 5.09, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --12
{x = 153.92, y = -3108.18, z = 4.9, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --13
{x = -347.7, y = -1862.19, z = 27.66, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --14
{x = 185.13, y = -730.53, z = 46.08, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --15
{x = 2654.32, y = 1425.1, z = 23.52, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --16
{x = 2563.98, y = 2587.49, z = 37.08, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --17
{x = 2949.65, y = 2741.14, z = 43.03, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --18
{x = 1910.55, y = 3283.843, z = 43.56, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --19
{x = 67.15, y = 3655.69, z = 38.67, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --20
{x = -2297.51, y = 3191.1, z = 31.81, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --21
{x = 170.62, y = -908.9, z = 29.69, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --22
{x = 677.86, y = 686.74, z = 129.46, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --23
{x = 5.48, y = -1386.95, z = 29.29, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --24
{x = 857.48, y = -948.71, z = 25.28, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --25
{x = 1665.19, y = 0.73, z = 165.12, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --26
{x = -90.29, y = -1010.4, z = 26.31, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --27
{x = 2520.47, y = 2621.87, z = 36.94, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --28
{x = 1201.26, y = 2656.5, z = 36.85, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --29
{x = -2349.48, y = 2815.32, z = 0.71, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --30
{x = 37.21, y = 6555.49, z = 30.45, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --31
{x = -927.89, y = 6148.93, z = 4.56, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --32
{x = -1280.2, y = 2553.37, z = 17.39, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --33
{x = -2472.78, y = 2305.78, z = 31.01, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --34
{x = -1663.54, y = -292.07, z = 50.88, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --35
{x = 1077.88, y = -750.55, z = 56.97, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --36
{x = -1428.16, y = -420.71, z = 35.36, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --37
{x = -2115.73, y = -316.28, z = 12.59, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --38
{x = -769.33, y = -931.08, z = 17.07, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --39
{x = -221.0, y = -1498.05, z = 30.61, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --40
{x = 244.14, y = -1273.74, z = 28.44, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --41
{x = 1789.34, y = -1541.54, z = 112.26, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --42
{x = 1282.99, y = -725.94, z = 63.49, model = "xm_prop_x17_chest_closed", key = nil, del = true, refill = 3, respawn = 3, dist = 2.0}, --43
}
Last updated