Player::seat: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 4: Line 4:
== Example ==
== Example ==
<source lang="javascript">
<source lang="javascript">
if (player.seat)
if (player.vehicle && player.seat)
   player.outputChatBox('Your vehicle seat is ' + player.seat);
   player.outputChatBox('Your vehicle seat is ' + player.seat);
else
else
   player.outputChatBox('You are not in the vehicle right now!');
   player.outputChatBox('You are not in the vehicle right now!');
</source>
</source>

Revision as of 16:09, 8 February 2017

This property returns players vehicle seat or nil.

Note: this property is read-only.

Example

if (player.vehicle && player.seat)
  player.outputChatBox('Your vehicle seat is ' + player.seat);
else
  player.outputChatBox('You are not in the vehicle right now!');