CreateCheckpoint

From GTA Network Wiki
Jump to: navigation, search

CreateCheckpoint
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Create a checkpoint

Syntax

Checkpoint NAPI.Checkpoint.CreateCheckpoint(uint/int/CheckpointType model, Vector3 pos, Vector3 dir, float scale, Color color [, uint dimension = NAPI.GlobalDimension ]);

Required Arguments

  • model: Model of the checkpoint. Parameter input should be in uint, int or CheckpointType type.
  • pos: Position of the checkpoint. Parameter input should be in Vector3 type.
  • dir: Direction of the checkpoint. Parameter input should be in Vector3 type.
  • scale: Scale of the checkpoint. Parameter input should be in float type.
  • color: Color of the checkpoint. Parameter input should be in Color type.

Optional Arguments

  • dimension: Dimension of the checkpoint. Parameter input should be in uint type.

Usage example(s)

In this example, a checkpoint will be created on the player who type the command "/cp".

[Command("cp")]
public void createCheckpoint(Client client, string commandArgs)
{
    var clientPosition = NAPI.Entity.GetEntityPosition(client);
    NAPI.Checkpoint.CreateCheckpoint(CheckpointType.Cyclinder, clientPosition, new Vector3(0, 1, 0), 1f, new Color(255, 0, 0), 0);
}

Changelog

Version Description
1.0 Release.

References