Jump to content

Player coords


Bogdan04

Recommended Posts

Hi, I'm trying to get a player coords.

mp.events.addCommand("pos", (player) => {
    new x;
    new y;
    new z;
    const localplayer = mp.players.local(new mp.Vector3(x, y, z));
    let pPos = localplayer.getCoords();

    mp.gui.chat.push("Coords: " + JSON.stringify(pPos));
});

But this does not work. Any help please?

Thank you.

Link to comment
Share on other sites

mp.events.addCommand("pos", (player) => {
    player.outputChatBox("Coords: " + JSON.stringify(player.position));
});

This should be all you need to output player's position. This is a server side script.

It looks like you were mixing server-side scripting with client-side scripting in your code. I'd suggest taking a look at the RageMP Wiki for some tips.

  • Like 1
Link to comment
Share on other sites

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