Players::broadcastInRange: Difference between revisions
CocaColaBear (talk | contribs) (Created page with "This function writes a chat message for all players in range (like Player::outputChatBox). ==Syntax== <syntaxhighlight lang="typescript"> void players.broadcastInRange(Ve...") |
CocaColaBear (talk | contribs) No edit summary |
||
| Line 6: | Line 6: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''position:''' The position from which the broadcast will be sent. | |||
*'''range:''' The range from position. | |||
*'''text:''' The text to be sent. | *'''text:''' The text to be sent. | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
Revision as of 13:25, 17 April 2017
This function writes a chat message for all players in range (like Player::outputChatBox).
Syntax
void players.broadcastInRange(Vecto3 position, number range [, number dimension], string text);
Required Arguments
- position: The position from which the broadcast will be sent.
- range: The range from position.
- text: The text to be sent.
Optional Arguments
- dimension: The dimension in which the broadcast will be sent.
Example
This example sends message to all players in 15 units from the player
mp.events.addCommand("say", (player, message) => {
let pos = player.position;
mp.players.broadcastInRange(pos, 15, `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