Jump to content

[SOLVED]Help with Spawning


Chronic

Recommended Posts

Posted (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 by Guest
Posted

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 
  

Posted

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?

Posted

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.

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