GamerDeMTA Posted May 28, 2013 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
manve1 Posted May 28, 2013 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 Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted May 28, 2013 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted May 28, 2013 Author 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
Castillo Posted May 28, 2013 Posted May 28, 2013 Not possible, it hides it after it gets created. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted May 28, 2013 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted May 28, 2013 Author Posted May 28, 2013 But i put that and when I join I see the GUI. without press it. also i dont see cursor
Castillo Posted May 28, 2013 Posted May 28, 2013 You must be using another script, because I just tested it again and it works. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted May 28, 2013 Author 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
GamerDeMTA Posted May 28, 2013 Author Posted May 28, 2013 oh, slender. the gamemode is in MTA community
LucasBaker Posted May 28, 2013 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)
Schlammy Posted May 29, 2013 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 Known Languages: [LUA][VB.NET][ASP.NET][C#][JAVA][C++] [sqlite][MSSQL][salesForce][bATCH][/center]
Moderators IIYAMA Posted May 29, 2013 Moderators 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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
GamerDeMTA Posted May 30, 2013 Author 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 !
GamerDeMTA Posted May 30, 2013 Author 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
GamerDeMTA Posted May 31, 2013 Author 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
Castillo Posted May 31, 2013 Posted May 31, 2013 You must have something else messing around with it, is it the only script on that resource? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted May 31, 2013 Author 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 )
PaiN^ Posted June 1, 2013 Posted June 1, 2013 I think that there is another resource stoping the cursor from showing . " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
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