justn Posted March 14, 2014 Posted March 14, 2014 (edited) Okay, so the problem is, when the player clicks the login button, and the player spawns, the screen shows only black, I want it so when the player clicks the 'Login' button and the player spawns, the camera will be on the player like normal. main_s.lua function assigntheteam () setPlayerTeam ( source, Unemployed ) thePlayer = spawnPlayer ( source, 1643.4000244141, -2249.1000976563, 13.300000190735, 0, 0, 178.000488, 0, 0, 0, Unemployed) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam ) main_c.lua addEventHandler("onClientGUIClick",RegisterLogin_Window, function(b) if b == "left" then if source == LoginButton then username = guiGetText(LoginUsername) password = guiGetText(LoginPass) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password) triggerServerEvent("IfNewPlayerJoin",getLocalPlayer()) xmlFileHandler() end end end) Edited March 14, 2014 by Guest
Wei Posted March 14, 2014 Posted March 14, 2014 function assigntheteam () setPlayerTeam ( source, Unemployed ) thePlayer = spawnPlayer ( source, 1643.4000244141, -2249.1000976563, 13.300000190735, 0, 0, 178.000488, 0, 0, 0, Unemployed) setCameraTarget(source, source) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam )
justn Posted March 14, 2014 Author Posted March 14, 2014 (edited) function assigntheteam () setPlayerTeam ( source, Unemployed ) thePlayer = spawnPlayer ( source, 1643.4000244141, -2249.1000976563, 13.300000190735, 0, 0, 178.000488, 0, 0, 0, Unemployed) setCameraTarget(source, source) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam ) Screen is still black Edited March 14, 2014 by Guest
Karuzo Posted March 14, 2014 Posted March 14, 2014 set the Player to dimension 0 or 1 dunno which was the normal one
Ab-47 Posted March 14, 2014 Posted March 14, 2014 set the Player to dimension 0 or 1 dunno which was the normal one Dimension 0 is default, where everything is. Also check if you're in interior 0 - MAIN
DNL291 Posted March 14, 2014 Posted March 14, 2014 @#Twerky, Try this: function assigntheteam () setPlayerTeam ( source, Unemployed ) spawnPlayer(source, 1643.40002, -2249.10009, 13.300, 178.0004, 0, 0, 0, Unemployed) fadeCamera(source, true) setCameraTarget(source, source) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam )
justn Posted March 14, 2014 Author Posted March 14, 2014 @#Twerky, Try this: function assigntheteam () setPlayerTeam ( source, Unemployed ) spawnPlayer(source, 1643.40002, -2249.10009, 13.300, 178.0004, 0, 0, 0, Unemployed) fadeCamera(source, true) setCameraTarget(source, source) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam ) Works now ! Thanks to all of you !
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