Scripting/Squirrel/Functions/Vehicles/CreateVehicle
From VC-MP Wiki
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
- CreateVehicle
- FindVehicle
- GetVehicleCount
- GetVehicleModelFromName
- GetVehicleNameFromModel
- Vehicle.Alarm
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.Fix
- Vehicle.Health
- Vehicle.ID
- Vehicle.IsLocked
- Vehicle.KillEngine
- Vehicle.Lights
- Vehicle.Model
- Vehicle.Pos
- Vehicle.Respawn
- Vehicle.RespawnAs
- Vehicle.RespawnAt
- Vehicle.SetFlatTyres
- Vehicle.SpawnPos
- Vehicle.SpawnAngle
- Vehicle.Velocity
- Vehicle.Remove
