Merge branch 'main' into ClientCallbacks

This commit is contained in:
ItsANoBrainer
2022-06-15 21:56:46 -04:00
committed by GitHub
32 changed files with 422 additions and 147 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ local function hideText()
end
local function drawText(text, position)
if not type(position) == "string" then position = "left" end
if type(position) ~= "string" then position = "left" end
SendNUIMessage({
action = 'DRAW_TEXT',
@@ -17,7 +17,7 @@ local function drawText(text, position)
end
local function changeText(text, position)
if not type(position) == "string" then position = "left" end
if type(position) ~= "string" then position = "left" end
SendNUIMessage({
action = 'CHANGE_TEXT',
+3 -2
View File
@@ -127,13 +127,14 @@ RegisterNetEvent('QBCore:Command:SpawnVehicle', function(vehName)
Wait(0)
end
if IsPedInAnyVehicle(ped) then
if IsPedInAnyVehicle(ped) then
DeleteVehicle(veh)
end
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)
@@ -147,7 +148,7 @@ RegisterNetEvent('QBCore:Command:DeleteVehicle', function()
else
local pcoords = GetEntityCoords(ped)
local vehicles = GetGamePool('CVehicle')
for k, v in pairs(vehicles) do
for _, v in pairs(vehicles) do
if #(pcoords - GetEntityCoords(v)) <= 5.0 then
SetEntityAsMissionEntity(v, true, true)
DeleteVehicle(v)
+3 -3
View File
@@ -201,7 +201,7 @@ function QBCore.Functions.GetClosestPed(coords, ignoreList)
else
coords = GetEntityCoords(ped)
end
local ignoreList = ignoreList or {}
ignoreList = ignoreList or {}
local peds = QBCore.Functions.GetPeds(ignoreList)
local closestDistance = -1
local closestPed = -1
@@ -422,12 +422,12 @@ function QBCore.Functions.GetVehicleProperties(vehicle)
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)
if GetIsVehiclePrimaryColourCustom(vehicle) then
r, g, b = GetVehicleCustomPrimaryColour(vehicle)
local r, g, b = GetVehicleCustomPrimaryColour(vehicle)
colorPrimary = {r, g, b}
end
if GetIsVehicleSecondaryColourCustom(vehicle) then
r, g, b = GetVehicleCustomSecondaryColour(vehicle)
local r, g, b = GetVehicleCustomSecondaryColour(vehicle)
colorSecondary = {r, g, b}
end
+1 -1
View File
@@ -12,7 +12,7 @@ end)
CreateThread(function()
while true do
if LocalPlayer.state.isLoggedIn then
if (QBCore.PlayerData.metadata['hunger'] <= 0 or QBCore.PlayerData.metadata['thirst'] <= 0) and not QBCore.PlayerData.metadata['isdead'] then
if (QBCore.PlayerData.metadata['hunger'] <= 0 or QBCore.PlayerData.metadata['thirst'] <= 0) and not QBCore.PlayerData.metadata['isdead'] then
local ped = PlayerPedId()
local currentHealth = GetEntityHealth(ped)
local decreaseTreshold = math.random(5, 10)
+1 -1
View File
@@ -11,4 +11,4 @@ end)
-- To use this export in a script instead of manifest method
-- Just put this line of code below at the very top of the script
-- local QBCore = exports['qb-core']:GetCoreObject()
-- local QBCore = exports['qb-core']:GetCoreObject()