Merge branch 'main' into patch-1

This commit is contained in:
Kakarot
2022-06-15 17:38:23 -07:00
committed by GitHub
5 changed files with 74 additions and 5 deletions
+1
View File
@@ -134,6 +134,7 @@ RegisterNetEvent('QBCore:Command:SpawnVehicle', function(vehName)
local vehicle = CreateVehicle(hash, GetEntityCoords(ped), GetEntityHeading(ped), true, false)
TaskWarpPedIntoVehicle(ped, vehicle, -1)
SetVehicleFuelLevel(vehicle, 100.0)
SetVehicleDirtLevel(vehicle, 0.0)
SetModelAsNoLongerNeeded(hash)
TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(vehicle))
end)
+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.'
}
}
+31
View File
@@ -0,0 +1,31 @@
local Translations = {
error = {
not_online = 'O jogador não está online',
wrong_format = 'Formato inválido',
missing_args = 'Nem todos os argumentos foram inseridos (x, y, z)',
missing_args2 = 'Todos os argumentos devem ser preenchidos!',
no_access = 'Sem acesso a este comando',
company_too_poor = 'Sua compania está quebrada',
item_not_exist = 'O item não existe',
too_heavy = 'Inventário cheio',
duplicate_license = 'Licença duplicada da Rockstar encontrada',
no_valid_license = 'Nenhuma licença válida da Rockstar encontrada',
not_whitelisted = 'Você não tem whitelist neste servidor'
},
success = {},
info = {
received_paycheck = 'Você recebeu seu salário de %{value}€',
job_info = 'Emprego: %{value} | Grau: %{value2} | Serviço: %{value3}',
gang_info = 'Gang: %{value} | Grau: %{value2}',
on_duty = 'Você agora está de plantão!',
off_duty = 'Você agora está de folga!',
checking_ban = 'Olá %s. Estamos verificando se você foi banido.',
join_server = 'Bem-vindo %s a {Server Name}.',
checking_whitelisted = 'Olá %s. Estamos verificando sua whitelist.'
}
}
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true
})
+2 -3
View File
@@ -135,14 +135,13 @@ end)
RegisterNetEvent('QBCore:Server:SetMetaData', function(meta, data)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
if meta == 'hunger' or meta == 'thirst' then
if data > 100 then
data = 100
end
end
if Player then
Player.Functions.SetMetaData(meta, data)
end
Player.Functions.SetMetaData(meta, data)
TriggerClientEvent('hud:client:UpdateNeeds', src, Player.PlayerData.metadata['hunger'], Player.PlayerData.metadata['thirst'])
end)
+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)