Jump to content

Recommended Posts

Posted

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

Posted (edited)

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 2
Posted
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!

  • Like 1
  • Xabi locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...