AMX Mod X API Documentation

Signature
native client_print_color(index, sender, const message[], any:...);
Description

Sends colored chat messages to clients.

Notes
  • This only works in Counter-Strike 1.6 and Condition Zero.
  • The colors can be modified inside of the format string using special

    characters. These characters can be included using the escape character

    green x04 ; use location color from this point forward

    red/blue/grey x03 ; use team color from this point forward

    red/blue/grey x02 ; use team color to the end of the client name

    ; This only works at the start of the string,

    ; and precludes using other control characters

    default x01 ; use default color from this point forward

  • The team color is defined by the sender's index. Alternatively, a

    specific team color can be enforced using the print_team_* constants in

    amxconst.inc

  • Usage examples:

    client_print_color(id, print_team_red, "^4Green ^3Red ^1Default")

    client_print_color(id, id2, "^4Green ^3id2's team color, ^1Default")

  • Including colors in ML can be done using the same escaping method:

    EXAMPLE_ML_KEY = ^4Green ^3Team color ^1Default

  • This functions return value behaves differently depending on what is

    used as the client index: If 0 is specified, then the function will

    return 0 if nothing has been sent (no client connected). If either a

    single client is specified, or there is at least one client connected,

    the number of printed characters will refer to the message that is sent

    last, to the client with the highest index.

Parameters
  • index Client index, use 0 to display to all clients
  • sender Client index used as the message sender
  • message Formatting rules
  • ... Variable number of formatting parameters
Returns

Number of printed characters

Errors
  • If a single client is specified and the index is not within

    the range of 1 to MaxClients, an error will be thrown.

Назад
Верх