Entity::type: Difference between revisions

From RAGE Multiplayer Wiki
 
(5 intermediate revisions by 4 users not shown)
Line 3: Line 3:
==Available types:==
==Available types:==
*player
*player
*ped
*vehicle
*vehicle
*object
*object
Line 10: Line 11:
*marker
*marker
*colshape
*colshape
*textlabel


==Getter==
==Getter==
* '''<span style="color:#008017">String</span>'''
* {{RageType|String}}


== Example ==
== Example ==
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<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) // returns 'player'
</syntaxhighlight>
</syntaxhighlight>
</div>
}}


==See Also==
==See Also==
{{Entity_block}}
{{Entity_definition}}
 
[[Category:Entity API]]
[[Category:Server-side Property]]

Latest revision as of 14:49, 8 August 2020

Returns type of entity.

Available types:

  • player
  • ped
  • vehicle
  • object
  • pickup
  • blip
  • checkpoint
  • marker
  • colshape
  • textlabel

Getter

  • String

Example

Server-Side
const entity = mp.players.at(0);
console.log(entity.type) // returns 'player'

See Also