[HOW-TO] How to stream custom marker!

STEP 1 : Create your PNG or DDS file
STEP 2 : Import your png to ydt texture via OpenIV. In this tutorial we import it to my addon car

  1. Open stream folder

  2. Toggle edit mode in OpenIV
    image
  3. Open .ytd file and import your png.
  4. Save and stream your file

STEP 3 : Draw it

DrawMarker(9, x, y, z, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 3.0, 3.0, 3.0, 255, 255, 255, 255,false, false, 2, true, "your-ytd-name", "your-png-name", false)

Example : i was import pizza.png to bmws.ytd, so

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
		if not HasStreamedTextureDictLoaded("bmws") then
				RequestStreamedTextureDict("bmws", true)
				while not HasStreamedTextureDictLoaded("bmws") do
					Wait(1)
				end
			else
			DrawMarker(9, -268.8787, -991.3987, 32.00805, 0.0, 0.0, 0.0, 0.0, 90.0, 0.0, 3.0, 3.0, 3.0, 255, 255, 255, 255,false, false, 2, true, "bmws", "pizza", false)
		end
    end
end)
``
14 Likes

thanks bro

Hi dude, can you help me about your script, because i have done all the script but when i’m back on my local host sv i can’t see it, but first thank you so much about your great script. @tringuyenk19

image why all pictures are cut to half

1 Like

Is it possible to stream 3d models as markers? To add depth to them.

1 Like

did you find out ?

1 Like

same issue, i dont know how to fix this

great job, how would you add the DrawDistance

2 Likes

(I already posted this under the video version of this post, but I thinky it’s better to share this snippet)

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:

1 Like

How do I add 2 or 3 markers?

You can create multiple custom markers by creating a Config with values and then creating a loop with the 4 lines from @Kattrigerkatta. I think thats the easiest way.

1 Like

Did you find a way to fix this?

(Update)
I have posted a code snippet + api code to fix the background bug with transparent textures :slight_smile:

Use 34 marker id and it’ll work.

Hello Thanks For Your Hard Work is there any way that i can put a custom marker on the vrp/modules/basic_garage ?

vRPclient.addMarker(source, {x, y, z-1, 1.5, 1.5, 1.5, 200,0,0, 125, 150,36})

I work arround.

Put the image in the right and bottom.

image

What is your city? Sou do Brasil