z0fa Posted February 2, 2012 Posted February 2, 2012 Hi, i'm trying to make a login form but i have some problems with the guiShowMessageBox function. I need the result of the question, for example if the player click yes i got 1. I write this code, but not work... local result = call(getResourceFromName("msgbox"),"guiShowMessageBox","Attenzione, effettuando l'accesso come ospite i dati della sessione corrente non verranno salvati, desideri continuare?","question","Guest login",true,"Continua","Annulla") if result == 1 then triggerServerEvent("doGuestLogin",getRootElement(),getLocalPlayer()) guiSetInputEnabled(false) guiSetVisible(loginform,false) showCursor(false) end
Castillo Posted February 2, 2012 Posted February 2, 2012 That function doesn't return any number value, it returns 3 GUI elements. buttonYes, buttonNo = call(getResourceFromName("msgbox"),"guiShowMessageBox","Attenzione, effettuando l'accesso come ospite i dati della sessione corrente non verranno salvati, desideri continuare?","question","Guest login",true,"Continua","Annulla") function onClick() if (source == buttonYes) then triggerServerEvent("doGuestLogin",localPlayer,localPlayer) guiSetInputEnabled(false) guiSetVisible(loginform,false) showCursor(false) elseif (source == buttonNo) then end end addEventHandler("onClientGUIClick",buttonYes,onClick,false) addEventHandler("onClientGUIClick",buttonNo,onClick,false) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted February 2, 2012 Posted February 2, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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