Functions

Below you will find documentation about the global namespace functions that the Addons plugin exposes for addons to make use of when needed. These functions are part of the global namespace, thus they can be called directly without any prefix or namespace required. Other functions can be found within various namespaces. To see information on the available namespaces and their functions, please visit the namespaces documentation page.


AddIncomingPacket

Sends a packet to the client as if the server had sent it.

function AddIncomingPacket(id, packet);

Parameters

  • id - (number) The id of the packet being sent.
  • packet - (table) The packet data.

Returns

  • None

AddIncomingPacket

Sends a packet to the server as if the client had sent it.

function AddOutgoingPacket(id, packet);

Parameters

  • id - (number) The id of the packet being sent.
  • packet - (table) The packet data.

Returns

  • None

ParseAutoTranslate

Parses a string for auto-translate tags and converts them.

function ParseAutoTranslate(msg, useBrackets);

Parameters

  • msg - (string) The chat message to parse the auto-translate tags within.
  • useBrackets - (bool) True if the resulting string should include the brackets, false otherwise.

Returns

  • string - The parsed string.

GetEntity

Obtains an entity object from the given index.

function GetEntity(index);

Parameters

  • index - (number) The index of the entity to obtain.

Returns

  • object - The entity object if valid, nil otherwise.

GetPlayerEntity

Obtains the player entity object.

function GetPlayerEntity();

Parameters

  • None

Returns

  • object - The entity object if valid, nil otherwise.