GamerDeMTA Posted May 28, 2013 Share Posted May 28, 2013 help me plss function open () vent = guiCreateWindow(485, 185, 314, 385, "lol", false) guiWindowSetSizable(vent, false) fy = guiCreateButton(9, 31, 296, 58, "xd", false, vent) wr = guiCreateButton(9, 259, 296, 58, "xd", false, vent) elely = guiCreateButton(13, 94, 77, 30, "xxd", false, vent) dblef = guiCreateButton(222, 94, 77, 30, "xxd", false, vent) ea = guiCreateButton(13, 323, 77, 30, "xxdd", false, vent) dblewa = guiCreateButton(222, 323, 77, 30, "xxdd", false, vent) imagen = guiCreateStaticImage(13, 133, 292, 120, "lol.png", false, vent) end addEventHandler('onClientResourceStart', g_ResRoot, function bind () bindKey('f1', 'down', windowopenn) createWindow(open) end ) function windowopenn() if isWindowOpen(vent) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() end end function windowopen () guiSetVisible (vent, not guiGetVisible ( vent ) ) showCursor (false) end addEventHandler ("onPlayerJoin", function () outputChatBox ("lol", 255, 255, 255, source, true) end end ^Problem: it dont show the gui when i press f1! and the outputchatbox dont show when player Joins Link to comment
manve1 Posted May 28, 2013 Share Posted May 28, 2013 (edited) there is no function called "isWindowOpen" use "guiGetVisible" and a lot more wrong stuff like events in your code Edited May 28, 2013 by Guest Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 That's because that doesn't make much sense, looks like you copied random code from other scripts. function open ( ) vent = guiCreateWindow(485, 185, 314, 385, "lol", false) guiWindowSetSizable(vent, false) guiSetVisible ( vent, false ) fy = guiCreateButton(9, 31, 296, 58, "xd", false, vent) wr = guiCreateButton(9, 259, 296, 58, "xd", false, vent) elely = guiCreateButton(13, 94, 77, 30, "xxd", false, vent) dblef = guiCreateButton(222, 94, 77, 30, "xxd", false, vent) ea = guiCreateButton(13, 323, 77, 30, "xxdd", false, vent) dblewa = guiCreateButton(222, 323, 77, 30, "xxdd", false, vent) imagen = guiCreateStaticImage(13, 133, 292, 120, "lol.png", false, vent) end addEventHandler ( 'onClientResourceStart', resourceRoot, open ) function windowopen ( ) guiSetVisible ( vent, not guiGetVisible ( vent ) ) showCursor ( guiGetVisible ( vent ) ) end bindKey ( 'f1', 'down', windowopen ) P.S: "onPlayerJoin" is server side. Link to comment
GamerDeMTA Posted May 28, 2013 Author Share Posted May 28, 2013 thanks but when i join it show the window, i want it as freeroam, you press and it opens. no when u join Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 Not possible, it hides it after it gets created. Link to comment
GamerDeMTA Posted May 28, 2013 Author Share Posted May 28, 2013 then how the Freeroam gui do it? Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 I'm saying that is impossible that the script shows the GUI when you join, it'll hide it when you join. Link to comment
GamerDeMTA Posted May 28, 2013 Author Share Posted May 28, 2013 But i put that and when I join I see the GUI. without press it. also i dont see cursor Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 You must be using another script, because I just tested it again and it works. Link to comment
GamerDeMTA Posted May 28, 2013 Author Share Posted May 28, 2013 ok fixed i used the FR gamemode and i think it bug, now i use other gamemode in the server buuuuut I can't ! when i press F1 it dont show Link to comment
GamerDeMTA Posted May 28, 2013 Author Share Posted May 28, 2013 oh, slender. the gamemode is in MTA community Link to comment
GamerDeMTA Posted May 28, 2013 Author Share Posted May 28, 2013 what is the problem¿¿? Link to comment
LucasBaker Posted May 28, 2013 Share Posted May 28, 2013 oh, slender. the gamemode is in MTA community also could not get it right explain? outputchatbox \/ you had not defined the function in parameter now try function ( source ) outputChatBox ("lol", 255, 255, 255, source, true) Link to comment
Schlammy Posted May 29, 2013 Share Posted May 29, 2013 i would create the gui when the player join and then hide it with guiSetVisible. With the command you can hide or show it using guiSetVisible Link to comment
Moderators IIYAMA Posted May 29, 2013 Moderators Share Posted May 29, 2013 oh, slender. the gamemode is in MTA community also could not get it right explain? outputchatbox \/ you had not defined the function in parameter now try function ( source ) outputChatBox ("lol", 255, 255, 255, source, true) You don't have to define a source. (wiki mta) "onPlayerJoin" Serverside event This event is triggered when a player joins the server. Parameters No parameters. Source The source of this event is the player who joined. Btw there is always a source when an event got triggered, but it isn't always a player. Link to comment
GamerDeMTA Posted May 30, 2013 Author Share Posted May 30, 2013 will some1 help me with the gui and bind? Link to comment
GamerDeMTA Posted May 30, 2013 Author Share Posted May 30, 2013 function open ( ) vent = guiCreateWindow(485, 185, 314, 385, "lol", false) guiWindowSetSizable(vent, false) guiSetVisible ( vent, false ) fy = guiCreateButton(9, 31, 296, 58, "xd", false, vent) wr = guiCreateButton(9, 259, 296, 58, "xd", false, vent) elely = guiCreateButton(13, 94, 77, 30, "xxd", false, vent) dblef = guiCreateButton(222, 94, 77, 30, "xxd", false, vent) ea = guiCreateButton(13, 323, 77, 30, "xxdd", false, vent) dblewa = guiCreateButton(222, 323, 77, 30, "xxdd", false, vent) imagen = guiCreateStaticImage(13, 133, 292, 120, "lol.png", false, vent) end addEventHandler ( 'onClientResourceStart', resourceRoot, open ) function windowopen ( ) guiSetVisible ( vent, not guiGetVisible ( vent ) ) showCursor ( guiGetVisible ( vent ) ) end bindKey ( 'f4', 'down', windowopen ) Help? When I press F4, it doesn't open the Window ! Link to comment
iPrestege Posted May 30, 2013 Share Posted May 30, 2013 Are u sure it's a client side ? Link to comment
GamerDeMTA Posted May 30, 2013 Author Share Posted May 30, 2013 It's as client-side in meta. Can you say me what's wrong in the lua? The bindKey doesn't work Link to comment
iPrestege Posted May 30, 2013 Share Posted May 30, 2013 I just test it and works well . Link to comment
GamerDeMTA Posted May 31, 2013 Author Share Posted May 31, 2013 ok fixed the problem now is... When I join it shows the Window and it dont show the cursor! i want when i press f4 no when join Link to comment
Castillo Posted May 31, 2013 Share Posted May 31, 2013 You must have something else messing around with it, is it the only script on that resource? Link to comment
GamerDeMTA Posted May 31, 2013 Author Share Posted May 31, 2013 yes a server side but it's only this addEventHandler ("onPlayerJoin", getRootElement(), function () outputChatBox ("Welcome xD", source, 255, 255, 255, true) end ) Link to comment
PaiN^ Posted June 1, 2013 Share Posted June 1, 2013 I think that there is another resource stoping the cursor from showing . 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