OnPlayerChat: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{ScriptItem
{{ScriptItem2
|endpoint = shared
|name = onPlayerChat
|side = shared
|type = event
|type = event
|name = onPlayerChat
|games = iii vc sa iv
|usage = a player submits a chat message.<br>This excludes messages starting with a forward slash (the command character), where the command message is not displayed in the chat box
|desc = a player submits a chat message.<br>This event is not triggered for messages starting with the command character (a forward slash).<br>By default, chat messages (not chat commands) are displayed in the chat box for all players
|callbackParameters = Event event, Client client, string message
|arg1 = Client client The client that submitted a chat message.
|cancellable = true
|arg2 = string message The chat message.
|parameter1 = Client client The client that submitted a chat message.
|cancel = true
|parameter2 = string message The chat message.
}}
}}

Latest revision as of 03:38, 26 February 2024

Event Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline Cancellable

Available since Server 1.0.0, Client 1.0.0

onPlayerChat(Event event, Client client, string message)

The onPlayerChat event is invoked when a player submits a chat message.
This event is not triggered for messages starting with the command character (a forward slash).
By default, chat messages (not chat commands) are displayed in the chat box for all players.

Parameters

1) Event event The event object for this event.
2) Client client The client that submitted a chat message.
3) string message The chat message.

Attributes

cancellable This event can be cancelled, by using event.preventDefault.

Notes

There aren't any notes for this event.

Examples

There aren't any examples for this event.

Compatibility

There isn't any compatibility information for this event.

Related

Server Related

icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPlayerChat
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPlayerCommand
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPlayerConnect
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPlayerJoin
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPlayerJoined
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPlayerQuit


Client Related

OnPlayerJoin