# Welcome!

## Hi there!

\
**You can find answers here for you questions about our resources.**


# Installation

1. Copy mester\_treasurechest to your resources
2. Configure everything in config.lua and sconfig.lua to your needs (You can find a descriptions for all the options inside the config files)
3. Add this line to your server.cfg (Make sure it's under framework)

   ```lua
   ensure mester_treasurechest
   ```


# Config preview

```lua
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",
	}
}
```

```lua
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
}
```


# Installation

1. Copy mester\_newplayer to your resources
2. Configure everything in Config.lua to your needs (You can find a descriptions for all the options inside the Config.lua)
3. Add this line to your server.cfg (Make sure it's under oxmysql/mysql-async and under framework if Config.Framework isn't set to "none")&#x20;

   ```lua
   start mester_newplayer
   ```


# Events, exports, snippets

* Event to manually make the resource check the player's play time and add/remove new player mode if needed.&#x20;

  ```lua
  TriggerServerEvent("mester_newplayerCheck")
  ```
* Export to manually remove new player mode, from a specified player.

  ```lua
  --@type res boolean
  --@type err string
  local res, err = exports["mester_newplayer"]:removeNewPlayer(playerId)
  ```
* Export to get remaining minutes of new player mode, for the specified player.

  ```lua
  --@type mins int, boolean
  --@type err string
  local mins, err = exports["mester_newplayer"]:getNewMinutes(playerId)
  ```


# Config preview

````lua
```lua
Config = {}

--Opciók: legacy; oldesx; qbcore; none (Ha none-t választod akkor a CreateItems funkció nem lesz elérhető)
Config.Framework = "none" --Options: esx; oldesx; qbcore; none (If you choose none then CreateItems will be disabled) 

Config.Language = "EN" --Options: EN; HU; DE

--Állítsd át true-ra ha szeretnéd, hogy a script kiírja a debug üzeneteket a konzolba.
Config.DebugMode = false --Set to true if you want to enable debug mode. This will print debug messages in the console.

--Ezzel csak akkor kell foglalkzoni ha régi esx-et használsz
Config.ESXtrigger = "esx:getSharedObject" --You only need to care about the trigger if you have have old esx

--Az sql tábla neve ahova a játékosok mentve vannak.
Config.UsersTable = "users" --SQL table where the player's are saved.

--Ezzel tudod beállítani, hogy melyik azonosító típust használod a játékosok azonosítására. (license, steam, xbl, live, discord, fivem, ip)
Config.UserIdentifierType = "license" --The identifier type that you want to use to identify the player. (license, steam, xbl, live, discord, fivem, ip)

--Ezzel tudod beállítani, hogy melyik oszlopban van az azonosító a fentebb megadott táblában.
Config.UsersTableIdentifierColumn = "license" --The column name where the identifier is stored in the table above.

--Ezzel tudod beállítani, hogy használsz-e multichar rendszert. Ha igen, akkor true-ra állítsd.
Config.UsingMultiChar = false --Set to true if you are using a multi character system

--Ezzel tudod beállítani, hogy legyen-e levágva az azonosító elejéről az azonoító típusa.
Config.GsubIdentifier = true --Set to false if you don't want to use gsub to get the identifier from the string. So set it to false if you have idientifier like this: license:1234567890

--Állítsd falre-ra ha nem szeretnéd, hogy a reource ellenőrizze, hogy van-e új verzió
Config.VersionCheck = true --Set to false if you don't want to check for updates

--Ide add meg, hogy meddig legyen új játékos módban a játékos (perc)
Config.NewPlayerUntil = 60 --Set how long the player should be in new player mode (minutes)

--Itt add meg, hogy mennyire legyen átlátszó a játékos mikor új játékos módban van. (0-254)
Config.NewPlayerAlpha = 128 --Set the alpha of the player when he is in new player mode (0-254)

--Állítsd át false-ra ha nem szeretnél értesítéseket arról, hogy mennyi idő van hátra
Config.EnableNotifications = false --Set to false if you don't want notifications about how much time is left

--Állítsd át false-ra ha nem szeretnéd, hogy legyen visszaszámláló a játékosok kijelzőjén mikor új játékos módban vannak
Config.EnableCountdownUI = true --Set to false if you don't want to have a countdown UI on players screen when they are in new player mode

--Állítsd át ftrue-ra ha szeretnéd, hogy a játékosokat értesítse a script, ha lejárt az új játékos mód
Config.NewPlayerModeExpiredNotify = false --Set it to true if you want to notify the player when the new player mode is over

--Állítsd át false-ra ha nem szeretnéd, hogy a script itemeketet hozzon létre
Config.CreateItems = false --Set it to false if you don't want to create script create usable items

--Itt add meg az itemek neveit (Ha a Config.CreateItem false-ra van állítva akkor nem kell ezzel foglalkoznod.)
Config.Items = { --Set the items name here (If you have Config.CreateItem on false then you don't have to do anything with this.)
    "onehouritem",
    "twohoursitem",
    "threehoursitem"
}

--Itt add meg, hogy az itemeknek mennyi ideig legyen hatásuk (A SaveCount itt is ugyan azt jelenti, mint fentebb a Config.SaveCount) [Ha a Config.CreateItem false-ra van állítva akkor nem kell ezzel foglalkoznod.]
Config.ItemSaveCount = { --Specify here how long the items should have an effect (SaveCount here also means the same as Config.SaveCount above) [If you have Config.CreateItem on false then you don't have to do anything with this.]
    onehouritem = { Time = 60 },
    twohoursitem = { Time = 120 },
    threehoursitem = { Time = 180 },
}

--Itt add meg, hogy milyen paranccsal lehessen új elvenni egy adott játékostól. Használata: /removenewmode [ID]
Config.RemoveNewPlayerModeCommand = "removenewmode" --Set the command here to remove new player mode from a player. Usage: /removenewmode [ID]

--Itt add meg, hogy milyen admin csoportok tudják használni a fentebb megadott parancsot.
Config.AdminGroups = { --Set the admin groups here. The players in these groups can use the command above.
    "admin"
}

--Értesítési beálíltások:
--Notification settings:

RegisterNetEvent("mester_newplayernotify")
AddEventHandler("mester_newplayernotify", function(type, msg)
    --Alapértelmezett, egyedülálló értesítés
    --STANDALONE NOTIFICATION
    BeginTextCommandThefeedPost("STRING")
    AddTextComponentSubstringPlayerName(msg)
    EndTextCommandThefeedPostTicker(true, true)
--TÖRÖLD KI, HA EGY MÁSIK TÍPUSÚ ÉRTESÍTÉST SZERETNÉL HASZNÁLNI
--DELETE THIS IF YOU WANT TO USE AN ANOTHER TYPE OF NOTIFICATION

-----------------------------------------PÉLDÁK-----------------------------------------------
-----------------------------------------EXAMPLES---------------------------------------------
--exports['okokNotify']:Alert("New Player Mode", msg, 3000, 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 }) --skeexsNotify (Free resource)
--TriggerEvent('QBCore:Notify', msg, type) --Default QBCore notifcation (Free resource - QB-Core)
--TriggerEvent('esx:showNotification', msg) --Default ESX notification (Free resource -ESX)
----------------------------------------------------------------------------------------------
end)

--Ne töröld ezt a funkciót
function NewModeStarted() --Do not delete this function
    --IDE ADD MEG, HOGY MIT SZERETNÉL CSINÁLNI MIKOR ELINDULT AZ ÚJ JÁTÉKOS MÓD (Nem kötelező)
    --ADD HERE WHAT YOU WANT TO DO WHEN THE NEW PLAYER MODE STARTED (Not required)
end

--Ne töröld ezt a funkciót
function NewModeEnded() --Do not delete this function
    --IDE ADD MEG, HOGY MIT SZERETNÉL CSINÁLNI MIKOR LEJÁRT AZ ÚJ JÁTÉKOS MÓD (Nem kötelező)
    --ADD HERE WHAT YOU WANT TO DO WHEN THE NEW PLAYER MODE ENDED (Not required)
end

--Értesítés típúsa:
--Notification type:
Config.NotificationType = "WARNING"

--Fordítások:
Config.Translations = { --Translations
    ["EN"] = {
        NewPlayerUntil = "New player mode expires after: %s minutes",
        NewPlayerUntilUI = "New player protection active",
        HoursUI = "Hours",
        MinutesUI = "Minutes",
        SecondsUI = "Seconds",
        NewPlayerModeExpired = "New player mode has expired!",
    },

    ["HU"] = {
        NewPlayerUntil = "Új játékos mód lejár: %s perc múlva",
        NewPlayerUntilUI = "Új játékos védelem aktív",
        HoursUI = "Óra",
        MinutesUI = "Perc",
        SecondsUI = "Másodperc",
        NewPlayerModeExpired = "Az új játékos mód lejárt!",
    },

    ["DE"] = {
        NewPlayerUntil = "Neuer Spielermodus läuft ab: %s Minuten",
        NewPlayerUntilUI = "Neuer Spielermodus aktiv",
        HoursUI = "Stunden",
        MinutesUI = "Minuten",
        SecondsUI = "Sekunden",
        NewPlayerModeExpired = "Der neue Spielermodus ist abgelaufen!",
    },
}
```
````


# Installation

1. Copy mester\_tobaccorobbery to your resources
2. Configure everything in Config.lua to your needs (You can find a descriptions for all the options inside the Config.lua)
3. Add this line to your server.cfg (Make sure it's under framework if Config.Framework isn't set to "STANDALONE")

   ```lua
   start mester_tobaccorobbery
   ```


# Config preview

````lua
```lua
Config = {}

--Opciók: STANDALONE; CUSTOM; ESX; QBCORE !STANDALONE verzióban a rendőrséggel, GPS Blippel és pénzzel kapcsolatos funckiók nem működnek!
Config.Framework = "ESX" --Options: STANDALONE; CUSTOM; ESX; QBCORE !In the STANDALONE version, the police, GPS blip and money related functions do not work!
--Optionen: STANDALONE; CUSTOM; ESX; QBCORE !In der STANDALONE-Version funktionieren die Funktionen für Polizei, GPS blip und Geld nicht!

--Állítsd true-ra ha ESX 1.8.5 vagy annál újabb verziójú ESX-et használsz
Config.UseESXExport = true --Set it true if you are using ESX 1.8.5 or newer ESX edition
--auf true umstellen, wenn Sie ESX 1.8.5 oder höher verwenden

--Ezzel csak akkor kell foglalkzoni ha esx-et használsz
Config.ESXtrigger = "esx:getSharedObject" --You only need to care about the trigger if you are using esx
--Dies ist nur erforderlich, wenn Sie esx verwenden.

--A ServerConfig.lua fáljban tudod beállítani a discord webhookot a logokhoz
--You can set the discord webhook for logging in ServerConfig.lua
--Im Thread ServerConfig.lua können Sie den Discord-Webhook für die Logs konfigurieren

--Állítsd át false-ra ha nem szeretnéd, hogy logolva legyen discrodra mikor a script elindul
Config.ScriptStartedLog = true --Set it false if you don't want notifications trough discrod when the script has started
--Schalten Sie auf false um, wenn Sie nicht wollen, dass das Skript in discrodra angemeldet wird, wenn es startet

--Állítsd át false-ra ha nem szeretnéd, hogy a script logokat küldjön
Config.LogToDiscord = true --Set it false if you don't want the script to send logs
--Schalten Sie auf false um, wenn das Skript keine Protokolle senden soll.

--A játékos csak akkor tudja elindítani a rablást ha van minimum annyi elérhető rendőr a szerveren, mint amennyi be van állítva
Config.MinCops = 0 --Player can only start the robbery if the server has the minimum number of cops online
--Der Spieler kann einen Raubüberfall nur beginnen, wenn mindestens so viele Polizeibeamte auf dem Server verfügbar sind, wie eingestellt sind

--Itt állítsd be a rendvédelmi frakcióid setjob-ját, hogy a script ellenőrizhesse hányan érhetőek el.
Config.PoliceJobs = { --Set your law enforcement jobs here
    "police",
    "sheriff"
}--Hier stellen Sie den Setjob Ihrer Strafverfolgungsfraktionen ein, damit das Skript prüfen kann, wie viele verfügbar sind.

--Itt állítsd be, hogy melyik munka lássa, hogy merre tart a rabló a dobozzal.
Config.SeeGPSJobs = { --Here you can set which job sees where the robber is going with the box.
    "police",
    "sheriff"
}--Hier können Sie einstellen, welche Stelle sieht, wohin der Räuber mit der Kiste geht.

--Állítsd át false-ra ha nem szeretnéd, hogy a beállított munkák lássák-e a GPS jelét a doboznak
Config.EnableGPS = true --Set it to false if you don't want the configured jobs to see the GPS signal in the box
--Setzen Sie diese Option auf false, wenn Sie nicht möchten, dass die konfigurierten Fraktionen das GPS-Signal in der Box sehen

--Állítsd át false-ra ha nem szeretnéd, hogy legyen lehetősége más játékosoknak is leadni a dobozt
Config.EnablePlayerPirating = true ----Set to false if you don't want other players to have the opportunity to drop the box
--Schalten Sie auf false um, wenn Sie nicht wollen, dass andere Spieler die Möglichkeit haben, die Box fallen zu lassen.

--Itt tudod beállítani, hogy a GPS pozíciója milyen gyakorisággal frissüljön
Config.GPSBlipUpdateTime = 1000 --Here you can set the frequency with which the GPS position is updated
--Hier können Sie die Häufigkeit der Aktualisierung der GPS-Position einstellen

--Milyen távolságból induljon el a rablás
Config.StartRobberyDistance = 70 --From what distance should the robbery start
--Aus welcher Entfernung sollte der Raubüberfall beginnen?

--Itt állítsd be az NPC-k PED-jét azaz kinézetét
Config.NPCPed = "a_m_m_hillbilly_02" --Set here the NPCs PED
--Hier kannst du die PED der NPCs einstellen

--Itt állítsd be, hogy milyen fegyvert használjanak a területet védő NPC-k
Config.NPCWeapon = "WEAPON_ASSAULTRIFLE" --Set NPCs weapon here
--die Waffe so einstellen, dass sie von den NPCs, die das Gebiet verteidigen, verwendet wird

--Itt állítsd be, hogy milyen pontosan lőjjenek az NPC-k
Config.NPCsAccuracy = 65 --Set here the NPCs AIM accuracy
--Hier kannst du einstellen, wie genau NPCs schießen sollen

--Armor beállítása az NPC-k számára
Config.NPCArmor = 100 --Set armor for NPC-s
--Rüstungseinstellung für NPCs

--Állítsd át true-ra ha szeretnéd, hogy felvehetőek legyenek az NPC-k álltal eldobott fegyverek
Config.NPCDropWeapon = false --Set it true if you want to enable NPC weapon dropping
--Schalter auf true, wenn du in der Lage sein willst, von NPCs fallen gelassene Waffen aufzusammeln

--A kordináták ahova a fegyveres NPC-k spawnolnak. Nyugodtan adhatsz hozzá vagy vehetsz el belőle
Config.NPCCoords = { --The cordinates where armed NPCs spawn. Feel free to add or take away
	vector4(2195.0818, 5594.5767, 53.7629, 352.3398),
	vector4(2192.1260, 5597.5127, 53.7450, 332.8905),
	vector4(2198.0361, 5607.2725, 53.4087, 341.4773),
	vector4(2194.5884, 5610.0454, 53.6820, 346.2193),
	vector4(2203.5771, 5613.0186, 53.8731, 337.3759),
	vector4(2193.2417, 5614.1548, 54.2544, 296.4668),
	vector4(2220.7170, 5614.5181, 54.7207, 105.2955),
	vector4(2203.5313, 5604.8901, 53.7657, 337.2006),
	vector4(2199.4900, 5586.8950, 53.7349, 266.0378),
	vector4(2221.5581, 5591.6284, 53.9017, 42.9724)
} --die Koordinaten, an denen bewaffnete NSCs spawnen. Sie können gerne etwas hinzufügen oder wegnehmen

--A halom kordinátája
Config.PileCoords = vector3(2194.85, 5601.8452, 53.4057) --The Coords for the the pile
--Die Koordinaten für den Stapel

--Pénzrakás iránya
Config.PileHeading = 247.6770 --The heading of the pile
--Die Überschrift des Stapels

--Mit gyűjtsön be a játékos (cash, coke, marijuana, weed, gold)
Config.PileObject = "weed" --What to collect (cash, coke, marijuana, weed, gold)
--Was zu sammeln ist (Bargeld, Koks, Marihuana, Gras, Gold)

--Mit adjon a halom (Ez vagy money kell legyen vagy item név)
Config.PileGive = "weed" --What to give the pile (It must be either money or item name)
--Was dem Stapel hinzugefügt werden soll (es muss entweder Geld oder der Name des Gegenstands sein)

--Mennyit adjon a halom
Config.PileGiveAmount = math.random(10, 15) --How much the pile gives
--Wie viel soll man dem Stapels geben

--Annak a doboznak a koordinátája amit el kell lopni
Config.BoxCoords = vector3(2191.3567, 5599.4639, 53.7) --The coords of the box that you need to steal
--die Koordinaten der zu stehlenden Box

--A kordináták ahol eladod a dobozba csomagolt terméket
Config.SellCoords = vector3(1220.8243, -3005.4119, 4.8654) --The Coords where you sell the tobacco
--das Kordon, in dem Sie das in der Schachtel verpackte Produkt verkaufen

--Merre nézzen az eladás területén álló NPC
Config.SellNPCHeading = 93.1160 --NPC heading
--Wo soll der NPC im Verkaufsbereich hinschauen

--Az NPC ami az aladás területén áll
Config.SellNPC = "a_m_y_smartcaspat_01" --The NPC that standing in the selling point
--der NPC, der sich im Sendebereich befindet

--Mennyit kapjon a játékos mikor leadja a dobozt
Config.Sell = "50000" --How much will the player earn for selling the tobacco
--Wie viel der Spieler erhalten soll, wenn er die Box fallen lässt

--Mennyi idő után tűnjön el az eladási pontról az NPC (ms-ben)
Config.DisappearAfter = 10000 ----After how long should the NPC disappear from the selling point (in ms)
--Wie lange soll der NPC vom Verkaufsort verschwinden (in ms)

--A rablás koordinátája
Config.HeistCoords = vector3(2196.6589, 5608.0850, 53.4854) --The coord of the robbery
--Die Koordinaten des Raubüberfalls

--Állítsd false-ra ha nem szeretnéd, hogy jelölve legyen a térképen a rablás területe
Config.EnableBlip = true --Set it false if you don't want to have a blip for the robbery location
--Wählen Sie false, wenn Sie nicht möchten, dass das Gebiet des Überfalls auf der Karte markiert wird

--Itt állítsd be, hogy mennyi idő után lehessen újra rabolni (Percben)
Config.WaitAfterRobbery = 1 --Set here how much playerss have to wait after a robbery (In minutes)
--Stellen Sie hier ein, wie lange es dauert, bis Sie wieder überfallen werden können (in Minuten).

--Alapértelmezett interakció billentyű az E. Ha meg szeretnéd változtatni használd ezt a weboldalt: https://docs.fivem.net/docs/game-references/controls/
Config.InteractionKey = 38 --Default: E Use this website if you want to change it: https://docs.fivem.net/docs/game-references/controls/
--Der Standardinteraktionsschlüssel ist E. Wenn Sie ihn ändern möchten, verwenden Sie diese Website: https://docs.fivem.net/docs/game-references/controls/

--Alapértelmezett interakció billentyű az E. Ha meg szeretnéd változtatni használd ezt a weboldalt: https://docs.fivem.net/docs/game-references/controls/
Config.InteractKeyString = "~INPUT_PICKUP~" --Default: E Use this website if you want to change it: https://docs.fivem.net/docs/game-references/controls/
--Der Standardinteraktionsschlüssel ist E. Wenn Sie ihn ändern möchten, verwenden Sie diese Website: https://docs.fivem.net/docs/game-references/controls/

--Értesítési beálíltások:
--Notification settings:
--Bescheinigung der Aufschriften:

RegisterNetEvent("mester_tobacconotify")
AddEventHandler("mester_tobacconotify", function(type, msg)
--You can set your notification here (Some notification systems can already be found here just delete the two minus signs from the beginning)
	--exports['okokNotify']:Alert("Tobacco Robbery", 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 }) --skeexsNotify (Free resource)
	--TriggerEvent('QBCore:Notify', msg, type) --Default QBCore notifcation (Free resource)
	TriggerEvent('esx:showNotification', msg) --Default ESX notification (Free resource)
end)

--Értesítés típúsok
--Notification types
--Arten der Zertifizierung
Config.Red = "error"
Config.Green = "success"

--CUSTOM FRAMEWORK

RegisterNetEvent("mester_tobaccoCustomGiveMoneyOrItem")
AddEventHandler("mester_tobaccoCustomGiveMoneyOrItem", function()
	--Ha CUSTOM framework-öt használsz akkor itt add meg, hogy hogyan adja oda a script a pénzt/itemet (!SERVER OLDALI!)
	--If you are using CUSTOM framework then set the money/item give function here (!SERVER SIDED!)
	--Wenn Sie das CUSTOM-Framework verwenden, stellen Sie hier die Funktion "Geld/item geben" ein. (!SERVER SEITE!)
end)

RegisterNetEvent("mester_tobaccoPoliceCheck")
AddEventHandler("mester_tobaccoPoliceCheck", function()
	--Ha CUSTOM framework-öt használsz akkor itt add meg, hogy hogyan ellenőrizze a rendőrök számát a script (!CLIENT OLDALI!)
	--If you are using CUSTOM framework then set the police check function here (!CLIENT SIDED!)
	--Wenn Sie ein CUSTOM-Framework verwenden, können Sie hier angeben, wie das Skript die Anzahl der Polizeibeamten überprüfen soll (!CLIENT SEITE!)

	--Ezt a triggert ne töröld ki! Az ellenőrzés eredménye legyen a CustomPoliceNumberResult locale-hoz kötve
	TriggerEvent("mester_tobaccoCustomPoliceCheckResult", CustomPoliceNumberResult) --Do not delete this trigger! The check result should be bound to the CustomPoliceNumberResult locale
	--Löschen Sie diesen Auslöser nicht! Das Prüfergebnis sollte an das Gebietsschema CustomPoliceNumberResult gebunden sein
end)

RegisterNetEvent("mester_tobaccoJobCheck")
AddEventHandler("mester_tobaccoJobCheck", function(x, y, z)
	--Ha CUSTOM framework-öt használsz akkor itt add meg, hogy hogyan ellenőrizze a munkák tagjait a script (!SERVER OLDALI!)
	--If you are using a CUSTOM framework, please specify here how the script should check the members of the jobs (!SERVER OLDALI!)
	--Wenn Sie ein CUSTOM-Framework verwenden, können Sie hier angeben, wie das Skript die Mitglieder der Jobs überprüfen soll (!SERVER OLDALI!)

	--Ezt a triggert ne töröld ki! Az ellenőrzés eredménye legyen a Players[i]-hez kötve
	TriggerClientEvent('mestertobacco_gpsblipClient', Players[i], x,y,z) --Do not delete this trigger! The check result should be bound to the Players[i]
	--Löschen Sie diesen Auslöser nicht! Das Prüfergebnis sollte an das Gebietsschema Players[i] sein
end)

--Fordítások
--Translations
--Übersetzungen


--EN
Config.StartedInMode = "The script started in" 
Config.StartedInMode2 = "mode" --For Script start log. The whole log will look like this is english: The script started in (framework) mode
Config.FrameworkConfigError = "The script has __bad Config__! In Config.lua, Config.Framework can only be equal to ESX; QBCORE; STANDALONE; CUSTOM"
Config.TobaccoHeist = "Tobacco Robbery"
Config.Nopolice = "There are not enough police"
Config.GoSell = "You have successfully robbed the place. Now go sell the tobaccos"
Config.RobberyFailed = "Robbery failed"
Config.RobberyFinished = "Robbery finished"
Config.RobberyStarted = "Robbery started"
Config.PileCollected = "Grabbed everything from the pile and got"
Config.DollarIcon = "$"
Config.YouHaveToWait = "The place was recently robbed. You'll have to wait"
Config.Minutes = "minutes"
Config.TobaccoSelled = "Tobacco sold for"
Config.Cheater = "Tried to expose an event"
Config.GPSBlipName = "Tobacco GPS Signal"
Config.Press = "Press"
Config.ToSell = "To sell the tobacco"
Config.OpenTrunk = "to open the trunk"
Config.ToPickUp = "to pick up the box"
Config.GrabMoney = "to grab the money"


--HU
--[[
Config.StartedInMode = "A script sikeresen elindult" 
Config.StartedInMode2 = "módban" --A fenti sor folytatása. Az egész szöveg majd így néz ki: A script sikeresen elindult (framework) módban
Config.FrameworkConfigError = "A script Configja __rosszul van beállítva__! A Config.lua-ban a Config.Framework csak ezekkel lehet egyenlő: ESX; QBCORE; STANDALONE; CUSTOM"
Config.TobaccoHeist = "Szivar rablás"
Config.Nopolice = "Nincs elég rendőr"
Config.GoSell = "A rablás sikeres volt! Msot menj eladni a szivart"
Config.RobberyFailed = "Rablás elbukva"
Config.RobberyFinished = "Rablás befejezve"
Config.RobberyStarted = "Rablás elindítva"
Config.PileCollected = "Begyűjtötte mindent a halomból és kapott"
Config.DollarIcon = "$"
Config.YouHaveToWait = "Nemmrég kirabolták a helyet. Várnod kell"
Config.Minutes = "percet"
Config.TobaccoSelled = "A szivarok eladva ennyiért"
Config.Cheater = "Megpróbált előhívni egy eventet"
Config.GPSBlipName = "Doboz GPS jel"
]]

--DE
--[[
Config.StartedInMode = "Das Skript wurde erfolgreich gestartet" 
Config.StartedInMode2 = "Modus" --A fenti sor folytatása. Az egész szöveg majd így néz ki: A script sikeresen elindult (framework) módban
Config.FrameworkConfigError = "Die Konfiguration des Skripts ist __falsch__ konfiguriert! In Config.lua kann Config.Framework nur gleich ESX; QBCORE; STANDALONE; CUSTOM" sein.
Config.TobaccoHeist = "Zigarrendiebstahl"
Config.Nopolice = "Nicht genug Polizei"
Config.GoSell = "Der Raubüberfall war erfolgreich! Gehen Sie und verkaufen Sie Ihre Zigarre"
Config.RobberyFailed = "Raubüberfall gescheitert"
Config.RobberyFinished = "Raubüberfall abgeschlossen"
Config.RobberyStarted = "Raubüberfall im Gange"
Config.PileCollected = "Er nahm alles vom Stapel und holte"
Config.DollarIcon = "$"
Config.YouHaveToWait = "Der Laden wurde kürzlich ausgeraubt. Sie werden warten müssen."
Config.Minutes = "Minuten"
Config.TobaccoSelled = "Zigarren für so viel verkauft"
Config.Cheater = "Versucht, ein Ereignis aufzurufen"
Config.GPSBlipName = "Box GPS-Signal"
]]
```
````

```lua
SConfig = {}

--Cseréld ki a YOUR_WEBHOOK-ot egy discord webhookra ahova a script tudja küldeni a logokat
SConfig.DCWebhook = "YOUR_WEBHOOK" --Replace YOUR_WEBHOOK with your discord webhook for logging
--Ersetzen Sie YOUR_WEBHOOK durch einen Discord-Webhook, an den das Skript die Protokolle senden kann
```


# Installation

1. Copy mester\_impoundgarages to your resources
2. Configure everything in Config.lua to your needs (You can find a descriptions for all the options inside the Config.lua)
3. Add this line to your server.cfg (Make sure it's under framework and under oxmysql/mysql-async)

   ```lua
   start mester_impoundgarages
   ```


# Events, exports, snippets

* Impound vehicle event

  ```lua
  TriggerServerEvent("mester_impoundgaragesImpoundVehicle", plate)
  ```
* Impound vehicle example function

  ```lua
  function GetClosestVehicle()
      local coords = GetEntityCoords(PlayerPedId())
      local vehicles = GetGamePool('CVehicle')
      local closestDistance = -1
      local closestVehicle = nil
      for _, vehicle in ipairs(vehicles) do
          local vehicleCoords = GetEntityCoords(vehicle)
          local distance = #(coords - vehicleCoords)
          if closestDistance == -1 or distance < closestDistance then
              closestDistance = distance
              closestVehicle = vehicle
          end
      end
      return closestVehicle
  end

  function ImpundVehicle()
      local ped = PlayerPedId()
      local VehicleData = GetClosestVehicle()
      local carCoords = GetEntityCoords(VehicleData)
      local carCoords2 = GetEntityCoords(ped)
      local distance = GetDistanceBetweenCoords(carCoords.x, carCoords.y, carCoords.z, carCoords2.x, carCoords2.y, carCoords2.z, true)
      if VehicleData ~= nil then
          if distance < 5.0 then
              TaskStartScenarioInPlace(ped, "WORLD_HUMAN_COP_IDLES", 0, true)
              Citizen.Wait(5000)
              ClearPedTasksImmediately(ped)
              -- No need to check player's job here, because impoundgarages checks is automatically by the Config.lua
              TriggerServerEvent("mester_impoundgaragesImpoundVehicle", GetVehicleNumberPlateText(VehicleData))
              DeleteVehicle(vehicleData)
          end
      end
  end
  ```


# Config preview

{% @github-files/github-code-block url="<https://github.com/SMmest3r/mester_importgarages/blob/main/mester_impoundgarages/Config.lua>" %}

{% @github-files/github-code-block url="<https://github.com/SMmest3r/mester_importgarages/blob/main/mester_impoundgarages/ServerConfig.lua>" %}


# Installation

1. Copy mester\_sumomap to your resources
2. Add this line to your server.cfg (Make sure it's under framework)

   ```lua
   start mester_sumomap
   ```


