#Qb apartaments

1 messages · Page 1 of 1 (latest)

primal belfry
#

Hi guys i need some help just changing some code because im here just doing it and doing it and i cant seem to put it working

I need to put to enter the apartament and to leave with a marker but i cant seem to get it done

#

If soemone can help me i would appreciate so much

valid walrus
#

He's wanting a Marker to show up at the locations where you Enter/Exit the apartment..

primal belfry
#

yeah but like i dont know where to put it

#

because like if i put where the entrance and exit zones are

#

it doesnt work

valid walrus
# primal belfry it doesnt work

Try to find your section of code*(Client)* that looks like this and replace yours with this and test it.(I have not tested so Idk if it will work or not):

if UseTarget then
    CreateThread(function()
        local sleep = 5000
        while not LocalPlayer.state.isLoggedIn do
            Wait(sleep)
        end

        while true do
            sleep = 1000

            if not InApartment then
                SetClosestApartment()
                SetApartmentsEntranceTargets()

                -- Draw marker for apartment entrance
                for id, apartment in pairs(Apartments.Locations) do
                    if apartment and apartment.coords and apartment.coords.enter then
                        local coords = apartment.coords.enter
                        DrawMarker(20, coords.x, coords.y, coords.z - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 100, false, false, 2, nil, nil, false)
                    end
                end
            elseif InApartment then
                SetInApartmentTargets()

                -- Draw marker for apartment exit
                if POIOffsets and ClosestHouse then
                    local coords = vector3(
                        Apartments.Locations[ClosestHouse].coords.enter.x + POIOffsets.exit.x,
                        Apartments.Locations[ClosestHouse].coords.enter.y + POIOffsets.exit.y,
                        Apartments.Locations[ClosestHouse].coords.enter.z - CurrentOffset + POIOffsets.exit.z
                    )
                    DrawMarker(20, coords.x, coords.y, coords.z - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0, 0, 255, 100, false, false, 2, nil, nil, false)
                end
            end

            Wait(sleep)
        end
    end)
else
    CreateThread(function()
        local sleep = 5000
        while not LocalPlayer.state.isLoggedIn do
            Wait(sleep)
        end

        while true do
            sleep = 1000

            if not InApartment then
                SetClosestApartment()
                SetApartmentsEntranceTargets()

                if IsInsideEntranceZone then
                    sleep = 0
                    -- Draw marker for apartment entrance
                    if ClosestHouse and Apartments.Locations[ClosestHouse] then
                        local coords = Apartments.Locations[ClosestHouse].coords.enter
                        DrawMarker(20, coords.x, coords.y, coords.z - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 100, false, false, 2, nil, nil, false)
                    end

                    if IsControlJustPressed(0, 38) then
                        OpenEntranceMenu()
                        exports['qb-core']:HideText()
                    end
                end
            elseif InApartment then
                sleep = 0
                SetInApartmentTargets()

                if IsInsideExitZone then
                    -- Draw marker for apartment exit
                    if POIOffsets and ClosestHouse then
                        local coords = vector3(
                            Apartments.Locations[ClosestHouse].coords.enter.x + POIOffsets.exit.x,
                            Apartments.Locations[ClosestHouse].coords.enter.y + POIOffsets.exit.y,
                            Apartments.Locations[ClosestHouse].coords.enter.z - CurrentOffset + POIOffsets.exit.z
                        )
                        DrawMarker(20, coords.x, coords.y, coords.z - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0, 0, 255, 100, false, false, 2, nil, nil, false)
                    end

                    if IsControlJustPressed(0, 38) then
                        OpenExitMenu()
                        exports['qb-core']:HideText()
                    end
                end
            end

            Wait(sleep)
        end
    end)
end
#

Looks like it starts around Line 709 if you're using default qb-apartments...