diff --git a/client/misc.lua b/client/misc.lua index 5746fcbd..6bf881c9 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 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)