Entity::type: Difference between revisions
No edit summary |
|||
| Line 15: | Line 15: | ||
== Example == | == Example == | ||
{{ServerSide}} | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
const entity = mp.players.at(0); | const entity = mp.players.at(0); | ||
console.log(entity.type) // return 'player' | console.log(entity.type) // return 'player' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Entity_definition}} | {{Entity_definition}} | ||
Revision as of 14:40, 16 January 2018
Returns type of entity.
Available types:
- player
- vehicle
- object
- pickup
- blip
- checkpoint
- marker
- colshape
Getter
- String
Example
Server-Side
const entity = mp.players.at(0);
console.log(entity.type) // return 'player'