Jump to content

[HELP] bindkey


scolen

Recommended Posts

Hi, I'm sending you a basic code that you can use to do it.
Maybe the code won't work, I haven't tested it, but try it.
local sx, sy = guiGetScreenSize()
local relx, rely = sx / 1920, sy / 1080

local Menu = false

addEventHandler("onClientRender", root, function()
    if (Menu) then

        dxDrawRectangle(sx * 0.35, sy * 0.4, sx * 0.3, sy * 0.4, tocolor(20, 30, 40, 200)) -- Alap
   
    end
end)

function OpenPanel()
	if not (Menu) then
		Menu = true
	else
		Menu = false 
	end	
end
bindKey("F6", "Down", OpenPanel)	

 

  • Thanks 1
Link to comment
local swidth,sheight=guiGetScreenSize()
local w,h=300,400

local myWindow
function createPanel()
    myWindow = guiCreateWindow(swidth/2-w/2,sheight/2-h/2,w,h,"My Window",false)
    --...
end

bindKey("f6","down",function()
    if not(myWindow)then
        createPanel()
    else
        destroyElement(myWindow)
        myWindow = nil
    end
end)

 

  • Thanks 1
Link to comment
14 hours ago, Firespider said:
Hi, I'm sending you a basic code that you can use to do it.
Maybe the code won't work, I haven't tested it, but try it.
local sx, sy = guiGetScreenSize()
local relx, rely = sx / 1920, sy / 1080

local Menu = false

addEventHandler("onClientRender", root, function()
    if (Menu) then

        dxDrawRectangle(sx * 0.35, sy * 0.4, sx * 0.3, sy * 0.4, tocolor(20, 30, 40, 200)) -- Alap
   
    end
end)

function OpenPanel()
	if not (Menu) then
		Menu = true
	else
		Menu = false 
	end	
end
bindKey("F6", "Down", OpenPanel)	

 

thanks brother ❤️

11 hours ago, _SAXI_ said:
local swidth,sheight=guiGetScreenSize()
local w,h=300,400

local myWindow
function createPanel()
    myWindow = guiCreateWindow(swidth/2-w/2,sheight/2-h/2,w,h,"My Window",false)
    --...
end

bindKey("f6","down",function()
    if not(myWindow)then
        createPanel()
    else
        destroyElement(myWindow)
        myWindow = nil
    end
end)

 

worked.. thanks brother ❤️

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