felipebaidoloko

[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;) 

Share this post


Link to post

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.