Client messaging

vcmpError PluginFuncs.SendClientScriptData(int32_t playerId, const void* data, size_t size)

Sends a stream of data to players to be processed by client-side scripts.

Parameters:
  • playerId (int32_t) – The ID of the player to send the data to, or -1 to send to all players
  • data (const void*) – The byte stream to send
  • size (size_t) – The size of the byte stream being sent
Raises:

vcmpErrorNoSuchEntity if the playerId is not -1 and no player with that ID can be found.

vcmpErrorNullArgument if data is null.

vcmpErrorTooLargeInput - reserved. Currently does not raise this error under any circumstances.

vcmpError PluginFuncs.SendClientMessage(int32_t playerId, uint32_t colour, const char* format, ...)

Sends a message to players to show in the console.

Parameters:
  • playerId (int32_t) – The ID of the player to send the message to, or -1 to send to all players
  • colour (uint32_t) – The base colour for the message in RGBA form.
  • format (const char*) – A printf format string
  • ... – The values to substitute into the format string, if needed
Raises:

vcmpErrorNoSuchEntity if the playerId is not -1 and no player with that ID can be found.

vcmpErrorNullArgument if format is null.

vcmpErrorTooLargeInput if the resulting string is longer than 8192 bytes (8 KiB).

vcmpError PluginFuncs.SendGameMessage(int32_t playerId, int32_t type, const char* format, ...)

Sends a game message to show text using Vice City’s text rendering.

Parameters:
  • playerId (int32_t) – The ID of the player to send the message to, or -1 to send to all players
  • format (const char*) – A printf format string
  • ... – The values to substitute into the format string, if needed
Raises:

vcmpErrorNoSuchEntity if the playerId is not -1 and no player with that ID can be found.

vcmpErrorNullArgument if format is null.

vcmpErrorTooLargeInput if the resulting string is longer than 8192 bytes (8 KiB).

See also:

game-message-types