Jump to content

[HELP] OnClientClick


iiv03

Recommended Posts

hey guys, i have some problem

so first i did make panel example and i wanna to doing if press button open panel DX

i know functions

	stateKey = false
		function window()
  		if isMouseInPosition(94, 663, 161, 37) then
        _dxDrawRectangleRounded(94, 663, 161, 37, tocolor(0, 73, 183, 100), false)
        dxDrawText("BUY MAP", 94, 663, 255, 700, tocolor(255, 255, 255, 100), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        if ( clickedElement ) then
        _dxDrawRectangleRounded(260, 81, 761, 470, tocolor(18, 18, 18, 255), false)
			end
		else
        _dxDrawRectangleRounded(94, 663, 161, 37, tocolor(0, 73, 183, 255), false)
        dxDrawText("BUY MAP", 94, 663, 255, 700, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
  	if getKeyState("mouse1") then stateKey = true else stateKey = false
		end
 	end
end

 

Edited by liwahadri
Link to comment

You pretty much wanna do something like this.

function testImage()
    dxDrawImage(0,0,50,50,"image.png")
end

function createOnClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement )
        if ( clickedElement ) then
            addEventHandler("onClientRender",root,testImage)
        end
end
addEventHandler ( "onClientClick", getRootElement(), createOnClick )

 

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