Entity::id: Difference between revisions
(Fixed grammar) |
|||
| Line 5: | Line 5: | ||
== Example == | == Example == | ||
{{ServerSide}} | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
const playerID = mp.players.at(1).id; | const playerID = mp.players.at(1).id; | ||
console.log(playerID); // Player ID, e.g. 1 ( ??? ) | console.log(playerID); // Player ID, e.g. 1 ( ??? ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Entity_block}} | {{Entity_block}} | ||
Revision as of 14:16, 16 January 2018
This property is used for getting an entity ID. The ID is a unique identifier for the entity.
Getter
- Number
Example
Server-Side
const playerID = mp.players.at(1).id;
console.log(playerID); // Player ID, e.g. 1 ( ??? )