Pool::remoteId
Client-Side Function
JavaScript Syntax
Remote ID is a server-side generated entity ID which you can get from client side. Whenever a shared-entity, let's say a blip is created on server-side a new ID is generated for them, you can access this ID on client side from remoteId property.
- Note: this property is read only.
Return value
- number
Syntax
mp.Entity.remoteId
Example
//an example of accessing player remote id when they're ready.
mp.events.add("playerReady", () => {
const remoteId = mp.players.local.remoteId;
mp.gui.chat.push(`Your remote id is: ${remoteId}`);
//find a player by their remote id.
const targetPlayer = mp.players.atRemoteId(20);
if (targetPlayer && mp.players.exists(targetPlayer)) {
//do what you want.
}
})