Decreasing the chat region.

Rardodus Bruise

  • Newbie
  • Posts: 34
Decreasing the chat region.
«  »
I meant to say how we can compel the region/zone for a message, like people do with the shout command, How can we change it's radius.

Athanatos

  • Hero Member
  • Posts: 974

EnForcer

  • Newbie
  • Posts: 22

Xmair

  • Wiki Contributor
  • Posts: 951
Re: Decreasing the chat region.
« Reply #3,  »
Code: [Select]
function onPlayerCommand(player, cmd, text) {
if (cmd.tolower() == "shout") {
if (!text) return MessagePlayer("/shout <text>", player);
for(local i = 0; i < GetMaxPlayers(); ++i) {
local plr = FindPlayer(i);
if (plr && player.Pos.Distance(plr.Pos) < 20 /* radius, edit as you want */) {
MessagePlayer(format("[SHOUT]: [#%02X%02X%02X]%s%s: %s", player.Colour.r, player.Colour.g, player.Colour.b, player.Name, "[#FFFFFF]", text), player);
}
}
}
}

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Rardodus Bruise

  • Newbie
  • Posts: 34
Re: Decreasing the chat region.
« Reply #4,  »
Quote from Xmair on April 8th, 2020, 02:03 PM
Code: [Select]
function onPlayerCommand(player, cmd, text) {
if (cmd.tolower() == "shout") {
if (!text) return MessagePlayer("/shout <text>", player);
for(local i = 0; i < GetMaxPlayers(); ++i) {
local plr = FindPlayer(i);
if (plr && player.Pos.Distance(plr.Pos) < 20 /* radius, edit as you want */) {
MessagePlayer(format("[SHOUT]: [#%02X%02X%02X]%s%s: %s", player.Colour.r, player.Colour.g, player.Colour.b, player.Name, "[#FFFFFF]", text), player);
}
}
}
}
Quote from EnForcer on April 8th, 2020, 08:16 AM
Press F7 key
Thanks alot, Topic to be locked.