CowTurbo Posted February 18, 2011 Share Posted February 18, 2011 always get's stuck after that when i do something with guis Maybe someone can explain me what i have do wrong. Gui popup for every player when player joins and have logged in. code: Client: langWindow = guiCreateWindow(244,181,341,173,"Chose your language, please!",false) guiWindowSetMovable(langWindow,false) guiWindowSetSizable(langWindow,false) eng = guiCreateStaticImage(34,58,126,74,"images/images.jpeg",false,langWindow) est = guiCreateStaticImage(183,58,126,74,"images/images2.jpeg",false,langWindow) guiSetVisible ( langWindow, false ) function showWindow () if ( source == getLocalPlayer()) then guiSetVisible ( langWindow, true ) showCursor ( true ) end end addEvent ( "showWindow", true ) addEventHandler ( "showWindow", getRootElement(), showWindow ) Server: function login(username,password) local account = getAccount (username,password) if (account) then logIn (source,account,password) triggerClientEvent ("hideLogin",source, username, password) else triggerClientEvent (source,"infoUp",source,"Username/Password is invalid!") end end addEvent ("loginPlayer",true) addEventHandler ("loginPlayer",getRootElement(), login ) Hide login function have that triggerEvent ( "showWindow", getLocalPlayer() ) =) Link to comment
Timic Posted February 18, 2011 Share Posted February 18, 2011 Did you tried debugging? Link to comment
CowTurbo Posted February 18, 2011 Author Share Posted February 18, 2011 ofcourse, no errors Link to comment
Ryder! Posted February 18, 2011 Share Posted February 18, 2011 where is this code triggerEvent ( "showWindow", getLocalPlayer() ) post more try: triggerClientEvent (source,"hideLogin",source, username, password) Link to comment
CowTurbo Posted February 18, 2011 Author Share Posted February 18, 2011 function login(username,password) local account = getAccount (username,password) if (account) then logIn (source,account,password) triggerClientEvent ("hideLogin",source, username, password) else triggerClientEvent (source,"infoUp",source,"Username/Password is invalid!") end end addEvent ("loginPlayer",true) addEventHandler ("loginPlayer",getRootElement(), login ) Link to comment
SDK Posted February 20, 2011 Share Posted February 20, 2011 Do what Ryder! said, limit the triggerClientEvent to source only Link to comment
CowTurbo Posted February 20, 2011 Author Share Posted February 20, 2011 ya, i have changed, but can't test it, i don't have 2 computers. I hope it works =) thx for help. 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