Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Send an in-game message to a specific player, your alliance or everyone.

 

Syntax

chat(to,message);

Parameters

ParameterTypeMandatoryDescriptionGame version
to

Number,

Constant

(tick)

Who should the message be sent to?

  • Specify a player id to send to that specific player
  • Or use one of the following constants:
    Unable to render {children}. Page not found: Chat Scope.
3.2
messageString(tick)The message to send to the recipient.3.2

Return value

(question) It's not clear from the C++ code (to me at least) what the return values might be (sad)

Example

Send a message to your allies
chat(ALLIES,"Hello friends");
Send a message to player 2
// remember that players are zero-referenced, so player #1 = 0, player #2 = 1, etc.
chat(1,"Hello player 2");

Availability

Requires:

  • Warzone 3.2 and above.

See also

Related API features:

  • Player Scope – constants relating to chat messages
  • eventChat() – receive chat messages
  • console() – send a message to the script's player console
  • debug() – send a message to the terminal or logs

 

  • No labels