Jump to content

[HELP] '@dxCreateTexture


Recommended Posts

 

I have a gun sight system, but it keeps warning me when I click to aim ('Mouse2') I did a function to see if the error was going to go I'm going to put the old script and what I did PLEASE WHAT SHOULD I DO?

old
bindKey("mouse2","down",function()
	Crosshair_table = {}
	if getElementData(getLocalPlayer(),"sight") then
		if oldSight and oldSight == getElementData(getLocalPlayer(),"sight") then
			return 
		end	
		defaults = dxCreateTexture(getElementData(getLocalPlayer(),"sight"))
		oldSight = getElementData(getLocalPlayer(),"sight")
		Crosshair_table = dxCreateShader("utilitarios/painel/texreplace.fx")
		engineApplyShaderToWorldTexture(Crosshair_table, "siteM16")
		dxSetShaderValue(Crosshair_table, "gTexture", defaults)
	end	
end)

 

I did

bindKey("mouse2","down",function()
	Crosshair_table = {}
	if getElementData(getLocalPlayer(),"sight") then
		if oldSight and oldSight == getElementData(getLocalPlayer(),"sight") then
			return 
		end	
		if default then
			default = getElementData(getLocalPlayer(),"sight")
		else
			default = "utilitarios/painel/images/false.png"
	    end
		local defaults = dxCreateTexture(default)
		local oldSight = getElementData(getLocalPlayer(),"sight")
		Crosshair_table = dxCreateShader("utilitarios/painel/texreplace.fx")
		engineApplyShaderToWorldTexture(Crosshair_table, "siteM16")
		dxSetShaderValue(Crosshair_table, "gTexture", defaults)
	end	
end)
Warning that this is the one: bad argument @'dxcreateTexture' [expecte mumber at argument 2, got none] 

 

 

Thank you in advance;) 

Link to comment
  • Scripting Moderators

default = getElementData(getLocalPlayer(),"sight")

Is this thing return a number? 

If it returns a number, you should pass the second argument as the y_pixels while "default" passed as the x_pixels .

dxCreateTexture(int x_pixels, int y_pixels,...)

dxCreateTexture(string path,...)

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...