Scripting/Squirrel/Functions/Vehicles/CreateVehicle

From VC-MP Wiki

Jump to: navigation, search

This creates a vehicle in the VCMP world.

Syntax

vehicle CreateVehicle( int model, vector pos, float angle, int col1, int col2 )

Arguments

  • model - Model of the vehicle to create
  • pos - Where to create the vehicle
  • angle - The angle the vheicle will be created at
  • col1 - The first colour of the vehicle
  • col2 - The second colour of the vehicle

Note

Vehicle colours can be set to -1 to generate a random colour

Example

A white PCJ-600 bike will be created when the player spawns...

function onPlayerSpawn( player )
{
     CreateVehicle( 191, player.Pos, player.Angle, 1, 1 );
}

Notes

The call onPlayerSpawn and functions Player.Pos, Player.Angle were used in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting