Jump to content

[Solved] Camera Problem


justn

Recommended Posts

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 by Guest
Link to comment
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 ) 

Link to comment
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 by Guest
Link to comment

@#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 ) 

Link to comment
@#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 ! :P

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