Jump to content

Small register error!


FlyingSpoon

Recommended Posts

function registerHandler(player, username, password) 
    local account = getAccount(username, password) 
    if (account ~= false) then 
        triggerClientEvent(player, "registerTaken", getRootElement()) 
    else 
        account = addAccount(username, password) 
        if (logIn(player, account, password) == true) then 
            outputChatBox("Welcome to 'Zombie Apocalypse 1.0', Enjoy the BETA!", player, 0, 255, 0) 
            outputChatBox("Author(s): RaysMTA", player, 0, 255, 0) 
            spawnPlayer(source, 1959.55, -1714.46, 10) 
            fadeCamera (source, true) 
            setCameraTarget (source, source) 
            triggerClientEvent(player, "hideLoginWindow", getRootElement()) 
        else 
            triggerClientEvent(player, "unknownError", getRootElement()) 
        end 
    end 
end 

What I want is once, the player registers, they spawn in a certain place. I tried the code above ^ but it don't work after they register, you just get a blank screen!

Link to comment

you could set timer for the screen to fade out.

like this.

function registerHandler(player, username, password) 
    local account = getAccount(username, password) 
    if (account ~= false) then 
        triggerClientEvent(player, "registerTaken", getRootElement()) 
    else 
        account = addAccount(username, password) 
        if (logIn(player, account, password) == true) then 
            fadeCamera(source, false) 
            outputChatBox("Welcome to 'Zombie Apocalypse 1.0', Enjoy the BETA!", player, 0, 255, 0) 
            outputChatBox("Author(s): RaysMTA", player, 0, 255, 0) 
            triggerClientEvent(player, "hideLoginWindow", getRootElement()) 
            spawnPlayer(source, 1959.55, -1714.46, 10) 
            setCameraTarget (source, source) 
            setTimer(fadeCamera, 2000, 1, source, true) 
        else 
            triggerClientEvent(player, "unknownError", getRootElement()) 
        end 
    end 
end 
  

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