[VIDEO TUTORIAL] How to add a custom marker

yes I already knew, I needed to do it fast, thanks anyway

just add the check on the distance brother

A little code snippet for people whose ass is as lazy as mine to open OpenIV.

local dobj = CreateDui('LINK OF THE IMAGE', 256, 256)
local duiHandle = GetDuiHandle(dobj)
local dict = CreateRuntimeTxd('marker') -- dictionary name
local txd = CreateRuntimeTextureFromDuiHandle(dict, 'marker', duiHandle) -- texture name

Enjoy it! :slight_smile:

thanks for your contribution :heart:

1 Like

How do I add 2 or 3 markers?

Do the same as with the first marker? Just add more textures to the ytd. So stream more textures. If you want to do it in the same ytd, then you just have to specify the texture name in DrawMarker. and otherwise you still have to change the dictionary name.

1 Like

yes, right

1 Like

Thank you! Your answer helped me to get an idea of what I should do, I don’t know if it’s the right one, but it worked.

Code

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if not HasStreamedTextureDictLoaded(“marker”) then
RequestStreamedTextureDict(“marker”, true)
while not HasStreamedTextureDictLoaded(“marker”) do
Wait(1)
end
else
DrawMarker(9, -4119.48, 7386.86, 16.49, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 1.0, 1.0, 1.0, 255, 255, 255, 255,false, false, 2, true, “marker”, “marker”, false)
DrawMarker(9, -4627.82, 6035.19, 19.74, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 1.0, 1.0, 1.0, 255, 255, 255, 255,false, false, 2, true, “marker”, “marker01”, false)
end
end
end)

2 Likes

yea, that’s the right way, how you use it. :slight_smile:

1 Like

Hey, the problem using this method is that the png ain’t transparent, here is an example :

Using an image from here :
https://forum.cfx.re/uploads/default/original/3X/0/3/0301f645963889531fb4870e8d47f2f7da7f1c45.gif

It is a transparent .gif but same result using transparent .png

yee, I know. My friend helped my to fix that by writing a small api, which removes the background of the images in my database.

1 Like

Here is an example. I can write the name of the requested faction as a value in this url
https://scrypth0n.dev/gangland.php?frakname=gazo

if “frakname” is empty, it loads the server-logo. I’ll ask my friend if he may release the php file in the forum.

1 Like

Thanks!

1 Like

can you release php?

I created a seperate post for this

When i add another marker like mentioned above i get this crash

hi i have problem

the video isnt available on youtube anymore. Do u have a tutorial somewhere?

[HOW-TO] How to stream custom marker! here you can see it written (original post)
Anyway Does someone knows how to make it with depth because is very thin?

small question here but what vector is used or is it a vector at all?