Table of Contents

Interface INPCComponent.IManagedInterface

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

Represents the managed interface implemented by its unmanaged counterpart.

public interface INPCComponent.IManagedInterface : IUnmanagedInterface
Inherited Members

Methods

AddPointToPath(int, Vector3, float)

Adds a point with stop range to a path container.

bool AddPointToPath(int pathId, Vector3 position, float stopRange)

Parameters

pathId int
position Vector3
stopRange float

Returns

bool

ClearPath(int)

Removes all waypoints from a path container.

bool ClearPath(int pathId)

Parameters

pathId int

Returns

bool

CloseNode(int)

Closes a previously opened node file.

void CloseNode(int nodeId)

Parameters

nodeId int

Create(string)

Creates a controllable NPC with the given name. The NPC must be spawned via Spawn() separately before it appears in the world.

INPC Create(string name)

Parameters

name string

The NPC name (must follow the same rules as normal player names).

Returns

INPC

CreatePath()

Creates a new (empty) path container.

int CreatePath()

Returns

int

Destroy(INPC)

Destroys the given NPC. Required because NPC removal is more than a pool release.

void Destroy(INPC npc)

Parameters

npc INPC

DestroyAllPaths()

Destroys all path containers.

void DestroyAllPaths()

DestroyPath(int)

Destroys a previously created path container.

bool DestroyPath(int pathId)

Parameters

pathId int

Returns

bool

GetEventDispatcher()

Gets the event dispatcher for NPC-related events.

IEventDispatcher<INPCEventHandler> GetEventDispatcher()

Returns

IEventDispatcher<INPCEventHandler>

GetNodeInfo(int, out uint, out uint, out uint)

Gets information about vehicle nodes, pedestrian nodes, and navigation nodes in a node file.

bool GetNodeInfo(int nodeId, out uint vehicleNodes, out uint pedNodes, out uint naviNodes)

Parameters

nodeId int
vehicleNodes uint
pedNodes uint
naviNodes uint

Returns

bool

GetNodePointCount(int)

Gets the total number of points in a node.

int GetNodePointCount(int nodeId)

Parameters

nodeId int

Returns

int

GetNodePointPosition(int, out Vector3)

Gets the position of the current point in a node.

bool GetNodePointPosition(int nodeId, out Vector3 position)

Parameters

nodeId int
position Vector3

Returns

bool

GetNodeType(int)

Gets the type of a node.

byte GetNodeType(int nodeId)

Parameters

nodeId int

Returns

byte

GetPathCount()

Gets the total number of active path containers.

Size GetPathCount()

Returns

Size

GetPathPoint(int, Size, out Vector3, out float)

Gets the position and stop range of a waypoint at the specified index in a path.

bool GetPathPoint(int pathId, Size pointIndex, out Vector3 position, out float stopRange)

Parameters

pathId int
pointIndex Size
position Vector3
stopRange float

Returns

bool

GetPathPointCount(int)

Gets the number of waypoints in a path container.

Size GetPathPointCount(int pathId)

Parameters

pathId int

Returns

Size

GetRecordCount()

Gets the total number of loaded records.

Size GetRecordCount()

Returns

Size

HasPathPointInRange(int, Vector3, float)

Checks whether any waypoint in the path is within the given radius of the position.

bool HasPathPointInRange(int pathId, Vector3 position, float radius)

Parameters

pathId int
position Vector3
radius float

Returns

bool

IsNodeOpen(int)

Checks whether the specified node file is currently open.

bool IsNodeOpen(int nodeId)

Parameters

nodeId int

Returns

bool

IsValidPath(int)

Checks if a path id is valid.

bool IsValidPath(int pathId)

Parameters

pathId int

Returns

bool

IsValidRecord(int)

Checks if a record ID is valid.

bool IsValidRecord(int recordId)

Parameters

recordId int

Returns

bool

LoadRecord(string)

Loads a record file for playback. Returns the record id (or -1 on failure).

int LoadRecord(string filePath)

Parameters

filePath string

Returns

int

OpenNode(int)

Opens a node file for NPC path navigation.

bool OpenNode(int nodeId)

Parameters

nodeId int

Returns

bool

RemovePointFromPath(int, Size)

Removes a waypoint at the specified index from a path container.

bool RemovePointFromPath(int pathId, Size pointIndex)

Parameters

pathId int
pointIndex Size

Returns

bool

SetNodePoint(int, ushort)

Sets the current point within a node.

bool SetNodePoint(int nodeId, ushort pointId)

Parameters

nodeId int
pointId ushort

Returns

bool

UnloadAllRecords()

Unloads all loaded records.

void UnloadAllRecords()

UnloadRecord(int)

Unloads a previously loaded record.

bool UnloadRecord(int recordId)

Parameters

recordId int

Returns

bool