Jump to content

If download is not complited, login won`t be asked


kuwalda

Recommended Posts

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

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

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...