Check if player spawned for prox chat
This commit is contained in:
@@ -152,10 +152,12 @@ function clanChatCommand(command, params, client) {
|
||||
function talkToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().talkDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerTalk(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -163,10 +165,12 @@ function talkToNearbyPlayers(client, messageText) {
|
||||
function phoneOutgoingToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().talkDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerNormal(`[#CCCCCC]${getCharacterFullName(client)} {ALTCOLOUR}(to phone): {MAINCOLOUR}${messageText}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -174,10 +178,12 @@ function phoneOutgoingToNearbyPlayers(client, messageText) {
|
||||
function phoneIncomingToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().phoneSpeakerDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerNormal(`[#CCCCCC]${getCharacterFullName(client)} {ALTCOLOUR}(from phone): {MAINCOLOUR}${messageText}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -185,10 +191,12 @@ function phoneIncomingToNearbyPlayers(client, messageText) {
|
||||
function whisperToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().whisperDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerWhisper(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -196,10 +204,12 @@ function whisperToNearbyPlayers(client, messageText) {
|
||||
function shoutToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().shoutDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerShout(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -207,10 +217,12 @@ function shoutToNearbyPlayers(client, messageText) {
|
||||
function megaphoneToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().megaphoneDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerShout(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -218,10 +230,12 @@ function megaphoneToNearbyPlayers(client, messageText) {
|
||||
function doActionToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
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]))) {
|
||||
messagePlayerDoAction(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -229,10 +243,12 @@ function doActionToNearbyPlayers(client, messageText) {
|
||||
function meActionToNearbyPlayers(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || (getDistance(getPlayerPosition(client), getPlayerPosition(clients[i])) <= getGlobalConfig().meActionDistance && getPlayerDimension(client) == getPlayerDimension(clients[i]))) {
|
||||
messagePlayerMeAction(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -240,10 +256,12 @@ function meActionToNearbyPlayers(client, messageText) {
|
||||
function clanChat(client, messageText) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(isPlayerSpawned(clients[i])) {
|
||||
if(hasBitFlag(getPlayerData(clients[i]).accountData.flags.moderation, getModerationFlagValue("CanHearEverything")) || arePlayersInSameClan(client, clients[i])) {
|
||||
messagePlayerClanChat(clients[i], client, messageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user