CreateVehicle: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Creates a vehicle on the given position. {{CSharpContainer| {{#tag:pre|void {{Template:CSharp_Serverside_namespace}}Vehicle.CreateVehicle(VehicleHash model, Vector3 position,...")
 
(Added parameters)
 
Line 2: Line 2:


{{CSharpContainer|
{{CSharpContainer|
{{#tag:pre|void {{Template:CSharp_Serverside_namespace}}Vehicle.CreateVehicle(VehicleHash model, Vector3 position, float rotation, int color1, int color2, [string numberPlate],[byte alpha],[bool locked]);}}
{{#tag:pre|void {{Template:CSharp_Serverside_namespace}}Vehicle.CreateVehicle(VehicleHash model, Vector3 position, float rotation, int color1, int color2, [string numberPlate],[byte alpha],[bool locked],[bool engineStatus], [uint dimension]);}}
{{Parameters}}
{{Parameters}}
*'''model:''' parameter input should be in '''VehicleHash''' type
*'''model:''' parameter input should be in '''VehicleHash''' type
Line 12: Line 12:
*'''alpha:''' parameter input should be in '''byte''' type
*'''alpha:''' parameter input should be in '''byte''' type
*'''locked:''' parameter input should be in '''bool''' 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}}
{{Example}}
{{#tag:syntaxhighlight|
{{#tag:syntaxhighlight|

Latest revision as of 18:00, 12 December 2019

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.