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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.