Dritte Garage bei esx_army hinzufügen?

2 Beiträge · 2.124 Aufrufe #esx#esx problem#esx_armyjob#Army Job#Dritte Garage
23.11.2021, 17:31 #1

Moin Moin zusammen,


ich versuche seit ein paar Tagen in meiner Ressource esx_armyjob eine dritte Garage hinzuzufügen, sodass die Helikopter und Flugzeuge nicht in einer Garage ausparkbar sind sondern nur separat.


Hierfür habe ich folgenden Code mit den Stichwort "Plane" in die client/main.lua eingefügt:

AddEventHandler('esx_armyjob:hasEnteredMarker', function(station, part, partNum)
    if part == 'Cloakroom' then
        CurrentAction     = 'menu_cloakroom'
        CurrentActionMsg  = _U('open_cloackroom')
        CurrentActionData = {}
    elseif part == 'Armory' then
        CurrentAction     = 'menu_armory'
        CurrentActionMsg  = _U('open_armory')
        CurrentActionData = {station = station}
    elseif part == 'Vehicles' then
        CurrentAction     = 'menu_vehicles_spawner'
        CurrentActionMsg  = _U('garage_prompt')
        CurrentActionData = {station = station, part = part, partNum = partNum}
    elseif part == 'Helicopters' then
        CurrentAction     = 'Helicopters'
        CurrentActionMsg  = _U('helicopter_prompt')
        CurrentActionData = {station = station, part = part, partNum = partNum}
    elseif part == 'Planes' then
        CurrentAction     = 'Planes'
        CurrentActionMsg  = _U('planes_prompt')
        CurrentActionData = {station = station, part = part, partNum = partNum}
    elseif part == 'BossActions' then
        CurrentAction     = 'menu_boss_actions'
        CurrentActionMsg  = _U('open_bossmenu')
        CurrentActionData = {}
    end
end)
_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)

        if ESX.PlayerData.job and ESX.PlayerData.job.name == 'army' then
            local playerPed = PlayerPedId()
            local playerCoords = GetEntityCoords(playerPed)
            local isInMarker, hasExited, letSleep = false, false, true
            local currentStation, currentPart, currentPartNum

            for k,v in pairs(Config.ARMYStations) do
                for i=1, #v.Cloakrooms, 1 do
                    local distance = #(playerCoords - v.Cloakrooms[i])

                    if distance < Config.DrawDistance then
                        DrawMarker(Config.MarkerType.Cloakrooms, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false)
                        letSleep = false

                        if distance < Config.MarkerSize.x then
                            isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Cloakroom', i
                        end
                    end
                end

                for i=1, #v.Planes, 1 do
                    local distance =  #(playerCoords - v.Planes[i].Spawner)

                    if distance < Config.DrawDistance then
                        DrawMarker(Config.MarkerType.Planes, v.Planes[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false)
                        letSleep = false

                        if distance < Config.MarkerSize.x then
                            isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Planes', i
                        end
                    end
                end

_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)

        if CurrentAction then
            ESX.ShowHelpNotification(CurrentActionMsg)

            if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'army' then

                if CurrentAction == 'menu_cloakroom' then
                    OpenCloakroomMenu()
                elseif CurrentAction == 'menu_armory' then
                    if not Config.EnableESXService then
                        OpenArmoryMenu(CurrentActionData.station)
                    elseif playerInService then
                        OpenArmoryMenu(CurrentActionData.station)
                    else
                        ESX.ShowNotification(_U('service_not'))
                    end
                elseif CurrentAction == 'menu_vehicle_spawner' then
                    if not Config.EnableESXService then
                        OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum)
                    elseif playerInService then
                        OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum)
                    else
                        ESX.ShowNotification(_U('service_not'))
                    end
                elseif CurrentAction == 'Helicopters' then
                    if not Config.EnableESXService then
                        OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum)
                    elseif playerInService then
                        OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum)
                    else
                        ESX.ShowNotification(_U('service_not'))
                    end
                elseif CurrentAction == 'Planes' then
                    if not Config.EnableESXService then
                        OpenVehicleSpawnerMenu('plane', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum)
                    elseif playerInService then
                        OpenVehicleSpawnerMenu('plane', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum)
                    else
                        ESX.ShowNotification(_U('service_not'))
                    end


Den separaten Ausparkpunkt kann man jetzt im Spiel sehen. Allerdings kommt folgender Fehlercode wenn man auf den Shop zugreifen möchte: (Anhang Screenshot (10))


Hat jemand vielleicht eine Idee wie ich das geregelt kriege?


Freundliche Grüße und ich danke schonmal im Voraus.

Zuletzt bearbeitet von Dracun am 23.11.2021, 18:52 (2×)
24.11.2021, 18:07 #2

was ich nicht verstehe ist, das dein code von client/main.lua sein soll und der Fehlermeldung aber von client/vehicle.lua ist. Daher kann ich dir nicht helfen wenn du falschen code postest

Melde dich an, um zu antworten.
© 2026 GTA-FIVEM.ORGImpressumDatenschutzNutzungsbedingungenCookiesShimo Forum