Sign in to follow this  
irinel1996

[HELP]getRootElement or getLocalPlayer?

Recommended Posts

Hi.

I wondered what is the best function to use, to give vehicles/wepoans/etc... to player.

Well, I mean what is the best way to define PLAYER. :roll:

I hope you have understood me.

_______________

Thanks.

Share this post


Link to post

What?

Define player?

Player is sometimes defined by default as source in some events like onPlayerjoin, and as an argument in some events like onPickupHit.

Or you can define it by name:

local player = getPlayerFromName ( "irinel" ) 

Share this post


Link to post
What?

Define player?

Player is sometimes defined by default as source in some events like onPlayerjoin, and as an argument in some events like onPickupHit.

Or you can define it by name:

local player = getPlayerFromName ( "irinel" ) 

For example here:

  
player = getRootElement() 
-- or 
player = getLocalPlayer() 
-- ? 
setElementPosition(player,-1604.5982666016,-498.20288085938,21.506694793701) 

getLocalPlayer is client only function, right? I should use it on my client.lua, really?

And use getRootElement in server.lua :roll:

Share this post


Link to post

getRootElement is not for that at all.

And yea use getLocalPlayer client side.

Read what I said again.

Share this post


Link to post

built-in root variable can be used as an alternative to getRootElement()

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.