Decreasing the chat region.

Started by Rardodus Bruise, Mar 30, 2020, 04:59 PM

Previous topic - Next topic

Rardodus Bruise

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.

NicusorN5

There was a keyboard key to do that, but there's no other way.

EnForcer


Xmair

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

Quote from: Xmair on Apr 08, 2020, 01:03 PMfunction 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 Apr 08, 2020, 07:16 AMPress F7 key
Thanks alot, Topic to be locked.