Sign in to follow this  
LeozinH1

Get ID of all players in Client side

Recommended Posts

Hello everyone, is there any way to get the ID of all the players next to the client? I need to show the ID of player in nametag. Thanks :D

Share this post


Link to post
Share on other sites

you need the Player::remoteId property

mp.events.add('render', () => {
	mp.players.forEachInStreamRange(player => {
      	const position = player.position;
    	mp.game.graphics.drawText(`${player.name} [${player.remoteId}]`, [position.x, position.y, position.z], { font: 4, color: [255, 255, 255, 255], scale: [0.5, 0.5], outline: true })  
    });
});

 

Edited by kemperrr
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, kemperrr said:

you need the Player::remoteId property

mp.events.add('render', () => {
	mp.players.forEachInStreamRange(player => {
      	const position = player.position;
    	mp.game.graphics.drawText(`${player.name} [${player.remoteId}]`, [position.x, position.y, position.z], { font: 4, color: [255, 255, 255, 255], scale: [0.5, 0.5], outline: true })  
    });
});

 

Thank you very much, my friend, I needed this a lot!

Share this post


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

  • Recently Browsing   0 members

    No registered users viewing this page.