From e2a049e06c3f10843125350416de6d11c7718a0d Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:44:03 +0100 Subject: [PATCH 1/5] perm check + setammo command perm check + setammo command --- client/misc.lua | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/client/misc.lua b/client/misc.lua index 5746fcbd..ef2c52d1 100644 --- a/client/misc.lua +++ b/client/misc.lua @@ -55,18 +55,22 @@ local function CopyCoords(data) end RegisterCommand("vector2", function() + if not CheckPerms('mod') then return end CopyCoords("vector2") end, false) RegisterCommand("vector3", function() + if not CheckPerms('mod') then return end CopyCoords("vector3") end, false) RegisterCommand("vector4", function() + if not CheckPerms('mod') then return end CopyCoords("vector4") end, false) RegisterCommand("heading", function() + if not CheckPerms('mod') then return end CopyCoords("heading") end, false) @@ -138,6 +142,18 @@ RegisterNetEvent('ps-adminmenu:client:SetAmmo', function(data, selectedData) end end) +RegisterCommand("setammo", function(source) + if not CheckPerms('mod') then return end + local weapon = GetSelectedPedWeapon(cache.ped) + local ammo = 999 + if weapon ~= nil then + SetPedAmmo(cache.ped, weapon, ammo) + QBCore.Functions.Notify(locale("set_wepaon_ammo", tostring(ammo)), 'success') + else + QBCore.Functions.Notify(locale("no_weapon"), 'error') + end +end, false) + --Toggle Dev local ToggleDev = false @@ -164,17 +180,12 @@ local toogleAdmin = lib.addKeybind({ end }) ---noclip -RegisterCommand('nc', function() - TriggerEvent(Config.Actions["noclip"].event) -end, false) - local toogleNoclip = lib.addKeybind({ name = 'toogleNoclip', description = locale("command_noclip_desc"), defaultKey = Config.NoclipKey, onPressed = function(self) - ExecuteCommand('nc') + TriggerEvent(Config.Actions["noclip"].event, Config.Actions["noclip"]) end }) From ca8333a4afad1dcb1524ee7811fb51f83758a875 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:44:25 +0100 Subject: [PATCH 2/5] spawnpersonalvehicle fix spawnpersonalvehicle fix --- client/vehicles.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/vehicles.lua b/client/vehicles.lua index 77885e93..aa3caf19 100644 --- a/client/vehicles.lua +++ b/client/vehicles.lua @@ -166,15 +166,14 @@ RegisterNetEvent("ps-adminmenu:client:SpawnPersonalvehicle", function(data, sele local coords = QBCore.Functions.GetCoords(ped) local cid = QBCore.Functions.GetPlayerData().citizenid - QBCore.Functions.TriggerCallback("qb-garage:server:GetVehicleProperties", function(properties, plate) - props = properties - end, plate) lib.callback('ps-adminmenu:server:GetVehicleByPlate', false, function(vehModel) vehicle = vehModel end, plate) + Wait(100) QBCore.Functions.TriggerCallback('QBCore:Server:SpawnVehicle', function(vehicle) local veh = NetToVeh(vehicle) + local props = QBCore.Functions.GetVehicleProperties(veh) SetEntityHeading(veh, coords.w) TaskWarpPedIntoVehicle(ped, veh, -1) SetVehicleModKit(veh, 0) @@ -183,6 +182,8 @@ RegisterNetEvent("ps-adminmenu:client:SpawnPersonalvehicle", function(data, sele SetVehicleNumberPlateText(veh, plate) exports[Config.Fuel]:SetFuel(veh, 100.0) TriggerEvent("vehiclekeys:client:SetOwner", plate) + TriggerEvent('iens:repaira', ped) + TriggerEvent('vehiclemod:client:fixEverything', ped) end, vehicle, coords, true) end) From 5e6face2990ef482d01a2f5a1eb0cb95a76a1575 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:46:52 +0100 Subject: [PATCH 3/5] readded noclip readded noclip --- client/misc.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/misc.lua b/client/misc.lua index ef2c52d1..6bf881c9 100644 --- a/client/misc.lua +++ b/client/misc.lua @@ -180,12 +180,17 @@ local toogleAdmin = lib.addKeybind({ end }) +--noclip +RegisterCommand('nc', function() + TriggerEvent(Config.Actions["noclip"].event) +end, false) + local toogleNoclip = lib.addKeybind({ name = 'toogleNoclip', description = locale("command_noclip_desc"), defaultKey = Config.NoclipKey, onPressed = function(self) - TriggerEvent(Config.Actions["noclip"].event, Config.Actions["noclip"]) + ExecuteCommand('nc') end }) From 5a2185f40750719062fbd883087ab3a434abf3a9 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:47:43 +0100 Subject: [PATCH 4/5] readded html readded html From 225d6e924a6e7ebd13a31a52128659e950751c7a Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:49:22 +0100 Subject: [PATCH 5/5] added players.svelte added players.svelte