Jump to content

How to Replace sniper scope on the server


Andrew75t

Recommended Posts

  • Moderators

Hi!
You can replace the texture with engineApplyShaderToWorldTexture.

-- CLIENT SIDE

local raw_shader = [[
	texture TEXTURE;
	technique TexReplace {
		pass P0 {
			Texture[0] = TEXTURE;
		}
	}
]]

addEventHandler("onClientResourceStart", root, function()
    local shader  = dxCreateShader(raw_shader)
    local texture = dxCreateTexture("crosshair.png")
    dxSetShaderValue(shader, "TEXTURE", texture)
    engineApplyShaderToWorldTexture(shader, "snipercrosshair")
end)

 

Crosshair image (crosshair.png): https://i.imgur.com/BzfPcsO.png

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...