Scripting/Squirrel/Functions/Players/Seat

From VC-MP Wiki

Jump to: navigation, search

This instance variable returns which vehicle seat the player is occupying, or 255 if they are not in any vehicle.

Syntax

int player.Seat

Example

This command tells the player whether they are a passenger in a vehicle or not when they type '/c seat'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "passenger" )
     {
          if ( player.Seat != 255 ) MessagePlayer( "You are curently on seat number " + player.Seat, player );
          else MessagePlayer( "You are not in a vehicle.", player );
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting