Markers for events such as go on duty, etc?

Hey everyone, as we know the default install of QBCore does not include markers for jobs/activities, only when you get close to the point, it’ll show the QB Target menu. Is there any easy way/tutorial to be able to mark these locations in QBCore?

Been looking for options but was able to understand how to use QB Core and create an event/button, but would like to create a visible marker for these.

By the sounds of it you want to add DrawMarkers at these locations

Looking to understand more than just the reference code of draw markers. I would like to understand how to properly implement these or any other function that allows to mark the spot where the job is and respect the jobs visibility, etc. Unfortunately I am not an experienced developer to do much with the draw marker reference, thanks though.

oh this would be very hard to explain, as your talking about multiple jobs personly we have spent the time to do ours…

Here is an example for our police job we start with finding this:

local pos = GetEntityCoords(PlayerPedId())
            for k, v in pairs(Config.Locations["duty"]) do
                if #(pos - v) < 7 then
                    DrawMarker(27, v.x, v.y, v.z -0.95, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8, 0.6, 26, 225, 0, 225, false, false, false, true, false, false, false)
                    sleep = 5
                    if #(pos - v) < 0.9 then
                        if not onDuty then
                        DrawMarker(27, v.x, v.y, v.z -0.95, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8, 0.6, 26, 94, 255, 155, false, false, false, true, false, false, false)

                            DrawText3D(v.x, v.y, v.z, "~g~E~w~ - Go on duty")
                        else
                        DrawMarker(27, v.x, v.y, v.z -0.95, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8, 0.6, 26, 94, 255, 155, false, false, false, true, false, false, false)

                            DrawText3D(v.x, v.y, v.z, "~r~E~w~ - Go off duty")
                        end
                        if IsControlJustReleased(0, 38) then
                            onDuty = not onDuty
                            TriggerServerEvent("police:server:UpdateCurrentCops")
                            TriggerServerEvent("QBCore:ToggleDuty")
                            TriggerServerEvent("police:server:UpdateBlips")
                            TriggerEvent('animations:client:EmoteCommandStart', {"notepad"})
                            QBCore.Functions.Progressbar("hospital_checkin", "Signing on/off..", 3000, false, true, {
                                disableMovement = true,
                                disableCarMovement = true,
                                disableMouse = false,
                                disableCombat = true,
                            }, {}, {}, {}, function() -- Done
                                TriggerEvent('animations:client:EmoteCommandStart', {"c"})
                            end, function() -- Cancel
                                TriggerEvent('animations:client:EmoteCommandStart', {"c"})
                                QBCore.Functions.Notify("Checking in failed!", "error")
                            end)
                        end
                    elseif #(pos - v) < 2.5 then
                        DrawText3D(v.x, v.y, v.z, "on/off duty")
                    end
                end
            end

If i remember correctly this puts a yellow circle around the on and off duty section for us… but we also do not use Target for any of these.

1 Like

Thanks, I also took a look at this tut:

FiveM Scripting 26 - Draw Markers, Teleport, (Warps) - YouTube

oh yes i know this video i watched it when i first started, quite helpful. :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.