Jump to content

Removing an icon from the map, how to do it?


Recommended Posts

Hello everyone LUA programmers, dear people. How to implement the disappearance of an icon on the map and radar? Well, in general, I click on the button in the goo menu there, for example .. start work and so that not all the icons from the map disappear, namely a certain id of the icon from the map, how to do this, please help. I will do with you.

Link to post
  • MTA Anti-Cheat Team

Each icon / blip is a GTA texture, so replacing the texture of that specific one with an alpha texture (transparant) should do the trick. That technique is also known as "texture removal (shader)" - instead of messing with the radar / map TXD's, simply use a shader to apply the alpha texture.

Example of texture removal shader:

client.lua

theTechnique = dxCreateShader("shader.fx")
alphaTexture = dxCreateTexture( "tex/alpha.png")

function textureRemovalShader()
	engineApplyShaderToWorldTexture(theTechnique, "texname")
	dxSetShaderValue(theTechnique, "gTexture", alphaTexture)
end
addEventHandler("onClientResourceStart", resourceRoot, textureRemovalShader)

shader.fx

texture gTexture;

technique TexReplace
{
    pass P0
    {
        Texture[0] = gTexture;
    }
}

alpha.png (transparent alpha texture itself):
download

You will clearly have to identify the material name of that radar icon you wish to remove (in order to edit "texname", the texture to apply transparent alpha to) and you can do that with the help of tools like shader_tex_names or Prineside texture view / Prineside ID search (which also provides an overview of textures per thing).

Link to post
1 hour ago, Dutchman101 said:

Each icon / blip is a GTA texture, so replacing the texture of that specific one with an alpha texture (transparant) should do the trick. That technique is also known as "texture removal (shader)" - instead of messing with the radar / map TXD's, simply use a shader to apply the alpha texture.

Example of texture removal shader:

client.lua


theTechnique = dxCreateShader("shader.fx")
alphaTexture = dxCreateTexture( "tex/alpha.png")

function textureRemovalShader()
	engineApplyShaderToWorldTexture(theTechnique, "texname")
	dxSetShaderValue(theTechnique, "gTexture", alphaTexture)
end
addEventHandler("onClientResourceStart", resourceRoot, textureRemovalShader)

shader.fx


texture gTexture;

technique TexReplace
{
    pass P0
    {
        Texture[0] = gTexture;
    }
}

alpha.png (transparent alpha texture itself):
download

You will clearly have to identify the material name of that radar icon you wish to remove (in order to edit "texname", the texture to apply transparent alpha to) and you can do that with the help of tools like shader_tex_names or Prineside texture view / Prineside ID search (which also provides an overview of textures per thing).

You threw me off, yes, I understand, but can you please have a full-fledged code to hide a certain icon from the map? by pressing the button in the goo menu to start work. I just want the miner's work resource so that when I click to start work, the id icon disappears 41 the name of the icon - Waypoint

Link to post
  • MTA Anti-Cheat Team
19 hours ago, saluta said:

You threw me off, yes, I understand, but can you please have a full-fledged code to hide a certain icon from the map? by pressing the button in the goo menu to start work. I just want the miner's work resource so that when I click to start work, the id icon disappears 41 the name of the icon - Waypoint

 

1 hour ago, saluta said:

help pls! :(

You should actually put in some effort to identify the material name (e.g using the tools i linked for doing that)

Let me quote this part of the Scripting section guidelines topic, it sort of applies here:

Quote

The Scripting section is not meant for those unwilling to learn, whose only intent is to try get others to finish the scripts they need, line by line. We see this happening way too often -  someone with seemingly zero scripting skills does not react on-topic to the set of functions they can use that other users provide them, and does not seem to take any pushes in the right direction forward; they are just waiting for a collective effort from other scripters to develop what they want. This is what we do not want to see. 

Locked

Link to post
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...