duduRastaman Posted April 17, 2014 Share Posted April 17, 2014 (edited) Hey guys,i made a login/register panel and the problem is when 2 players connect, either one of them cant see the panel or sometimes, both cant see the panel, but when they dont connect at the same time, they can see it Everythin works fine with the registration and login. The only problem is that it dissapears when 2 players try to connect to server heres the client side code : The server side contains only the check for username and password . Help me plz. Thank you for your time. Edited April 17, 2014 by Guest Link to comment
Castillo Posted April 17, 2014 Share Posted April 17, 2014 Show the code that triggers the event: "hideWindow". Link to comment
.:HyPeX:. Posted April 17, 2014 Share Posted April 17, 2014 Show the code that triggers the event: "hideWindow". The only reason why this happens is basically the fact that the triggering is wrong, it is triggered on player join/etc, and it makes it close for the rest of players. Just remember to make the player source of the event hideWindow. function hidetheWindow() if source ~= getLocalPlayer() then return end guiSetInputEnabled(false) showCursor(false) guiSetVisible(darkpic, false) end addEvent("hideWindow", true) addEventHandler("hideWindow", root, hidetheWindow) Link to comment
Castillo Posted April 17, 2014 Share Posted April 17, 2014 No point in triggering it to all and then check if the source isn't the local player, he can simply specify in triggerClientEvent to who to trigger. Link to comment
.:HyPeX:. Posted April 17, 2014 Share Posted April 17, 2014 No point in triggering it to all and then check if the source isn't the local player, he can simply specify in triggerClientEvent to who to trigger. Its just an extra check, sometimes usefull. (if you call it by mistake for example). Link to comment
duduRastaman Posted April 17, 2014 Author Share Posted April 17, 2014 (edited) ok, heres the code, the serverside : BTW, thnks for the help guys, but understandin everythin wat wiki says is kinda hard for me but i always try my best. After makin postman,bus and taxi job, i decided to make the login panel, but i got this problem Edited April 17, 2014 by Guest Link to comment
Castillo Posted April 17, 2014 Share Posted April 17, 2014 triggerClientEvent("hideWindow", thePlayer) There's your problem, you are triggering the event for everyone. Change it to this: triggerClientEvent ( thePlayer, "hideWindow", thePlayer ) Link to comment
duduRastaman Posted April 17, 2014 Author Share Posted April 17, 2014 but omg if i had done it this way like : triggerClientEvent("hideWindow",thePlayer,thePlayer) -- im using the second thePlayer as argument to send to the hideWindow event then i use thePlayer as argument for the hideWindow event in the clientside, will it work?? bekoz thats wat i normally do for all my jobs Thnks for ur help man Link to comment
Castillo Posted April 17, 2014 Share Posted April 17, 2014 I don't really get what you mean. You send the player element and compare it to the local player? that can also work, but I'm not sure if it's efficient. Link to comment
duduRastaman Posted April 17, 2014 Author Share Posted April 17, 2014 yea thats wat i mean i send the player element as argument to the clientside and compare it, but if u sayin that u not sure if its efficient, i will start using triggerClientEvent the way u showed me.Thnk u very much bro U helped me a lot 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