mirror of
https://github.com/oosayeroo/qb-unicornjob.git
synced 2026-04-05 09:03:59 -04:00
fix garage
This commit is contained in:
@@ -22,48 +22,28 @@ AddEventHandler('QBCore:Player:SetPlayerData', function(val)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
Citizen.CreateThread(function()
|
Citizen.CreateThread(function()
|
||||||
while true do
|
exports['qb-target']:SpawnPed({
|
||||||
Citizen.Wait(1000)
|
model = Config.GarageModel,
|
||||||
for k, v in pairs(Config.GaragePedLocations) do
|
coords = Config.GarageLocation,
|
||||||
local pos = GetEntityCoords(PlayerPedId())
|
minusOne = true, --may have to change this if your ped is in the ground
|
||||||
local dist = #(pos - vector3(v.coords.x, v.coords.y, v.coords.z))
|
freeze = true,
|
||||||
|
invincible = true,
|
||||||
if dist < 40 and not pedspawned then
|
blockevents = true,
|
||||||
TriggerEvent('qb-unicornjob:spawn:ped', v.coords)
|
scenario = 'WORLD_HUMAN_GUARD_STAND',
|
||||||
pedspawned = true
|
target = {
|
||||||
end
|
options = {
|
||||||
if dist >= 35 then
|
{
|
||||||
pedspawned = false
|
type="client",
|
||||||
DeletePed(npc)
|
event = "garage:V-UnicornGarage",
|
||||||
end
|
icon = "fas fa-car",
|
||||||
end
|
label = "Big Larry"
|
||||||
end
|
}
|
||||||
|
},
|
||||||
|
distance = 2.5,
|
||||||
|
},
|
||||||
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('qb-unicornjob:spawn:ped')
|
|
||||||
AddEventHandler('qb-unicornjob:spawn:ped',function(coords)
|
|
||||||
local hash = `s_m_m_bouncer_01`
|
|
||||||
|
|
||||||
RequestModel(hash)
|
|
||||||
while not HasModelLoaded(hash) do
|
|
||||||
Wait(10)
|
|
||||||
end
|
|
||||||
|
|
||||||
pedspawned = true
|
|
||||||
npc = CreatePed(5, hash, coords.x, coords.y, coords.z - 1.0, coords.w, false, false)
|
|
||||||
FreezeEntityPosition(npc, true)
|
|
||||||
SetBlockingOfNonTemporaryEvents(npc, true)
|
|
||||||
loadAnimDict("amb@world_human_cop_idles@male@idle_b")
|
|
||||||
TaskPlayAnim(npc, "amb@world_human_cop_idles@male@idle_b", "idle_e", 8.0, 1.0, -1, 17, 0, 0, 0, 0)
|
|
||||||
end)
|
|
||||||
|
|
||||||
function loadAnimDict(dict)
|
|
||||||
RequestAnimDict(dict)
|
|
||||||
while not HasAnimDictLoaded(dict) do
|
|
||||||
Citizen.Wait(5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
RegisterNetEvent('qb-unicornjob:garage')
|
RegisterNetEvent('qb-unicornjob:garage')
|
||||||
AddEventHandler('qb-unicornjob:garage', function(vu)
|
AddEventHandler('qb-unicornjob:garage', function(vu)
|
||||||
local vehicle = vu.vehicle
|
local vehicle = vu.vehicle
|
||||||
@@ -117,7 +97,7 @@ RegisterNetEvent('garage:V-UnicornGarage', function()
|
|||||||
exports['qb-menu']:openMenu({
|
exports['qb-menu']:openMenu({
|
||||||
{
|
{
|
||||||
header = "| V Unicorn Garage |",
|
header = "| V Unicorn Garage |",
|
||||||
isMenuHeader = true, -- Set to true to make a nonclickable title
|
isMenuHeader = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header = "• Schafter V12",
|
header = "• Schafter V12",
|
||||||
|
|||||||
Reference in New Issue
Block a user