Jump to content

spawnPlayer (Help pls)


User1337

Recommended Posts

Hello,

I write a code that have to spawn a Player so a postion after he join the server but its not working.....

function spawnPed () 
    spawnPlayer ( source, -711, 957, 12.382266998291) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), spawnPed ) 

Link to comment
  • Moderators

Please read the wiki before asking for help, everything is explained and it would save time for you and for us !

From spawnPlayer Wiki page:

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.
function spawnPed () 
    spawnPlayer( source, -711, 957, 12.382266998291) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
end 
addEventHandler( "onPlayerJoin", getRootElement(), spawnPed ) 

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