Extremo Posted March 30, 2009 Share Posted March 30, 2009 (edited) Alright so i was reading over the wiki and i am new to lua and mta in general. I decided i am going to make a basic gui window and create two tabs at the right side, register and login and thought i would place a image on the left side, its a full screen window. So i got alittle problem. I saw a function to create a static image, but obvisiously if the player is logged in, the gui Window is supposed to be removed and i dont want half of the screen to be filled by this image so basically, i need help about how to remove the image once its created or if there is any other way of creatign that image there? This might help: http://img406.imageshack.us/img406/6827 ... en0023.png so the left side which is empty = image. Edited March 31, 2009 by Guest Link to comment
darkdreamingdan Posted March 30, 2009 Share Posted March 30, 2009 It might be wise to paste your code. That said, what you're probably looking for is the guiSetVisible function, or if you want to delete it use destroyElement. Link to comment
Extremo Posted March 31, 2009 Author Share Posted March 31, 2009 So, thanks Talidan for your fast reply, theres no real code about this issue yet, i want to make sure that there is a way before i am going to do so. So regarding to your answer i am guessing you can set anything visibile and invisible with it. Thank you for your quick reply, I am going to test this right away Link to comment
Extremo Posted March 31, 2009 Author Share Posted March 31, 2009 Sorry for double post but i am guessing you cant change the visibility or either destroy a Image created over the function "guiCreateStaticImage"? is there any other way of creating a image? local RegisOrLoginImage = guiCreateStaticImage(0, 0.03, 0.5, 1, "LogReg.png", true) destroyElement(RegisOrLoginImage) No real success, also: local RegisOrLoginImage = guiCreateStaticImage(0, 0.03, 0.5, 1, "LogReg.png", true) guiSetVisible(RegisOrLoginImage, false) Nothing. The image still appears. Hope theres a other way of creating a image. Also, it could just be a function to create a image on a "guiCreateWindow". Help is appreciated Link to comment
50p Posted March 31, 2009 Share Posted March 31, 2009 Why don't you try to debug your code or use events for this. I'd recommend you use onClientResourceStart to create that image due to some issues with GUI elements created not in event (eg. simple 2 lines like yours)... They don't always/usually function when are created like you did. Link to comment
Extremo Posted March 31, 2009 Author Share Posted March 31, 2009 Obvisiously these two lines were just a example, i am using the event onClientResourceStart lol. Edit: Nvm, debug'd my code and found the problem. Stupid me >.< Link to comment
50p Posted March 31, 2009 Share Posted March 31, 2009 Try to debug it like: outputChatBox( tostring( guiSetVisible(RegisOrLoginImage, false) ) ); To check if guiSetVisible will return true. Link to comment
Extremo Posted March 31, 2009 Author Share Posted March 31, 2009 Already did, you may didnt notice my editing of my first post Thanks, i debug'd my code and found the problem. It was me being a moron.. Good that its not my first time coding/programming lol. Link to comment
50p Posted March 31, 2009 Share Posted March 31, 2009 I'd like you to take a look at this: https://forum.multitheftauto.com/viewtop ... 91&t=24122 You may find it useful Link to comment
Extremo Posted March 31, 2009 Author Share Posted March 31, 2009 Thanks for your offer 50p but i find the real gui easier on use tbh. Dunno why, guess its just because i've been scripting so much and its just all logic to me. I actually think yours is even more complicated lol. Anyway, guess this case is solved, i ama edit the topic name. Link to comment
maxx001 Posted March 31, 2009 Share Posted March 31, 2009 When you solve an issue, you really should post the solution so that others might benefit from this. Link to comment
Extremo Posted March 31, 2009 Author Share Posted March 31, 2009 My bad, basically their was no real solution, i had a script error right above "guiSetVisible" and had to fix it, also i tested if it works without calling a event and it doesnt. I would, as 50p said already, highly recommend you guys to use "onClientResourceStart". That was basically the solution. 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