GamerDeMTA Posted June 12, 2013 Share Posted June 12, 2013 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! Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 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 Link to comment
TAPL Posted June 12, 2013 Share Posted June 12, 2013 The script should be client-side, post your meta. Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 "GamerDeMTA" name="The SWindow" version="1.3" type="script" /> "carm.png" /> Link to comment
TAPL Posted June 12, 2013 Share Posted June 12, 2013 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. Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 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. Link to comment
TAPL Posted June 12, 2013 Share Posted June 12, 2013 This command is in-game only (F8). Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 Post the whole script ( client side ) . Link to comment
Castillo Posted June 12, 2013 Share Posted June 12, 2013 Client side script errors won't appear on the server console ( black window ), they'll only appear in the in-game debugscript. Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 thanks all is fixed 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 Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 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) Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 What is the difference? i only see you moved the addEventHandler to Down Link to comment
Castillo Posted June 12, 2013 Share Posted June 12, 2013 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. Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 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 . Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 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 outputChatBox Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 Please post the whole script . Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 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) Link to comment
TAPL Posted June 12, 2013 Share Posted June 12, 2013 outputChatBox client-side don't require player element. Check the wiki: https://wiki.multitheftauto.com/wiki/OutputChatBox Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 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 Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 it doesn't work yet.. Link to comment
GamerDeMTA Posted June 12, 2013 Author Share Posted June 12, 2013 Is the same as before, the @ AddEventHandler. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now