diff --git a/client/events.lua b/client/events.lua index 6ed07e4..c0b2597 100644 --- a/client/events.lua +++ b/client/events.lua @@ -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) diff --git a/locale/nl.lua b/locale/nl.lua index c99d359..fd19d57 100644 --- a/locale/nl.lua +++ b/locale/nl.lua @@ -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.' } } diff --git a/locale/pt-br.lua b/locale/pt-br.lua new file mode 100644 index 0000000..9621437 --- /dev/null +++ b/locale/pt-br.lua @@ -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 +}) diff --git a/server/exports.lua b/server/exports.lua index 2cfed5a..3b50fb1 100644 --- a/server/exports.lua +++ b/server/exports.lua @@ -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)