Merge branch 'main' into patch-1

This commit is contained in:
Kakarot
2022-06-15 18:07:59 -07:00
committed by GitHub
9 changed files with 136 additions and 7 deletions
+1 -1
View File
@@ -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)
+14
View File
@@ -25,6 +25,20 @@
box-shadow: 0rem 0rem 0.1rem 0.05rem #000000;
}
@media (width: 3840px) and (height: 2160px) {
#drawtext-container {
display: none;
width: 100%;
height: 100%;
overflow: hidden;
padding: 0;
margin: 0;
font-family: "Poppins", sans-serif !important;
font-weight: 300;
font-size: 1.5vh;
}
}
.text.pressed {
background: var(--active-bg);
}
+43
View File
@@ -2,6 +2,49 @@ html::-webkit-scrollbar {
display: none;
}
@media (width: 3840px) and (height: 2160px) {
.success {
background-color: rgba(23, 23, 23, 90%);
border-radius: 10px;
box-shadow: 0rem 0rem 0.1rem 0.05rem #000000;
border-left: 0.5rem solid #20bb44;
font-size: 1.5vh;
}
.primary {
background-color: rgba(23, 23, 23, 90%);
border-radius: 10px;
box-shadow: 0rem 0rem 0.1rem 0.05rem #000000;
border-left: 5px solid #1c75d2;
font-size: 1.5vh;
}
.error {
background-color: rgba(23, 23, 23, 90%);
border-radius: 10px;
box-shadow: 0rem 0rem 0.1rem 0.05rem #000000;
border-left: 5px solid #c10114;
font-size: 1.5vh;
}
.police {
background-color: rgba(23, 23, 23, 90%);
border-radius: 10px;
box-shadow: 0rem 0rem 0.1rem 0.05rem #000000;
border-left: 5px solid #2197f2;
font-size: 1.5vh;
}
.ambulance {
background-color: rgba(23, 23, 23, 90%);
border-radius: 10px;
box-shadow: 0rem 0rem 0.1rem 0.05rem #000000;
border-left: 5px solid #f44236;
font-size: 1.5vh;
}
}
.success {
background-color: rgba(23, 23, 23, 90%);
border-radius: 10px;
+31
View File
@@ -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
})
+8 -2
View File
@@ -7,7 +7,10 @@ local Translations = {
no_access = 'Geen toegang tot dit commando',
company_too_poor = 'Je werkgever is arm',
item_not_exist = 'Item bestaat niet',
too_heavy = 'Inventaris is te vol'
too_heavy = 'Inventaris is te vol',
duplicate_license = 'Dubbele Rockstar-licentie gevonden',
no_valid_license = 'Geen geldige Rockstar-licentie gevonden',
not_whitelisted = 'Je staat niet op de whitelist voor deze server'
},
success = {},
info = {
@@ -15,7 +18,10 @@ local Translations = {
job_info = 'Baan: %{value} | Rang: %{value2} | In dienst: %{value3}',
gang_info = 'Gang: %{value} | Rang: %{value2}',
on_duty = 'Je bent nu in dienst!',
off_duty = 'Je bent nu uit dienst!'
off_duty = 'Je bent nu uit dienst!',
checking_ban = 'Hallo %s. We controleren of je verbannen bent.',
join_server = 'Welkom %s bij {Server Name}.',
checking_whitelisted = 'Hallo %s. We controleren of je op de whitelist staat.'
}
}
+1 -1
View File
@@ -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()
+32
View File
@@ -65,6 +65,22 @@ end
QBCore.Functions.AddItem = AddItem
exports('AddItem', AddItem)
-- Single update item
local function UpdateItem(itemName, item)
if type(itemName) ~= "string" then
return false, "invalid_item_name"
end
if not QBCore.Shared.Items[itemName] then
return false, "item_not_exists"
end
QBCore.Shared.Items[itemName] = item
TriggerClientEvent('QBCore:Client:OnSharedUpdate', -1, 'Items', itemName, item)
TriggerEvent('QBCore:Server:UpdateObject')
return true, "success"
end
QBCore.Functions.UpdateItem = UpdateItem
exports('UpdateItem', UpdateItem)
-- Multiple Add Items
local function AddItems(items)
local shouldContinue = true
@@ -152,3 +168,19 @@ local function GetCoreVersion(InvokingResource)
end
QBCore.Functions.GetCoreVersion = GetCoreVersion
exports('GetCoreVersion', GetCoreVersion)
local function ExploitBan(playerId, origin)
local name = GetPlayerName(playerId)
MySQL.insert('INSERT INTO bans (name, license, discord, ip, reason, expire, bannedby) VALUES (?, ?, ?, ?, ?, ?, ?)', {
name,
QBCore.Functions.GetIdentifier(playerId, 'license'),
QBCore.Functions.GetIdentifier(playerId, 'discord'),
QBCore.Functions.GetIdentifier(playerId, 'ip'),
origin,
2147483647,
'Anti Cheat'
})
DropPlayer(playerId, "You have been banned for cheating. Check our Discord for more information: " .. QBCore.Config.Server.Discord)
TriggerEvent("qb-log:server:CreateLog", "anticheat", "Anti-Cheat", "red", name.." has been banned for exploiting "..origin, true)
end
exports('ExploitBan', ExploitBan)
+4 -2
View File
@@ -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
+2 -1
View File
@@ -14,6 +14,7 @@ QBShared.Jobs = {
},
['police'] = {
label = 'Law Enforcement',
type = "leo",
defaultDuty = true,
offDutyPay = false,
grades = {
@@ -279,4 +280,4 @@ QBShared.Jobs = {
},
},
},
}
}