Players::broadcast: Difference between revisions
CocaColaBear (talk | contribs) No edit summary |
(→Syntax) |
||
| Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="typescript"> | <syntaxhighlight lang="typescript"> | ||
mp.players.broadcast(text); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''text:''' The text to be sent | *'''text:''' The text to be sent | ||
==Example== | ==Example== | ||
This example sends player message to all | This example sends player message to all | ||
Revision as of 09:55, 1 December 2019
This function writes a chat message for all players (like Player::outputChatBox).
Syntax
mp.players.broadcast(text);
Required Arguments
- text: The text to be sent
Example
This example sends player message to all
mp.events.addCommand("say", (player, message) => {
mp.players.broadcast(`Message from ${player.name}: ${message}`);
});
See Also
- Functions
- Players::broadcast
- Players::broadcastInDimension
- Players::broadcastInRange
- Players::call
- Players::callInDimension
- Players::callInRange
- Players::callUnreliable
- Players::callInDimensionUnreliable
- Players::callInRangeUnreliable
- Players::reloadResources
- Pool::apply
- Pool::at
- Pool::exists
- Pool::forEach
- Pool::forEachInDimension
- Pool::forEachInRange
- Pool::getClosest
- Pool::getClosestInDimension
- Pool::toArray
- Pool::toArrayFast