diff --git a/config.lua b/config.lua index 43de9d5..6941fe4 100644 --- a/config.lua +++ b/config.lua @@ -9,7 +9,7 @@ QBConfig.Money = {} QBConfig.Money.MoneyTypes = {['cash'] = 500, ['bank'] = 5000, ['crypto'] = 0} -- ['type'] = startamount - Add or remove money types for your server (for ex. ['blackmoney'] = 0), remember once added it will not be removed from the database! QBConfig.Money.DontAllowMinus = {'cash', 'crypto'} -- Money that is not allowed going in minus QBConfig.Money.PayCheckTimeOut = 10 -- The time in minutes that it will give the paycheck -QBConfig.Money.PayCheckSociety = false -- If true paycheck will come from the society account that the player is employed at, requires qb-bossmenu +QBConfig.Money.PayCheckSociety = false -- If true paycheck will come from the society account that the player is employed at, requires qb-management QBConfig.Player = {} QBConfig.Player.MaxWeight = 120000 -- Max weight a player can carry (currently 120kg, written in grams) diff --git a/locale/ee.lua b/locale/ee.lua new file mode 100644 index 0000000..8bd5da0 --- /dev/null +++ b/locale/ee.lua @@ -0,0 +1,31 @@ +local Translations = { + error = { + not_online = 'Mängija pole serveris!', + wrong_format = 'Vale formaat.', + missing_args = 'Kõiki argumente pole sisestatud (x, y, z)', + missing_args2 = 'Kõik argumendid tuleb täita!', + no_access = 'Sellele käsule pole juurdepääsu!', + company_too_poor = 'Teie tööandja on pankrotis.', + item_not_exist = 'Sellist asja ei eksisteeri', + too_heavy = 'Inventuur on liiga täis', + duplicate_license = 'Leiti Rockstari litsentsi duplikaat', + no_valid_license = 'Kehtivat Rockstari litsentsi ei leitud', + not_whitelisted = 'Te\'pole serveri Allowlistis!' + }, + success = {}, + info = { + received_paycheck = 'Saite oma töötasu kätte $%{value}', + job_info = 'Töökoht: %{value} | Auaste: %{value2} | Tööl: %{value3}', + gang_info = 'Gang: %{value} | Auaste: %{value2}', + on_duty = 'Alustasite enda tööpäeva!', + off_duty = 'Lõpetasite enda tööpäeva!', + checking_ban = 'Tere %s. Me kontrollime, kas olete keelustatud.', + join_server = 'Tere tulemast %s serverisse {Server Name}.', + checking_whitelisted = 'Tere %s. Kontrollime teie Allowlisti olemasolu.' + } +} + +Lang = Locale:new({ + phrases = Translations, + warnOnMissing = true +}) diff --git a/server/commands.lua b/server/commands.lua index e9aacf0..fdcf590 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -208,7 +208,7 @@ end, 'admin') -- Inventory (should be in qb-inventory?) QBCore.Commands.Add('clearinv', 'Clear Players Inventory (Admin Only)', { { name = 'id', help = 'Player ID' } }, false, function(source, args) - local playerId = args[1] and args[1] ~= '' or source + local playerId = args[1] ~= '' and args[1] or source local Player = QBCore.Functions.GetPlayer(tonumber(playerId)) if Player then Player.Functions.ClearInventory() diff --git a/server/events.lua b/server/events.lua index 3b2ceab..999264a 100644 --- a/server/events.lua +++ b/server/events.lua @@ -204,6 +204,7 @@ end) QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, amount) local retval = false + if items == nil then return cb(true) end local Player = QBCore.Functions.GetPlayer(source) if not Player then return cb(false) end local isTable = type(items) == 'table' diff --git a/server/player.lua b/server/player.lua index d14ca34..5fe4915 100644 --- a/server/player.lua +++ b/server/player.lua @@ -56,7 +56,7 @@ function QBCore.Player.CheckPlayerData(source, PlayerData) PlayerData.charinfo.gender = PlayerData.charinfo.gender or 0 PlayerData.charinfo.backstory = PlayerData.charinfo.backstory or 'placeholder backstory' PlayerData.charinfo.nationality = PlayerData.charinfo.nationality or 'USA' - PlayerData.charinfo.phone = PlayerData.charinfo.phone or QBCore.Functions.CreatePhoneNumber() + PlayerData.charinfo.phone = tonumber(PlayerData.charinfo.phone) or QBCore.Functions.CreatePhoneNumber() PlayerData.charinfo.account = PlayerData.charinfo.account or QBCore.Functions.CreateAccountNumber() -- Metadata PlayerData.metadata = PlayerData.metadata or {} @@ -113,6 +113,7 @@ function QBCore.Player.CheckPlayerData(source, PlayerData) PlayerData.job.name = PlayerData.job.name or 'unemployed' PlayerData.job.label = PlayerData.job.label or 'Civilian' PlayerData.job.payment = PlayerData.job.payment or 10 + PlayerData.job.type = PlayerData.job.type or 'none' if QBCore.Shared.ForceJobDefaultDutyAtLogin or PlayerData.job.onduty == nil then PlayerData.job.onduty = QBCore.Shared.Jobs[PlayerData.job.name].defaultDuty end @@ -167,6 +168,7 @@ function QBCore.Player.CreatePlayer(PlayerData) self.PlayerData.job.name = job self.PlayerData.job.label = QBCore.Shared.Jobs[job].label self.PlayerData.job.onduty = QBCore.Shared.Jobs[job].defaultDuty + self.PlayerData.job.type = QBCore.Shared.Jobs[job].type or 'none' if QBCore.Shared.Jobs[job].grades[grade] then local jobgrade = QBCore.Shared.Jobs[job].grades[grade] self.PlayerData.job.grade = {} @@ -634,7 +636,7 @@ function QBCore.Functions.CreatePhoneNumber() local UniqueFound = false local PhoneNumber = nil while not UniqueFound do - PhoneNumber = math.random(100,999) .. math.random(1000000,9999999) + PhoneNumber = tonumber(math.random(100,999) .. math.random(1000000,9999999)) local query = '%' .. PhoneNumber .. '%' local result = MySQL.prepare.await('SELECT COUNT(*) as count FROM players WHERE charinfo LIKE ?', { query }) if result == 0 then diff --git a/shared/jobs.lua b/shared/jobs.lua index 8960e67..a1da2bb 100644 --- a/shared/jobs.lua +++ b/shared/jobs.lua @@ -14,6 +14,7 @@ QBShared.Jobs = { }, ['police'] = { label = 'Law Enforcement', + type = "leo", defaultDuty = true, offDutyPay = false, grades = { @@ -279,4 +280,4 @@ QBShared.Jobs = { }, }, }, -} \ No newline at end of file +}