Weekend detect util

This commit is contained in:
Vortrex
2022-03-29 21:07:21 -05:00
parent 9d56bd79a0
commit c874bcffed

View File

@@ -1416,11 +1416,11 @@ function logToConsole(tempLogLevel, text) {
text = removeColoursInMessage(text); text = removeColoursInMessage(text);
} }
if((logLevel & tempLogLevel) || logLevel == LOG_ALL) { if((logLevel & tempLogLevel)) {
if(tempLogLevel == LOG_ERROR) { if(tempLogLevel & LOG_ERROR) {
console.error(text); console.error(text);
return true; return true;
} else if(tempLogLevel == LOG_WARN) { } else if(tempLogLevel & LOG_WARN) {
console.warn(text); console.warn(text);
return true; return true;
} else { } else {
@@ -2335,35 +2335,52 @@ function ArrayBufferToString(buffer) {
// =========================================================================== // ===========================================================================
function getElementTypeName(typeId) { function getElementTypeName(typeId) {
switch(typeId) { if(getGame() == VRR_GAME_MAFIA_ONE) {
case ELEMENT_VEHICLE: switch(typeId) {
return "Vehicle"; case ELEMENT_VEHICLE:
return "Vehicle";
case ELEMENT_OBJECT: case ELEMENT_PED:
return "Object"; return "Ped";
case ELEMENT_PED: case ELEMENT_PLAYER:
return "Ped"; return "Player Ped";
case ELEMENT_PLAYER: default:
return "Player Ped"; return "Unknown"
}
} else {
switch(typeId) {
case ELEMENT_VEHICLE:
return "Vehicle";
case ELEMENT_PICKUP: case ELEMENT_OBJECT:
return "Pickup"; return "Object";
case ELEMENT_BLIP: case ELEMENT_PED:
return "Blip"; return "Ped";
case ELEMENT_MARKER: case ELEMENT_PLAYER:
return "Marker"; return "Player Ped";
case ELEMENT_BUILDING: case ELEMENT_PICKUP:
return "Building"; return "Pickup";
default: case ELEMENT_BLIP:
return "Unknown" return "Blip";
case ELEMENT_MARKER:
return "Marker";
case ELEMENT_BUILDING:
return "Building";
default:
return "Unknown"
}
} }
return "Unknown"; return "Unknown";
} }
@@ -2776,4 +2793,11 @@ function replaceEmojiInString(messageString) {
return messageString; return messageString;
} }
// ===========================================================================
function isWeekend() {
let d = new Date();
return d.getDay() == 6 || d.getDay() == 0;
}
// =========================================================================== // ===========================================================================