CreateVehicle
Creates a vehicle on the given position.
C# Syntax
void NAPI.Vehicle.CreateVehicle(VehicleHash model, Vector3 position, float rotation, int color1, int color2, [string numberPlate],[byte alpha],[bool locked],[bool engineStatus], [uint dimension]);
Parameters
- model: parameter input should be in VehicleHash type
- position: parameter input should be in Vector3 type
- rotation: parameter input should be in float type
- color1: parameter input should be in int type
- color2: parameter input should be in int type
- numberPlate: parameter input should be in string type
- alpha: parameter input should be in byte type
- locked: parameter input should be in bool type
- engineStatus: parameter input should be in bool type
- dimension: parameter input should be in uint type
Example
[Command("createveh")]
public void CreateVehicleCommand(Client player)
{
VehicleHash busModel = NAPI.Util.VehicleNameToModel("bus"); //Gets the hash of bus model
NAPI.Vehicle.CreateVehicle(busModel, player.Position, 0, 0, 0); //Creates a bus on the player's position
}
NAPI.