hello i try this and i go to spawn car and click “E” and dont apear menu
function OpenVehicleSpawnerMenu()
local elements = {}
if ESX.PlayerData.job.name == 'ambulance' and PlayerData.job.grade_name == 'inem0' then
table.insert(elements, {label = _U('ambulance'), value = 'ambulance'})
end
if ESX.PlayerData.job.name == 'ambulance' and PlayerData.job.grade_name == 'inem1' then
table.insert(elements, {label = _U('ambulance'), value = 'ambulance1'})
end
if ESX.PlayerData.job.name == 'ambulance' and PlayerData.job.grade_name == 'inem2' then
table.insert(elements, {label = _U('ambulance'), value = 'ambulance'})
end
if ESX.PlayerData.job.name == 'ambulance' and PlayerData.job.grade_name == 'inem3' then
table.insert(elements, {label = _U('ambulance'), value = 'ambulance'})
end
if ESX.PlayerData.job.name == 'ambulance' and PlayerData.job.grade_name == 'inem4' then
table.insert(elements, {label = _U('ambulance'), value = 'ambulance'})
end
if ESX.PlayerData.job.name == 'ambulance' and PlayerData.job.grade_name == 'boss' then
table.insert(elements, {label = _U('ambulance'), value = 'ambulance'})
end
ESX.UI.Menu.CloseAll()
if Config.EnableSocietyOwnedVehicles then
local elements = {}
ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles)
for i=1, #vehicles, 1 do
table.insert(elements, {
label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']',
value = vehicles[i]
})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner',
{
title = _U('veh_menu'),
align = 'top-left',
elements = elements
}, function(data, menu)
menu.close()
local vehicleProps = data.current.value
ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 230.0, function(vehicle)
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
local playerPed = PlayerPedId()
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
end)
TriggerServerEvent('esx_society:removeVehicleFromGarage', 'ambulance', vehicleProps)
end, function(data, menu)
menu.close()
CurrentAction = 'vehicle_spawner_menu'
CurrentActionMsg = _U('veh_spawn')
CurrentActionData = {}
end)
end, 'ambulance')
else -- not society vehicles
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner',
{
title = _U('veh_menu'),
align = 'top-left',
elements = elements,
}, function(data, menu)
menu.close()
ESX.Game.SpawnVehicle(data.current.model, Config.Zones.VehicleSpawnPoint.Pos, 230.0, function(vehicle)
local playerPed = PlayerPedId()
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
end)
end, function(data, menu)
menu.close()
CurrentAction = 'vehicle_spawner_menu'
CurrentActionMsg = _U('veh_spawn')
CurrentActionData = {}
end)
end
end
error on console f8:
line 450:
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if CurrentAction ~= nil then
ESX.ShowHelpNotification(CurrentActionMsg)
if IsControlJustReleased(0, Keys['E']) and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'ambulance' then
if CurrentAction == 'ambulance_actions_menu' then
OpenAmbulanceActionsMenu()
elseif CurrentAction == 'boss_actions_menu' then
OpenBossActionsMenu()
elseif CurrentAction == 'vehicle_spawner_menu' then
OpenVehicleSpawnerMenu()
elseif CurrentAction == 'pharmacy' then
OpenPharmacyMenu()
-- elseif CurrentAction == 'fast_travel_goto_top' or CurrentAction == 'fast_travel_goto_bottom' then
-- FastTravel(CurrentActionData.pos)
elseif CurrentAction == 'delete_vehicle' then
if Config.EnableSocietyOwnedVehicles then
local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle)
TriggerServerEvent('esx_society:putVehicleInGarage', 'ambulance', vehicleProps)
end
ESX.Game.DeleteVehicle(CurrentActionData.vehicle)
end
CurrentAction = nil
end
end
if IsControlJustReleased(0, Keys['F6']) and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'ambulance' and not IsDead then
OpenMobileAmbulanceActionsMenu()
end
end
end)
ANY help me?


