FlyingSpoon Posted November 14, 2014 Share Posted November 14, 2014 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
roaddog Posted November 15, 2014 Share Posted November 15, 2014 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
Anubhav Posted November 15, 2014 Share Posted November 15, 2014 Just a small note, source is not trusted. You should use client instead of source. Link to comment
FlyingSpoon Posted November 15, 2014 Author Share Posted November 15, 2014 @Anubhav: Thank you for the suggestion, I have changed it! @NeverGiveup: Thanks for the fix! It worked +1 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