kuwalda Posted May 22, 2014 Share Posted May 22, 2014 Hello everyone, I have a bit complicated situation over here. Basiclly I have MYSQL account system witch works fine, it asks for users username and password when it`s activated by "onPlayerJoin" event. Everything is good until server dosen`t ask client to download anything, with that I mean: * player joins server * player download resources * nothing comes forward, login request isn`t incomming And then if you recconect to server everything is working smooth, but it messes up my Account system. I`ve been trying using "onClientResourceStart" ,but either I messed up with it or it isn`t right solution for me. So in conclusion what I wanted to ask - how do you trigger login request event after all files have been downloaded. Or maybe someone else have better solution. If someone wants, here is brief code explanation: --server event (this works 100% of times) addEventHandler("onPlayerJoin", getRootElement(), function() triggerClientEvent(source, "onJoin", getRootElement()) outputChatBox("Event triggered", player, 255, 255, 255) end ) --and after comes client side event, whitch is working after 2nd time of joining function playerJoin() setCameraMatrix(...) guiSetVisible( login_register_window, true ) showCursor(true) guiSetInputEnabled(true) fadeCamera(source, true, 5) outputChatBox("Event triggered", player, 255, 255, 255) end addEvent("onJoin", true) addEventHandler("onJoin", getRootElement(), playerJoin) Link to comment
Karuzo Posted May 22, 2014 Share Posted May 22, 2014 Try to use the event onclientresourcestart and then show up your gui. Link to comment
kuwalda Posted May 22, 2014 Author Share Posted May 22, 2014 Nice, thank you - it worked. Still one more small question - why my setCameraMatrix isn`t working? addEventHandler( "onClientResourceStart", getRootElement( ), function ( ) setCameraMatrix(localPlayer, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) guiSetVisible( login_register_window, true ) showCursor(true) guiSetInputEnabled(true) fadeCamera(source, true, 5) end ); I tried changing localPlayer to many other variables, but still no change, just black screen. Link to comment
Karuzo Posted May 22, 2014 Share Posted May 22, 2014 Ofcourse. setCameraMatrix doesn't need a player argument clientside. so just delete the localPlayer. 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