Scripting/Squirrel/Functions/Vehicles/Colour2

From VC-MP Wiki

Jump to: navigation, search

This instance variable returns the secondary colour of the vehicle.

Syntax

int vehicle.Colour2

Example

This example will give the vehicle colours when someone types '/c carcol'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "carcol" )
     {
          local veh = player.Vehicle;
          
          if ( !veh ) MessagePlayer( "You are currently on foot." );
          else MessagePlayer( "Vehicle colours - Main: " + veh.Colour1 + ", secondary: " + veh.Colour2, player );
     }
}

Notes

The functions MessagePlayer, player.Vehicle, vehicle.Colour1 and call onPlayerEnterVehicle were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting