#Qb apartaments
1 messages · Page 1 of 1 (latest)
He's wanting a Marker to show up at the locations where you Enter/Exit the apartment..
Cfx.re Native Reference
Draws a marker with the specified appearance at the target location. This has to be called every frame, e.g. in a Wait(0) loop.
There's a [list of markers](https://docs.fivem.net/game-references/ma
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
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...