Chronic Posted November 13, 2013 Share Posted November 13, 2013 (edited) No errors in the debug, just does not work. function spawn ( thePlayer ) playerAccount = getPlayerAccount ( thePlayer ) skinid = getAccountData ( playerAccount, "skinid" ) if getAccountData ( playerAccount, "skinid" ) then spawnPlayer ( 0, 0, 5, 0, skinid ) elseif not getAccountData ( playerAccount, "skinid" ) then spawnPlayer ( 0, 0, 5 ) end end addEventHandler ( "onPlayerJoin", getRootElement(), spawn ) What I mean is, it doesn't spawn me when I join, just a black screen. Edited November 13, 2013 by Guest Link to comment
xXMADEXx Posted November 13, 2013 Share Posted November 13, 2013 use onPlayerLogin and replace "thePlayer" with "source." Link to comment
Chronic Posted November 13, 2013 Author Share Posted November 13, 2013 Hmm, no idea why this isn't working. function spawn ( ) playerAccount = getPlayerAccount ( source ) skinid = getAccountData ( playerAccount, "skinid" ) if getAccountData ( playerAccount, "skinid" ) then spawnPlayer ( source, 0, 0, 5, 0, skinid ) elseif not getAccountData ( playerAccount, "skinid" ) then spawnPlayer ( source, 0, 0, 5 ) end end Link to comment
xXMADEXx Posted November 13, 2013 Share Posted November 13, 2013 What event are you using? Link to comment
Chronic Posted November 13, 2013 Author Share Posted November 13, 2013 Ok, I'ved dumbed my script down to just function spawn ( ) spawnPlayer ( source, 0, 0, 5 ) end addEventHandler ( "onPlayerJoin", getRootElement(), spawn ) But it still doesn't work? Link to comment
xXMADEXx Posted November 13, 2013 Share Posted November 13, 2013 I was reading MTA wiki and it says this: Note: setCameraTarget must be used to focus on the player. Also, all players have their camera initially faded out after connect. To ensure that the camera is faded in, please do a fadeCamera after. Link to comment
Chronic Posted November 13, 2013 Author Share Posted November 13, 2013 Ahh, thank you Made, that solved my problem! Link to comment
xXMADEXx Posted November 13, 2013 Share Posted November 13, 2013 Ahh, thank you Made, that solved my problem! Welcome. 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