diff --git a/meta.xml b/meta.xml
index 087714c1..58c7d8a1 100644
--- a/meta.xml
+++ b/meta.xml
@@ -10,7 +10,7 @@
-
+
@@ -50,6 +50,7 @@
+
@@ -100,13 +101,19 @@
-
+
+
+
+
-
+
+
+
+
diff --git a/scripts/client/chat.js b/scripts/client/chat.js
index c85140ce..13bc908d 100644
--- a/scripts/client/chat.js
+++ b/scripts/client/chat.js
@@ -73,8 +73,8 @@ function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, se
let outputString = messageString;
if (chatTimeStampsEnabled == true) {
- //timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
- let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}] `;
+ let colourRGBA = rgbaArrayFromToColour(colour);
+ let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] `;
outputString = `${timeStampString}${messageString}`;
}
@@ -163,12 +163,9 @@ function updateChatBox() {
if (typeof chatBoxHistory[i] != "undefined") {
let outputString = chatBoxHistory[i][0];
if (chatTimeStampsEnabled == true) {
- //let timeStampDate = new Date(chatBoxHistory[i][2]);
- //let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
- //let timeStampText = findResourceByName("agrp_time").exports.getTimeStampOutput(chatBoxHistory[i][2]);
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
-
- outputString = `{TIMESTAMPCOLOUR}[${timeStampText}]{MAINCOLOUR} ${chatBoxHistory[i][0]}`;
+ let colourRGBA = rgbaArrayFromToColour(chatBoxHistory[i][1]);
+ outputString = `{TIMESTAMPCOLOUR}[${timeStampText}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] ${chatBoxHistory[i][0]}`;
}
outputString = replaceColoursInMessage(outputString);
diff --git a/scripts/client/gui.js b/scripts/client/gui.js
index 2093a6d6..f0d06d73 100644
--- a/scripts/client/gui.js
+++ b/scripts/client/gui.js
@@ -62,6 +62,14 @@ function initGUI() {
initResetPasswordGUI();
initChangePasswordGUI();
initLocaleChooserGUI();
+ //initInventoryGUI();
+ //initInventoryBulkGUI();
+ //initClanManagerGUI();
+ //initBusinessManagerGUI();
+ //initHouseManagerGUI();
+ //initFiveCardPokerGUI();
+ //initBettingGUI();
+ //initBlackJackGUI();
closeAllWindows();
guiReady = true;
@@ -87,6 +95,14 @@ function closeAllWindows() {
passwordReset.window.shown = false;
passwordChange.window.shown = false;
localeChooser.window.shown = false;
+ //houseManager.window.shown = false;
+ //businessManager.window.shown = false;
+ //clanManager.window.shown = false;
+ //inventoryGUI.window.shown = false;
+ //inventoryBulkGUI.window.shown = false;
+ //bettingGUI.window.shown = false;
+ //blackJackGUI.window.shown = false;
+ //fiveCardPokerGUI.window.shown = false;
mexui.setInput(false);
mexui.focusedControl = false;
@@ -155,6 +171,38 @@ function isAnyGUIActive() {
return true;
}
+ //if (clanManager.window.shown == true) {
+ // return true;
+ //}
+
+ //if (businessManager.window.shown == true) {
+ // return true;
+ //}
+
+ //if (houseManager.window.shown == true) {
+ // return true;
+ //}
+
+ //if (inventoryGUI.window.shown == true) {
+ // return true;
+ //}
+
+ //if (inventoryBulkGUI.window.shown == true) {
+ // return true;
+ //}
+
+ //if (bettingGUI.window.shown == true) {
+ // return true;
+ //}
+
+ //if (blackJackGUI.window.shown == true) {
+ // return true;
+ //}
+
+ //if (fiveCardPokerGUI.window.shown == true) {
+ // return true;
+ //}
+
return false;
}
diff --git a/scripts/client/gui/games/5-card-poker.js b/scripts/client/gui/games/5-card-poker.js
deleted file mode 100644
index d254829b..00000000
--- a/scripts/client/gui/games/5-card-poker.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// ===========================================================================
-// Asshat Gaming Roleplay
-// https://github.com/VortrexFTW/agrp_main
-// (c) 2022 Asshat Gaming
-// ===========================================================================
-// FILE: 5cardpoker.js
-// DESC: Provides 5-card poker games GUI
-// TYPE: Client (JavaScript)
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/games/5cardpoker.js b/scripts/client/gui/games/5cardpoker.js
new file mode 100644
index 00000000..47ecbfa0
--- /dev/null
+++ b/scripts/client/gui/games/5cardpoker.js
@@ -0,0 +1,40 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: 5cardpoker.js
+// DESC: Provides 5-card poker games GUI
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let fiveCardPokerGUI = {
+ window: null,
+}
+
+function initFiveCardPokerGUI() {
+ // Render a five card poker game in MexUI
+ //logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating five-card poker GUI ...`);
+ fiveCardPokerGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Five Card Poker', {
+ main: {
+ backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
+ },
+ title: {
+ textSize: 11.0,
+ textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
+ backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
+ },
+ icon: {
+ textSize: 0.0,
+ textColour: toColour(0, 0, 0, 0),
+ backgroundColour: toColour(0, 0, 0, 0),
+ },
+ });
+ fiveCardPokerGUI.window.titleBarShown = false;
+
+ fiveCardPokerGUI.window.shown = false;
+
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created five card poker GUI`);
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/games/blackjack.js b/scripts/client/gui/games/blackjack.js
index ee0e7ad3..5d65747a 100644
--- a/scripts/client/gui/games/blackjack.js
+++ b/scripts/client/gui/games/blackjack.js
@@ -23,7 +23,7 @@ let dealerCards = [];
function initBlackJackGUI() {
// Render a blackjack game in MexUI
- //logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
blackJackGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Blackjack', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
@@ -43,7 +43,7 @@ function initBlackJackGUI() {
blackJackGUI.window.shown = false;
- //logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/inventory.js b/scripts/client/gui/inventory.js
new file mode 100644
index 00000000..fcfd1a45
--- /dev/null
+++ b/scripts/client/gui/inventory.js
@@ -0,0 +1,45 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: inventory.js
+// DESC: Provides inventory dialog box GUI
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let inventoryGUI = [
+ {
+ window: null,
+ },
+ {
+ window: null,
+ },
+];
+
+// ===========================================================================
+
+function initInventoryGUI() {
+
+}
+
+// ===========================================================================
+
+function closeAllInventoryGUI() {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all inventory GUI`);
+ for (let i in inventoryGUI) {
+ inventoryGUI[i].window.shown = false;
+ }
+ mexui.setInput(false);
+}
+
+// ===========================================================================
+
+function showInventoryGUI(inventoryIndex, items) {
+ closeAllWindows();
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing inventory window. Index: ${inventoryIndex}`);
+ inventoryGUI[inventoryIndex].window.shown = true;
+ mexui.setInput(true);
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/inventorybulk.js b/scripts/client/gui/inventorybulk.js
new file mode 100644
index 00000000..d311a5d9
--- /dev/null
+++ b/scripts/client/gui/inventorybulk.js
@@ -0,0 +1,45 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: inventorybulk.js
+// DESC: Provides bulk inventory box GUI
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let inventoryBulkGUI = [
+ {
+ window: null,
+ },
+ {
+ window: null,
+ },
+];
+
+// ===========================================================================
+
+function initInventoryBulkGUI() {
+
+}
+
+// ===========================================================================
+
+function closeAllInventoryBulkGUI() {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all bulk inventory GUI`);
+ for (let i in inventoryBulkGUI) {
+ inventoryBulkGUI[i].window.shown = false;
+ }
+ mexui.setInput(false);
+}
+
+// ===========================================================================
+
+function showInventoryBulkGUI(inventoryIndex, items) {
+ closeAllWindows();
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing bulk inventory window. Index: ${inventoryIndex}`);
+ inventoryBulkGUI[inventoryIndex].window.shown = true;
+ mexui.setInput(true);
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/localechooser.js b/scripts/client/gui/localechooser.js
index dc7dcdb5..db3b26e1 100644
--- a/scripts/client/gui/localechooser.js
+++ b/scripts/client/gui/localechooser.js
@@ -57,9 +57,6 @@ function closeLocaleChooserGUI() {
// ===========================================================================
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
- // Disabled for now until image loading crash can be fixed
- //return false;
-
if (position.x != 0.0 && position.y != 0.0) {
localeChooser.window.position = position;
} else {
@@ -79,7 +76,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
// ===========================================================================
function toggleLocaleChooserGUI() {
- if (localeChooser.window.shown) {
+ if (localeChooser.window.shown == true) {
closeLocaleChooserGUI();
} else {
showLocaleChooserGUI();
diff --git a/scripts/client/item.js b/scripts/client/item.js
index 5f371ee3..6513adb9 100644
--- a/scripts/client/item.js
+++ b/scripts/client/item.js
@@ -11,8 +11,8 @@
let itemActionDelayDuration = 0;
let itemActionDelayStart = 0;
let itemActionDelayEnabled = false;
-let itemActionDelayPosition = toVector2(0, game.height - 10);
-let itemActionDelaySize = toVector2(game.width, 10);
+let itemActionDelayPosition = toVector2(game.width / 2 - 100, game.height - 10);
+let itemActionDelaySize = toVector2(200, 5);
// ===========================================================================
@@ -38,8 +38,8 @@ function processItemActionRendering() {
let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
let backgroundColour = toColour(0, 0, 0, 255);
- graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x) - 1, itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 1], [itemActionDelaySize.x + 2, itemActionDelaySize.y + 2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
- graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
+ graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2) - 1, itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 1], [itemActionDelaySize.x + 2, itemActionDelaySize.y + 2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
+ graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
}
}
}
diff --git a/scripts/client/label.js b/scripts/client/label.js
index df01f09a..8721c13c 100644
--- a/scripts/client/label.js
+++ b/scripts/client/label.js
@@ -318,7 +318,7 @@ function processLabelRendering() {
}
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyLabelRenderDistance) {
- renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, getCurrencyString(business.buyPrice), getCurrencyString(business.rentPrice), business.labelInfoType);
+ renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, business.buyPrice, business.rentPrice, business.labelInfoType);
}
}
});
@@ -330,7 +330,7 @@ function processLabelRendering() {
}
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyLabelRenderDistance) {
- renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, getCurrencyString(house.buyPrice), getCurrencyString(house.rentPrice), house.labelInfoType);
+ renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, house.buyPrice, house.rentPrice, house.labelInfoType);
}
}
});
@@ -360,11 +360,11 @@ function processLabelRendering() {
let rentPrice = "0";
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
if (pickups[i].getData("agrp.label.price") != null) {
- price = getCurrencyString(pickups[i].getData("agrp.label.price"));
+ price = pickups[i].getData("agrp.label.price");
}
if (pickups[i].getData("agrp.label.rentprice") != null) {
- rentPrice = getCurrencyString(pickups[i].getData("agrp.label.rentprice"));
+ rentPrice = pickups[i].getData("agrp.label.rentprice");
}
if (pickups[i].getData("agrp.label.help") != null) {
diff --git a/scripts/client/sync.js b/scripts/client/sync.js
index d66f1cba..34cc7a78 100644
--- a/scripts/client/sync.js
+++ b/scripts/client/sync.js
@@ -111,7 +111,7 @@ function syncVehicleProperties(vehicle) {
vehicle.setSuspensionHeight(suspensionHeight);
}
- if (getGame() == AGRP_GAME_GTA_SA) {
+ if (isGameFeatureSupported("vehicleUpgrades")) {
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
//for(let i in allUpgrades) {
// vehicle.removeUpgrade(i);
@@ -146,7 +146,7 @@ function syncCivilianProperties(civilian) {
return false;
}
- if (getGame() == AGRP_GAME_GTA_III) {
+ if (isGameFeatureSupported("pedScale")) {
if (doesEntityDataExist(civilian, "agrp.scale")) {
let scaleFactor = getEntityData(civilian, "agrp.scale");
let tempMatrix = civilian.matrix;
@@ -165,7 +165,7 @@ function syncCivilianProperties(civilian) {
}
}
- if (getGame() == AGRP_GAME_GTA_III) {
+ if (getGame() == AGRP_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
civilian.walkStyle = walkStyle;
@@ -238,12 +238,32 @@ function syncCivilianProperties(civilian) {
// ===========================================================================
+function syncObjectProperties(object) {
+ if (!areServerElementsSupported()) {
+ return false;
+ }
+
+ if (isGameFeatureSupported("objectScale")) {
+ if (doesEntityDataExist(object, "agrp.scale")) {
+ let scaleFactor = getEntityData(object, "agrp.scale");
+ let tempMatrix = object.matrix;
+ tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
+ let tempPosition = object.position;
+ object.matrix = tempMatrix;
+ tempPosition.z += scaleFactor.z;
+ object.position = tempPosition;
+ }
+ }
+}
+
+// ===========================================================================
+
function syncPlayerProperties(player) {
if (!areServerElementsSupported()) {
return false;
}
- if (getGame() == AGRP_GAME_GTA_III) {
+ if (isGameFeatureSupported("pedScale")) {
if (doesEntityDataExist(player, "agrp.scale")) {
let scaleFactor = getEntityData(player, "agrp.scale");
let tempMatrix = player.matrix;
@@ -356,9 +376,17 @@ function syncElementProperties(element) {
return false;
}
- if (doesEntityDataExist(element, "agrp.interior")) {
- if (typeof element.interior != "undefined") {
- element.interior = getEntityData(element, "agrp.interior");
+ if (isGameFeatureSupported("interior")) {
+ if (doesEntityDataExist(element, "agrp.interior")) {
+ if (typeof element.interior != "undefined") {
+ element.interior = getEntityData(element, "agrp.interior");
+ }
+ }
+ }
+
+ if (isGameFeatureSupported("toggleCollision")) {
+ if (doesEntityDataExist(element, "agrp.collisions")) {
+ element.collisionsEnabled = getEntityData(element, "agrp.collisions");
}
}
@@ -393,6 +421,10 @@ function syncElementProperties(element) {
syncPlayerProperties(element);
break;
+ case ELEMENT_OBJECT:
+ syncObjectProperties(element);
+ break;
+
default:
break;
}
diff --git a/scripts/server/business.js b/scripts/server/business.js
index b24ef0a8..afe55c4d 100644
--- a/scripts/server/business.js
+++ b/scripts/server/business.js
@@ -316,7 +316,7 @@ function createBusinessCommand(command, params, client) {
getPlayerDimension(client),
getPlayerData(client).interiorScene);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`, true);
}
// ===========================================================================
@@ -351,7 +351,7 @@ function createBusinessLocationCommand(command, params, client) {
let tempBusinessLocationData = createBusinessLocation(locationType, businessId);
getServerData().businesses[businessId].push(tempBusinessLocationData);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created location {businessBlue}${params}{MAINCOLOUR} for business {businessBlue}${tempBusinessData.name}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created location {businessBlue}${params}{MAINCOLOUR} for business {businessBlue}${tempBusinessData.name}`, true);
}
// ===========================================================================
@@ -411,7 +411,7 @@ function deleteBusinessCommand(command, params, client) {
}
deleteBusiness(businessId, getPlayerData(client).accountData.databaseId);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted business {businessBlue}${getBusinessData(businessId).name}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted business {businessBlue}${getBusinessData(businessId).name}`, true);
}
// ===========================================================================
@@ -461,7 +461,7 @@ function setBusinessNameCommand(command, params, client) {
getBusinessData(businessId).name = newBusinessName;
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true);
}
// ===========================================================================
@@ -545,7 +545,7 @@ function setBusinessJobCommand(command, params, client) {
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true;
- messagePlayerSuccess(client, `{MAINCOLOUR}You set the owner of business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}to the {jobYellow}${getJobData(jobId).name}`);
+ messagePlayerSuccess(client, `{MAINCOLOUR}You set the owner of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to the {jobYellow}${getJobData(jobId).name}`);
}
// ===========================================================================
@@ -584,8 +584,9 @@ function setBusinessClanCommand(command, params, client) {
return false;
}
+ // Use confirm prompt
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
- getPlayerData(client).promptType = AGRP_PROMPT_BIZGIVETOCLAN;
+ getPlayerData(client).promptType = AGRP_PROMPT_GIVEBIZTOCLAN;
//getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
@@ -1064,7 +1065,7 @@ function setBusinessPickupCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} pickup display to {ALTCOLOUR}${typeParam}!`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} pickup to {ALTCOLOUR}${typeParam}!`, true);
}
// ===========================================================================
@@ -1102,7 +1103,7 @@ function setBusinessInteriorTypeCommand(command, params, client) {
getBusinessData(businessId).exitScene = "";
getBusinessData(businessId).exitPickupModel = -1;
getBusinessData(businessId).customInterior = false;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`, true);
return false;
}
@@ -1143,7 +1144,7 @@ function setBusinessInteriorTypeCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`, true);
}
// ===========================================================================
@@ -1202,7 +1203,7 @@ function addBusinessPropertyTemplateEntities(command, params, client) {
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} property template to {ALTCOLOUR}${typeParam}`, true);
}
// ===========================================================================
@@ -1247,7 +1248,7 @@ function setBusinessBlipCommand(command, params, client) {
resetBusinessBlips(businessId);
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} blip display to {ALTCOLOUR}${typeParam}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} blip to {ALTCOLOUR}${typeParam}`, true);
}
// ===========================================================================
@@ -1298,7 +1299,7 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
cacheBusinessItems(businessId);
updateBusinessPickupLabelData(businessId);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} the default items for ${toLowerCase(typeParam)}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} the default items for ${typeParam}`, true);
}
// ===========================================================================
@@ -1323,7 +1324,7 @@ function setBusinessDealershipCommand(command, params, client) {
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP;
updateBusinessPickupLabelData(businessId);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the business type of {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true);
}
// ===========================================================================
@@ -1352,7 +1353,7 @@ function deleteBusinessFloorItemsCommand(command, params, client) {
cacheBusinessItems(businessId);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all on-sale items for business {businessBlue}${getBusinessData(businessId).name}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all on-sale items for business {businessBlue}${getBusinessData(businessId).name}`, true);
}
// ===========================================================================
@@ -1381,7 +1382,7 @@ function deleteBusinessStorageItemsCommand(command, params, client) {
cacheBusinessItems(businessId);
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all stored items for business {businessBlue}${getBusinessData(businessId).name}`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted all storage items for business {businessBlue}${getBusinessData(businessId).name}`, true);
}
// ===========================================================================
@@ -1539,17 +1540,17 @@ function orderItemForBusinessCommand(command, params, client) {
let itemType = getItemTypeFromParams(splitParams.slice(0, -2).join(" "));
if (!getItemTypeData(itemType)) {
- messagePlayerError(client, `Invalid item type name or ID!`);
- messagePlayerInfo(client, `Use {ALTCOLOUR}/itemtypes {MAINCOLOUR}for a list of items`);
+ messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
+ messagePlayerInfo(client, `Use {ALTCOLOUR}/itemtypes{MAINCOLOUR} for a list of items`);
return false;
}
let pricePerItem = getOrderPriceForItemType(itemType);
let amount = toInteger(splitParams.slice(-2, -1)) || 1;
- let value = toInteger(splitParams.slice(-1)) || getItemTypeData(itemType).capacity;
+ let value = getItemTypeData(itemType).orderValue;
let businessId = getPlayerBusiness(client);
- logToConsole(LOG_DEBUG, `[AGRP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")} (${value})`);
+ logToConsole(LOG_DEBUG, `[AGRP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")}`);
if (!getBusinessData(businessId)) {
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
@@ -1567,11 +1568,10 @@ function orderItemForBusinessCommand(command, params, client) {
getPlayerData(client).businessOrderAmount = amount;
getPlayerData(client).businessOrderBusiness = businessId;
getPlayerData(client).businessOrderItem = itemType;
- getPlayerData(client).businessOrderValue = value;
getPlayerData(client).businessOrderCost = orderTotalCost;
getBusinessData(businessId).needsSaved = true;
- showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at ${getCurrencyString(pricePerItem)} each will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
+ showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
}
@@ -1659,7 +1659,7 @@ function buyBusinessCommand(command, params, client) {
}
showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
- getPlayerData(client).promptType = AGRP_PROMPT_BIZBUY;
+ getPlayerData(client).promptType = AGRP_PROMPT_BUYBIZ;
}
// ===========================================================================
@@ -1699,7 +1699,7 @@ function moveBusinessEntranceCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance to their position`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance to their position`, true);
}
// ===========================================================================
@@ -1737,7 +1737,7 @@ function moveBusinessExitCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true;
- messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR}exit to their position`);
+ messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} exit to their position`, true);
}
// ===========================================================================
diff --git a/scripts/server/casino.js b/scripts/server/casino.js
index 0a0299c4..bddcaadf 100644
--- a/scripts/server/casino.js
+++ b/scripts/server/casino.js
@@ -118,20 +118,7 @@ function blackJackHitCommand(command, params, client) {
hand.push(deck.pop());
- let tempHandValue = 0;
-
- for (let i in hand) {
- if (hand[i].value == 1) {
-
- if ((tempHandValue + 11) > 21) {
- tempHandValue += 1;
- } else {
- tempHandValue += 11;
- }
- } else {
- tempHandValue += hand[i].value;
- }
- }
+ let tempHandValue = getValueOfBlackJackHand(hand);
if (handValue > 21) {
playerBustBlackJack(client);
@@ -155,14 +142,6 @@ function blackJackStandCommand(command, params, client) {
// ===========================================================================
-function blackJackHit(hand, deck) {
-
-
- return handValue;
-}
-
-// ===========================================================================
-
function dealPlayerBlackJackHand(deck, players) {
// Alternate handing cards to each player, 2 cards each
for (var i = 0; i < 2; i++) {
@@ -174,4 +153,23 @@ function dealPlayerBlackJackHand(deck, players) {
}
}
+// ===========================================================================
+
+function calculateValueOfBlackJackHand(hand) {
+ let tempHandValue = 0;
+
+ for (let i in hand) {
+ if (hand[i].value == 1) {
+
+ if ((tempHandValue + 11) > 21) {
+ tempHandValue += 1;
+ } else {
+ tempHandValue += 11;
+ }
+ } else {
+ tempHandValue += hand[i].value;
+ }
+ }
+}
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/chat.js b/scripts/server/chat.js
index 152c9328..f8381793 100644
--- a/scripts/server/chat.js
+++ b/scripts/server/chat.js
@@ -174,7 +174,14 @@ function adminChatCommand(command, params, client) {
return false;
}
- messageAdmins(`{jobYellow}[Admin Chat] {ALTCOLOUR}${getPlayerName(client)}: ${params}`);
+ let clients = getClients();
+ for (let i in clients) {
+ if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
+ messagePlayerAdminChat(clients[i], client, params);
+ }
+ }
+
+ messageDiscordAdminChannel(`${getPlayerData(client).accountData.staffTitle} ${getPlayerData(client).accountData.name}: ${messageText}`);
}
// ===========================================================================
diff --git a/scripts/server/client.js b/scripts/server/client.js
index f9d154f9..d8b20f8b 100644
--- a/scripts/server/client.js
+++ b/scripts/server/client.js
@@ -266,7 +266,7 @@ function initClient(client) {
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"), getColourByName("softGreen"));
if (checkForGeoIPModule()) {
- let iso = module.geoip.getCountryISO(getPlayerIP(client));
+ let iso = module.geoip.getCountryISO(getGlobalConfig().geoIPCountryDatabaseFilePath, getPlayerIP(client));
let localeId = getLocaleFromCountryISO(iso);
if (localeId != 0) {
diff --git a/scripts/server/command.js b/scripts/server/command.js
index 6b45fe5a..d5342c76 100644
--- a/scripts/server/command.js
+++ b/scripts/server/command.js
@@ -353,6 +353,7 @@ function loadCommands() {
new CommandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "- ", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's order price (base price when ordering for a business"),
new CommandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "
- ", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's risk multiplayer (higher value for more dangerous or rare illegal items)"),
new CommandData("itemtypeenabled", toggleItemTypeEnabledCommand, "
- ", getStaffFlagValue("ManageItems"), true, false, "Toggles an item type on or off (if off, any items with that type can't be interacted with)"),
+ new CommandData("itemtypedropmodel", setItemTypeDropModelCommand, "
-