Check if global OOC enabled + add local OOC cmd
This commit is contained in:
@@ -112,7 +112,7 @@ function globalOOCCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getServerConfig().globalChatEnabled) {
|
if (!getServerConfig().globalChatEnabled) {
|
||||||
messagePlayerError(client, getLocaleString(client, "GlobalChatDisabled"));
|
messagePlayerError(client, getLocaleString(client, "GlobalChatDisabled"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -123,6 +123,23 @@ function globalOOCCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function localOOCCommand(command, params, client) {
|
||||||
|
if (isPlayerMuted(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
oocToNearbyPlayers(client, params);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function meActionCommand(command, params, client) {
|
function meActionCommand(command, params, client) {
|
||||||
if (isPlayerMuted(client)) {
|
if (isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
messagePlayerError(client, getLocaleString(client, "MutedCantChat"));
|
||||||
@@ -507,7 +524,7 @@ function oocToNearbyPlayers(client, messageText) {
|
|||||||
for (let i in clients) {
|
for (let i in clients) {
|
||||||
if (isPlayerSpawned(clients[i])) {
|
if (isPlayerSpawned(clients[i])) {
|
||||||
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().doActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
if (hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().doActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||||
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: {lightGrey}(( ${messageText} ))`, getPlayerColour(client));
|
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: {lightGrey}(( ${messageText} ))`, getPlayerColour(client));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user