eventChat()

(info) Other great resources: Official JS API docs, Scripting Forum

eventChat()

This event is triggered each time a chat message is received.

 

Syntax

function eventChat(sender, to, message) { // do stuff }

Parameters

Parameter

Type

Mandatory

Description

sender

Number

The id of the player who sent the message

to

Number

The id of the player who received the message.

This will likely always be the same player as your script, eg. me, but might be one of the Player Scope constants in future releases.

message

String

The message that was sent

Return value

Warzone does not process the event handler return value currently.

However, there is some discussion about using the return value of the handler to control whether a chat message is echoed to the user's console.

Example

Reply to the person who sent the message
function eventChat(sender, to, message) { chat(sender, "I am a plasma cannon viper wheels, your argument is invalid");

 

Comments