Use normal chat for now
This commit is contained in:
@@ -46,6 +46,7 @@ function unBindChatBoxKeys() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveChatBoxMessageFromServer(messageString, colour) {
|
function receiveChatBoxMessageFromServer(messageString, colour) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
|
||||||
let colouredString = replaceColoursInMessage(messageString);
|
let colouredString = replaceColoursInMessage(messageString);
|
||||||
|
|
||||||
if(bottomMessageIndex >= chatBoxHistory.length-1) {
|
if(bottomMessageIndex >= chatBoxHistory.length-1) {
|
||||||
|
|||||||
@@ -224,4 +224,11 @@ function onLocalPlayerSwitchWeapon(oldWeapon, newWeapon) {
|
|||||||
function onCameraProcess(event) {
|
function onCameraProcess(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function onChatOutput(event, messageText, colour) {
|
||||||
|
//event.preventDefault();
|
||||||
|
//receiveChatBoxMessageFromServer(messageText, colour);
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -16,28 +16,33 @@ function initChatScript() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processPlayerChat(client, messageText) {
|
function processPlayerChat(client, messageText) {
|
||||||
if(!getPlayerData(client)) {
|
if(!isConsole(client)) {
|
||||||
messagePlayerError(client, "You need to login before you can chat!");
|
if(!getPlayerData(client)) {
|
||||||
return false;
|
messagePlayerError(client, "You need to login before you can chat!");
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!isPlayerLoggedIn(client)) {
|
if(!isPlayerLoggedIn(client)) {
|
||||||
messagePlayerError(client, "You need to login before you can chat!");
|
messagePlayerError(client, "You need to login before you can chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isPlayerSpawned(client)) {
|
if(!isPlayerSpawned(client)) {
|
||||||
messagePlayerError(client, "You need to spawn before you can chat!");
|
messagePlayerError(client, "You need to spawn before you can chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayerMuted(client)) {
|
if(isPlayerMuted(client)) {
|
||||||
messagePlayerError(client, "You are muted and can't chat!");
|
messagePlayerError(client, "You are muted and can't chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageText = messageText.substring(0, 128);
|
|
||||||
|
|
||||||
|
messageText = messageText.substring(0, 128);
|
||||||
|
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
|
||||||
|
} else {
|
||||||
|
messagePlayerNormal(null, `🛡️ (ADMIN) - ${messageText}`);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
@@ -48,7 +53,7 @@ function processPlayerChat(client, messageText) {
|
|||||||
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
|
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
|
|
||||||
//messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
|
//messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -520,9 +520,8 @@ function sendPlayerRemoveFromVehicle(client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendChatBoxMessageToPlayer(client, message, colour) {
|
function sendChatBoxMessageToPlayer(client, messageText, colour) {
|
||||||
sendNetworkEventToPlayer("vrr.m", client, message, colour)
|
messageClient(messageText, client, colour);
|
||||||
//messageClient(message, client, colour);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -37,7 +37,15 @@ function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
|
|||||||
// logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
|
// logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
sendChatBoxMessageToPlayer(client, messageText, colour);
|
messageText = replaceColoursInMessage(messageText);
|
||||||
|
|
||||||
|
if(client == null) {
|
||||||
|
message(messageText, colour);
|
||||||
|
} else {
|
||||||
|
messageClient(messageText, client, colour);
|
||||||
|
}
|
||||||
|
|
||||||
|
//sendChatBoxMessageToPlayer(client, messageText, colour);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user