SendClientEventToAll
The same event to every connected client.
The limits are those of SendClientEvent: a name of at most 64 bytes and a payload of at most 60000 bytes of UTF-8.
A bigger event is refused - nobody gets it, and the function returns false.
The payload may be a table, sent as its JSON, and the event reaches the pages of the players’ web interfaces like
SendClientEvent’s; a name that starts with kcdmp: is refused with false, "reserved name".
Syntax
Section titled “Syntax”SendClientEventToAll(name [, payload])| Parameter | Type | |
|---|---|---|
name |
string | the event’s name (at most 64 bytes) |
payload |
string | table | the string to send ("" without; at most 60000 bytes) - or a table, which is sent as its JSON (optional) |
Returns
Section titled “Returns”boolean - false when the event was refused for its size, for a reserved name or for a table that cannot be written as JSON (the reason is then a second value)
Example
Section titled “Example”SendClientEventToAll("round", tostring(round))See also
Section titled “See also”SendClientEvent · SetGlobalState · the Script events group of the index
