CreateVehicle

From RAGE Multiplayer Wiki
Revision as of 17:58, 12 December 2019 by Avoid (talk | contribs) (Created page with "Creates a vehicle on the given position. {{CSharpContainer| {{#tag:pre|void {{Template:CSharp_Serverside_namespace}}Vehicle.CreateVehicle(VehicleHash model, Vector3 position,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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]);

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

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.