Jump to content

Problem with bindKey


Recommended Posts

Posted
    function open () 
        vent = guiCreateWindow(485, 185, 314, 385, "WINDOW", false) 
        guiWindowSetSizable(vent, false) 
        guiSetVisible ( vent, false ) 
        imagen = guiCreateStaticImage(13, 133, 292, 120, "carm.png", false, vent)   
    end 
    addEventHandler ( 'onClientResourceStart', resourceRoot, open ) 
  
function windowopen ( ) 
    guiSetVisible ( vent, not guiGetVisible ( vent ) ) 
    showCursor ( guiGetVisible ( vent ) ) 
end 
bindKey ( 'f4', 'down', windowopen ) 

PS: I've other Buttons andEvents, but the problem is of the bind!

Posted
    function open () 
        vent = guiCreateWindow(485, 185, 314, 385, "WINDOW", false) 
        guiWindowSetSizable(vent, false) 
        guiSetVisible ( vent, false ) 
        imagen = guiCreateStaticImage(13, 133, 292, 120, "carm.png", false, vent)   
       bindKey ( 'f4', 'down', windowopen ) 
    end 
    addEventHandler ( 'onClientResourceStart', resourceRoot, open ) 
  
function windowopen ( ) 
    guiSetVisible ( vent, not guiGetVisible ( vent ) ) 
    showCursor ( guiGetVisible ( vent ) ) 
end 
  

Posted

The meta look fine.

It could be the other codes on the same file.

Check the debugscript 3 so you can know where is the problem.

Posted

I type "debugscript 3" in the Console and it says "debugscript: Incorrect client type for this command".

And the other code (server) works, it's just an outputChatBox when the players joins.

Posted

thanks all is fixed :D But now I've other problem :( the debugscript 3 says "@ addEventHandler error line 16, got nil" something like that. And this is:

    addEventHandler ("onClientGUIClick", e, ea, false) 
  
function ea () 
outputChatBox ("lol", source, 0, 255, 0, true) 
showCursor (true) 
end 

Posted

That's because there's no visible argument on the client side :

function ea () 
        outputChatBox ("lol", 0, 255, 0, true) 
        showCursor (true) 
end 
addEventHandler ("onClientGUIClick", e, ea, false) 
Posted

Yeah, but that doesn't has anything to do with the error he posted.

@GamerDeMTA: The problem was that you were trying to attach an event handler to a non-existent function.

Posted
Yeah, but that doesn't has anything to do with the error he posted.

@GamerDeMTA: The problem was that you were trying to attach an event handler to a non-existent function.

But it's a problem anyway and ( GamerDeMTA ) Should fix it .

Posted
Yeah, but that doesn't has anything to do with the error he posted.

@GamerDeMTA: The problem was that you were trying to attach an event handler to a non-existent function.

But this function exists :S

outputChatBox 

Posted
    function open () 
        vent = guiCreateWindow(485, 185, 314, 385, "WINDOW", false) 
        guiWindowSetSizable(vent, false) 
        guiSetVisible ( vent, false ) 
  
        a = guiCreateButton(9, 31, 296, 58, "e", false, vent) 
        b = guiCreateButton(9, 259, 296, 58, "e", false, vent) 
        c = guiCreateButton(13, 94, 77, 30, "ele", false, vent) 
        d = guiCreateButton(222, 94, 77, 30, "ee", false, vent) 
        e = guiCreateButton(13, 323, 77, 30, "eble", false, vent) 
        f = guiCreateButton(222, 323, 77, 30, "eeble", false, vent) 
        imagen = guiCreateStaticImage(13, 133, 292, 120, "carm.png", false, vent)   
        bindKey ( 'f4', 'down', windowopen ) 
    end 
  
function aa () 
outputChatBox ("YOU PRESSED THE FUCKINGG BUTTON", source, 0, 255, 0, true) 
showCursor (true) 
end 
  
  
function bb () 
outputChatBox ("YOU PRESSED THE FUCKINGG BUTTON !!", source, 255, 0, 0, true) 
showCursor (true) 
end 
  
function cc () 
outputChatBox ("YOU PRESSED THE FUCKINGG BUTTON", source, 0, 255, 0, true) 
showCursor (true) 
end 
  
function dd () 
outputChatBox ("YOU PRESSED THE FUCKINGG BUTTON.", source, 255, 0, 0, true) 
showCursor (true) 
end 
  
function windowopen ( ) 
    guiSetVisible ( vent, not guiGetVisible ( vent ) ) 
    showCursor ( guiGetVisible ( vent ) ) 
end 
  
    addEventHandler ( 'onClientResourceStart', resourceRoot, open ) 
    addEventHandler ("onClientGUIClick", a, aa, false) 
    addEventHandler ("onClientGUIClick", b, bb, false) 
    addEventHandler ("onClientGUIClick", c, cc, false) 
    addEventHandler ("onClientGUIClick", d, dd, false)    

Posted
    function open () 
        vent = guiCreateWindow(485, 185, 314, 385, "WINDOW", false) 
        guiWindowSetSizable(vent, false) 
        guiSetVisible ( vent, false ) 
        a = guiCreateButton(9, 31, 296, 58, "e", false, vent) 
        b = guiCreateButton(9, 259, 296, 58, "e", false, vent) 
        c = guiCreateButton(13, 94, 77, 30, "ele", false, vent) 
        d = guiCreateButton(222, 94, 77, 30, "ee", false, vent) 
        e = guiCreateButton(13, 323, 77, 30, "eble", false, vent) 
        f = guiCreateButton(222, 323, 77, 30, "eeble", false, vent) 
        addEventHandler ("onClientGUIClick", a, aa, false) 
        addEventHandler ("onClientGUIClick", b, bb, false) 
        addEventHandler ("onClientGUIClick", c, cc, false) 
        addEventHandler ("onClientGUIClick", d, dd, false)   
        imagen = guiCreateStaticImage(13, 133, 292, 120, "carm.png", false, vent)   
        bindKey ( 'f4', 'down', windowopen ) 
end 
addEventHandler ( 'onClientResourceStart', resourceRoot, open ) 
  
function aa () 
outputChatBox ("YOU PRESSED THE  BUTTON", 0, 255, 0, true) 
showCursor (true) 
end 
  
  
function bb () 
outputChatBox ("YOU PRESSED THE  BUTTON !!", 255, 0, 0, true) 
showCursor (true) 
end 
  
function cc () 
outputChatBox ("YOU PRESSED THE  BUTTON", 0, 255, 0, true) 
showCursor (true) 
end 
  
function dd () 
outputChatBox ("YOU PRESSED THE  BUTTON.", 255, 0, 0, true) 
showCursor (true) 
end 
  
function windowopen ( ) 
    guiSetVisible ( vent, not guiGetVisible ( vent ) ) 
    showCursor ( guiGetVisible ( vent ) ) 
end 

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