Jump to content

msgbox result


z0fa

Recommended Posts

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 
  

Link to comment

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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...