Merge branch 'nightly' into ragemp
This commit is contained in:
13
meta.xml
13
meta.xml
@@ -10,7 +10,7 @@
|
|||||||
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
|
<script src="scripts/shared/gamedata.js" type="client" language="javascript" />
|
||||||
|
|
||||||
<!-- Multiplayer Mod (Wrapped Natives) -->
|
<!-- Multiplayer Mod (Wrapped Natives) -->
|
||||||
<!-- The goal is to just swap only these out when I port the script to a new mod, like Oakwood -->
|
<!-- The goal is to just swap only these out when I port the script to a new MP mod -->
|
||||||
<script src="scripts/server/native/connected.js" type="server" language="javascript" />
|
<script src="scripts/server/native/connected.js" type="server" language="javascript" />
|
||||||
<script src="scripts/client/native/connected.js" type="client" language="javascript" />
|
<script src="scripts/client/native/connected.js" type="client" language="javascript" />
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@
|
|||||||
<script src="scripts/server/npc.js" type="server" language="javascript" />
|
<script src="scripts/server/npc.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/netevents.js" type="server" language="javascript" />
|
<script src="scripts/server/netevents.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/paintball.js" type="server" language="javascript" />
|
<script src="scripts/server/paintball.js" type="server" language="javascript" />
|
||||||
|
<script src="scripts/server/prompt.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/race.js" type="server" language="javascript" />
|
<script src="scripts/server/race.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/radio.js" type="server" language="javascript" />
|
<script src="scripts/server/radio.js" type="server" language="javascript" />
|
||||||
<script src="scripts/server/security.js" type="server" language="javascript" />
|
<script src="scripts/server/security.js" type="server" language="javascript" />
|
||||||
@@ -100,13 +101,19 @@
|
|||||||
<script src="scripts/client/gui/error.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/error.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/housemgr.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/housemgr.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/info.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/info.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/login.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/inventory.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/inventorybulk.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/list.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/list.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/login.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/localechooser.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/newchar.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/newchar.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/register.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/register.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/resetpass.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/resetpass.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/yesno.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/yesno.js" type="client" language="javascript" />
|
||||||
<script src="scripts/client/gui/localechooser.js" type="client" language="javascript" />
|
<script src="scripts/client/gui/games/blackjack.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/games/betting.js" type="client" language="javascript" />
|
||||||
|
<script src="scripts/client/gui/games/5cardpoker.js" type="client" language="javascript" />
|
||||||
|
|
||||||
|
|
||||||
<!-- Client Scripts -->
|
<!-- Client Scripts -->
|
||||||
<script src="scripts/client/afk.js" type="client" language="javascript" />
|
<script src="scripts/client/afk.js" type="client" language="javascript" />
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, se
|
|||||||
|
|
||||||
let outputString = messageString;
|
let outputString = messageString;
|
||||||
if (chatTimeStampsEnabled == true) {
|
if (chatTimeStampsEnabled == true) {
|
||||||
//timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
|
let colourRGBA = rgbaArrayFromToColour(colour);
|
||||||
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}] `;
|
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] `;
|
||||||
outputString = `${timeStampString}${messageString}`;
|
outputString = `${timeStampString}${messageString}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,12 +163,9 @@ function updateChatBox() {
|
|||||||
if (typeof chatBoxHistory[i] != "undefined") {
|
if (typeof chatBoxHistory[i] != "undefined") {
|
||||||
let outputString = chatBoxHistory[i][0];
|
let outputString = chatBoxHistory[i][0];
|
||||||
if (chatTimeStampsEnabled == true) {
|
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]}`;
|
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
|
||||||
|
let colourRGBA = rgbaArrayFromToColour(chatBoxHistory[i][1]);
|
||||||
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}]{MAINCOLOUR} ${chatBoxHistory[i][0]}`;
|
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] ${chatBoxHistory[i][0]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputString = replaceColoursInMessage(outputString);
|
outputString = replaceColoursInMessage(outputString);
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ function initGUI() {
|
|||||||
initResetPasswordGUI();
|
initResetPasswordGUI();
|
||||||
initChangePasswordGUI();
|
initChangePasswordGUI();
|
||||||
initLocaleChooserGUI();
|
initLocaleChooserGUI();
|
||||||
|
//initInventoryGUI();
|
||||||
|
//initInventoryBulkGUI();
|
||||||
|
//initClanManagerGUI();
|
||||||
|
//initBusinessManagerGUI();
|
||||||
|
//initHouseManagerGUI();
|
||||||
|
//initFiveCardPokerGUI();
|
||||||
|
//initBettingGUI();
|
||||||
|
//initBlackJackGUI();
|
||||||
|
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
guiReady = true;
|
guiReady = true;
|
||||||
@@ -87,6 +95,14 @@ function closeAllWindows() {
|
|||||||
passwordReset.window.shown = false;
|
passwordReset.window.shown = false;
|
||||||
passwordChange.window.shown = false;
|
passwordChange.window.shown = false;
|
||||||
localeChooser.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.setInput(false);
|
||||||
mexui.focusedControl = false;
|
mexui.focusedControl = false;
|
||||||
@@ -155,6 +171,38 @@ function isAnyGUIActive() {
|
|||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
|
||||||
// ===========================================================================
|
|
||||||
40
scripts/client/gui/games/5cardpoker.js
Normal file
40
scripts/client/gui/games/5cardpoker.js
Normal file
@@ -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`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -23,7 +23,7 @@ let dealerCards = [];
|
|||||||
|
|
||||||
function initBlackJackGUI() {
|
function initBlackJackGUI() {
|
||||||
// Render a blackjack game in MexUI
|
// 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', {
|
blackJackGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Blackjack', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
||||||
@@ -43,7 +43,7 @@ function initBlackJackGUI() {
|
|||||||
|
|
||||||
blackJackGUI.window.shown = false;
|
blackJackGUI.window.shown = false;
|
||||||
|
|
||||||
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
|
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
45
scripts/client/gui/inventory.js
Normal file
45
scripts/client/gui/inventory.js
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
45
scripts/client/gui/inventorybulk.js
Normal file
45
scripts/client/gui/inventorybulk.js
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -57,9 +57,6 @@ function closeLocaleChooserGUI() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
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) {
|
if (position.x != 0.0 && position.y != 0.0) {
|
||||||
localeChooser.window.position = position;
|
localeChooser.window.position = position;
|
||||||
} else {
|
} else {
|
||||||
@@ -79,7 +76,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleLocaleChooserGUI() {
|
function toggleLocaleChooserGUI() {
|
||||||
if (localeChooser.window.shown) {
|
if (localeChooser.window.shown == true) {
|
||||||
closeLocaleChooserGUI();
|
closeLocaleChooserGUI();
|
||||||
} else {
|
} else {
|
||||||
showLocaleChooserGUI();
|
showLocaleChooserGUI();
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
let itemActionDelayDuration = 0;
|
let itemActionDelayDuration = 0;
|
||||||
let itemActionDelayStart = 0;
|
let itemActionDelayStart = 0;
|
||||||
let itemActionDelayEnabled = false;
|
let itemActionDelayEnabled = false;
|
||||||
let itemActionDelayPosition = toVector2(0, game.height - 10);
|
let itemActionDelayPosition = toVector2(game.width / 2 - 100, game.height - 10);
|
||||||
let itemActionDelaySize = toVector2(game.width, 10);
|
let itemActionDelaySize = toVector2(200, 5);
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -38,8 +38,8 @@ function processItemActionRendering() {
|
|||||||
let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
|
let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
|
||||||
|
|
||||||
let backgroundColour = toColour(0, 0, 0, 255);
|
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 / 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), 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), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ function processLabelRendering() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyLabelRenderDistance) {
|
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) {
|
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 rentPrice = "0";
|
||||||
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
|
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
|
||||||
if (pickups[i].getData("agrp.label.price") != null) {
|
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) {
|
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) {
|
if (pickups[i].getData("agrp.label.help") != null) {
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function syncVehicleProperties(vehicle) {
|
|||||||
vehicle.setSuspensionHeight(suspensionHeight);
|
vehicle.setSuspensionHeight(suspensionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
if (isGameFeatureSupported("vehicleUpgrades")) {
|
||||||
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
|
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
|
||||||
//for(let i in allUpgrades) {
|
//for(let i in allUpgrades) {
|
||||||
// vehicle.removeUpgrade(i);
|
// vehicle.removeUpgrade(i);
|
||||||
@@ -146,7 +146,7 @@ function syncCivilianProperties(civilian) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_III) {
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
||||||
let tempMatrix = civilian.matrix;
|
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")) {
|
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
||||||
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
||||||
civilian.walkStyle = 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) {
|
function syncPlayerProperties(player) {
|
||||||
if (!areServerElementsSupported()) {
|
if (!areServerElementsSupported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_III) {
|
if (isGameFeatureSupported("pedScale")) {
|
||||||
if (doesEntityDataExist(player, "agrp.scale")) {
|
if (doesEntityDataExist(player, "agrp.scale")) {
|
||||||
let scaleFactor = getEntityData(player, "agrp.scale");
|
let scaleFactor = getEntityData(player, "agrp.scale");
|
||||||
let tempMatrix = player.matrix;
|
let tempMatrix = player.matrix;
|
||||||
@@ -356,9 +376,17 @@ function syncElementProperties(element) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doesEntityDataExist(element, "agrp.interior")) {
|
if (isGameFeatureSupported("interior")) {
|
||||||
if (typeof element.interior != "undefined") {
|
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||||
element.interior = getEntityData(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);
|
syncPlayerProperties(element);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ELEMENT_OBJECT:
|
||||||
|
syncObjectProperties(element);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ function createBusinessCommand(command, params, client) {
|
|||||||
getPlayerDimension(client),
|
getPlayerDimension(client),
|
||||||
getPlayerData(client).interiorScene);
|
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);
|
let tempBusinessLocationData = createBusinessLocation(locationType, businessId);
|
||||||
getServerData().businesses[businessId].push(tempBusinessLocationData);
|
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);
|
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;
|
getBusinessData(businessId).name = newBusinessName;
|
||||||
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
|
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
|
||||||
getBusinessData(businessId).needsSaved = 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).ownerId = getJobData(jobId).databaseId;
|
||||||
getBusinessData(businessId).needsSaved = true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use confirm prompt
|
||||||
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
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).ownerType = AGRP_BIZ_OWNER_CLAN;
|
||||||
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
|
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
|
||||||
@@ -1064,7 +1065,7 @@ function setBusinessPickupCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
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).exitScene = "";
|
||||||
getBusinessData(businessId).exitPickupModel = -1;
|
getBusinessData(businessId).exitPickupModel = -1;
|
||||||
getBusinessData(businessId).customInterior = false;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1143,7 +1144,7 @@ function setBusinessInteriorTypeCommand(command, params, client) {
|
|||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
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;
|
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);
|
resetBusinessBlips(businessId);
|
||||||
getBusinessData(businessId).needsSaved = true;
|
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);
|
cacheBusinessItems(businessId);
|
||||||
updateBusinessPickupLabelData(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).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
|
||||||
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP;
|
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP;
|
||||||
updateBusinessPickupLabelData(businessId);
|
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);
|
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);
|
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(" "));
|
let itemType = getItemTypeFromParams(splitParams.slice(0, -2).join(" "));
|
||||||
|
|
||||||
if (!getItemTypeData(itemType)) {
|
if (!getItemTypeData(itemType)) {
|
||||||
messagePlayerError(client, `Invalid item type name or ID!`);
|
messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
|
||||||
messagePlayerInfo(client, `Use {ALTCOLOUR}/itemtypes {MAINCOLOUR}for a list of items`);
|
messagePlayerInfo(client, `Use {ALTCOLOUR}/itemtypes{MAINCOLOUR} for a list of items`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let pricePerItem = getOrderPriceForItemType(itemType);
|
let pricePerItem = getOrderPriceForItemType(itemType);
|
||||||
|
|
||||||
let amount = toInteger(splitParams.slice(-2, -1)) || 1;
|
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);
|
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)) {
|
if (!getBusinessData(businessId)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||||
@@ -1567,11 +1568,10 @@ function orderItemForBusinessCommand(command, params, client) {
|
|||||||
getPlayerData(client).businessOrderAmount = amount;
|
getPlayerData(client).businessOrderAmount = amount;
|
||||||
getPlayerData(client).businessOrderBusiness = businessId;
|
getPlayerData(client).businessOrderBusiness = businessId;
|
||||||
getPlayerData(client).businessOrderItem = itemType;
|
getPlayerData(client).businessOrderItem = itemType;
|
||||||
getPlayerData(client).businessOrderValue = value;
|
|
||||||
getPlayerData(client).businessOrderCost = orderTotalCost;
|
getPlayerData(client).businessOrderCost = orderTotalCost;
|
||||||
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
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;
|
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"));
|
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;
|
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;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -118,20 +118,7 @@ function blackJackHitCommand(command, params, client) {
|
|||||||
|
|
||||||
hand.push(deck.pop());
|
hand.push(deck.pop());
|
||||||
|
|
||||||
let tempHandValue = 0;
|
let tempHandValue = getValueOfBlackJackHand(hand);
|
||||||
|
|
||||||
for (let i in hand) {
|
|
||||||
if (hand[i].value == 1) {
|
|
||||||
|
|
||||||
if ((tempHandValue + 11) > 21) {
|
|
||||||
tempHandValue += 1;
|
|
||||||
} else {
|
|
||||||
tempHandValue += 11;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tempHandValue += hand[i].value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handValue > 21) {
|
if (handValue > 21) {
|
||||||
playerBustBlackJack(client);
|
playerBustBlackJack(client);
|
||||||
@@ -155,14 +142,6 @@ function blackJackStandCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function blackJackHit(hand, deck) {
|
|
||||||
|
|
||||||
|
|
||||||
return handValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function dealPlayerBlackJackHand(deck, players) {
|
function dealPlayerBlackJackHand(deck, players) {
|
||||||
// Alternate handing cards to each player, 2 cards each
|
// Alternate handing cards to each player, 2 cards each
|
||||||
for (var i = 0; i < 2; i++) {
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -174,7 +174,14 @@ function adminChatCommand(command, params, client) {
|
|||||||
return false;
|
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}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ function initClient(client) {
|
|||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"), getColourByName("softGreen"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"), getColourByName("softGreen"));
|
||||||
|
|
||||||
if (checkForGeoIPModule()) {
|
if (checkForGeoIPModule()) {
|
||||||
let iso = module.geoip.getCountryISO(getPlayerIP(client));
|
let iso = module.geoip.getCountryISO(getGlobalConfig().geoIPCountryDatabaseFilePath, getPlayerIP(client));
|
||||||
let localeId = getLocaleFromCountryISO(iso);
|
let localeId = getLocaleFromCountryISO(iso);
|
||||||
|
|
||||||
if (localeId != 0) {
|
if (localeId != 0) {
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ function loadCommands() {
|
|||||||
new CommandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <order price>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's order price (base price when ordering for a business"),
|
new CommandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <order price>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's order price (base price when ordering for a business"),
|
||||||
new CommandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "<item type> <risk multiplier>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's risk multiplayer (higher value for more dangerous or rare illegal items)"),
|
new CommandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "<item type> <risk multiplier>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's risk multiplayer (higher value for more dangerous or rare illegal items)"),
|
||||||
new CommandData("itemtypeenabled", toggleItemTypeEnabledCommand, "<item type>", 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("itemtypeenabled", toggleItemTypeEnabledCommand, "<item type>", 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, "<item type> <object name/id>", getStaffFlagValue("ManageItems"), true, false, "Sets the drop model for the object of an item type when dropped"),
|
||||||
new CommandData("itemtypedroppos", setItemTypeDropPositionCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the offset position for the object of an item type when dropped"),
|
new CommandData("itemtypedroppos", setItemTypeDropPositionCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the offset position for the object of an item type when dropped"),
|
||||||
new CommandData("itemtypedroprot", setItemTypeDropRotationCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the rotation for the object of an item type when dropped"),
|
new CommandData("itemtypedroprot", setItemTypeDropRotationCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the rotation for the object of an item type when dropped"),
|
||||||
new CommandData("itemtypedropscale", setItemTypeDropScaleCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the scale for the object of an item type when dropped"),
|
new CommandData("itemtypedropscale", setItemTypeDropScaleCommand, "<item type> [x] [y] [z]", getStaffFlagValue("ManageItems"), true, false, "Sets the scale for the object of an item type when dropped"),
|
||||||
@@ -360,7 +361,7 @@ function loadCommands() {
|
|||||||
new CommandData("itemtypemaxval", setItemTypeMaxValueCommand, "<item type> <max value>", getStaffFlagValue("ManageItems"), true, false, "Sets the maximum value an item type can have"),
|
new CommandData("itemtypemaxval", setItemTypeMaxValueCommand, "<item type> <max value>", getStaffFlagValue("ManageItems"), true, false, "Sets the maximum value an item type can have"),
|
||||||
new CommandData("itemtypeorderval", setItemTypeOrderValueCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the initial value of an item type when ordered by a business"),
|
new CommandData("itemtypeorderval", setItemTypeOrderValueCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the initial value of an item type when ordered by a business"),
|
||||||
new CommandData("itemtypesize", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the item type's size"),
|
new CommandData("itemtypesize", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets the item type's size"),
|
||||||
new CommandData("itemtypecapacity", setItemTypeSizeCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's capacity (how much it can hold)"),
|
new CommandData("itemtypecapacity", setItemTypeCapacityCommand, "<item type> <order value>", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's capacity (how much it can hold)"),
|
||||||
|
|
||||||
new CommandData("delplritem", deleteItemInPlayerInventoryCommand, "<player name/id> <item slot>", getStaffFlagValue("ManageItems"), true, false, "Removes an item by slot from a player's personal inventory"),
|
new CommandData("delplritem", deleteItemInPlayerInventoryCommand, "<player name/id> <item slot>", getStaffFlagValue("ManageItems"), true, false, "Removes an item by slot from a player's personal inventory"),
|
||||||
new CommandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("ManageItems"), true, false, "Removes all items from a player's personal inventory"),
|
new CommandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("ManageItems"), true, false, "Removes all items from a player's personal inventory"),
|
||||||
@@ -634,7 +635,7 @@ function loadCommands() {
|
|||||||
new CommandData("vehowner", setVehicleOwnerCommand, "<player id/name>", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehowner", setVehicleOwnerCommand, "<player id/name>", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehpublic", setVehiclePublicCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehpublic", setVehiclePublicCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehclan", setVehicleClanCommand, "<clan id/name>", getStaffFlagValue(""), true, true),
|
new CommandData("vehclan", setVehicleClanCommand, "<clan id/name>", getStaffFlagValue(""), true, true),
|
||||||
new CommandData("vehbiz", setVehicleToBusinessCommand, "", getStaffFlagValue(""), true, true),
|
new CommandData("vehbiz", setVehicleBusinessCommand, "", getStaffFlagValue(""), true, true),
|
||||||
new CommandData("vehjob", setVehicleJobCommand, "[job id/name]", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehjob", setVehicleJobCommand, "[job id/name]", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehdelowner", removeVehicleOwnerCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
new CommandData("vehdelowner", removeVehicleOwnerCommand, "", getStaffFlagValue("ManageVehicles"), true, true),
|
||||||
new CommandData("vehrank", setVehicleRankCommand, "<rank id/name>", getStaffFlagValue("None"), true, true),
|
new CommandData("vehrank", setVehicleRankCommand, "<rank id/name>", getStaffFlagValue("None"), true, true),
|
||||||
@@ -785,12 +786,12 @@ function disableCommand(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (!getCommand(params)) {
|
if (!getCommand(params)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommand(params).enabled = false;
|
getCommand(params).enabled = false;
|
||||||
messagePlayerSuccess(client, `Command {ALTCOLOUR}/${params} {MAINCOLOUR}has been disabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} disabled the {ALTCOLOUR}${params}{MAINCOLOUR} command!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -805,12 +806,12 @@ function enableCommand(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (!getCommand(params)) {
|
if (!getCommand(params)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommand(params).enabled = true;
|
getCommand(params).enabled = true;
|
||||||
messagePlayerSuccess(client, `Command {ALTCOLOUR}/${params} {MAINCOLOUR}has been enabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} enabled the {ALTCOLOUR}${params}{MAINCOLOUR} command!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,7 +826,7 @@ function disableAllCommandsByType(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (isNull(getServerData().commands[params])) {
|
if (isNull(getServerData().commands[params])) {
|
||||||
messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`);
|
messagePlayerError(client, `Command type {ALTCOLOUR}${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -833,7 +834,7 @@ function disableAllCommandsByType(command, params, client) {
|
|||||||
getServerData().commands[params][i].enabled = false;
|
getServerData().commands[params][i].enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerSuccess(client, `{clanOrange}All {ALTCOLOUR}${params} {MAINCOLOUR}commands have been disabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} disabled all {ALTCOLOUR}${params}{MAINCOLOUR} commands!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,7 +849,7 @@ function enableAllCommandsByType(command, params, client) {
|
|||||||
params = toLowerCase(params);
|
params = toLowerCase(params);
|
||||||
|
|
||||||
if (isNull(getServerData().commands[params])) {
|
if (isNull(getServerData().commands[params])) {
|
||||||
messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`);
|
messagePlayerError(client, `Command type {ALTCOLOUR}${params}{MAINCOLOUR} does not exist!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -856,7 +857,7 @@ function enableAllCommandsByType(command, params, client) {
|
|||||||
getServerData().commands[params][i].enabled = true;
|
getServerData().commands[params][i].enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerSuccess(client, `{clanOrange}All {ALTCOLOUR}${params} {MAINCOLOUR}commands have been enabled!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} enabled all {ALTCOLOUR}${params}{MAINCOLOUR} commands!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ let globalConfig = {
|
|||||||
fishingCastMaxStrength: 100,
|
fishingCastMaxStrength: 100,
|
||||||
fishingCastMinStrength: 30,
|
fishingCastMinStrength: 30,
|
||||||
jobRouteLocationSphereRadius: 3,
|
jobRouteLocationSphereRadius: 3,
|
||||||
|
monthlyChanceOfSnow: [90, 50, 10, 0, 0, 0, 0, 0, 0, 0, 50, 90],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ function addLogLevelCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendPlayerLogLevel(null, logLevel);
|
sendPlayerLogLevel(null, logLevel);
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}enabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR} enabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ function removeLogLevelCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendPlayerLogLevel(null, logLevel);
|
sendPlayerLogLevel(null, logLevel);
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}disabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR} disabled log level {ALTCOLOUR}${toLowerCase(params)}`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ function simulateCommandForPlayerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!getCommand(tempCommand)) {
|
if (!getCommand(tempCommand)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} does not exist! Use /help for commands and information.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ function simulateCommandForAllPlayersCommand(command, params, client) {
|
|||||||
let tempParams = splitParams.slice(1).join(" ");
|
let tempParams = splitParams.slice(1).join(" ");
|
||||||
|
|
||||||
if (!getCommand(tempCommand)) {
|
if (!getCommand(tempCommand)) {
|
||||||
messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`);
|
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} does not exist! Use /help for commands and information.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,9 +441,9 @@ function testErrorGUICommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function saveServerDataCommand(command, params, client) {
|
function saveServerDataCommand(command, params, client) {
|
||||||
messageAdmins(`{adminOrange}Vortrex{MAINCOLOUR} has forced a manual save of all data. Initiating ...`);
|
messageAdmins(`{adminOrange}Vortrex{MAINCOLOUR} has forced a manual save of all data. Initiating ...`, true);
|
||||||
saveServerDataToDatabase();
|
saveServerDataToDatabase();
|
||||||
messageAdmins(`{MAINCOLOUR}All server data saved to database successfully!`);
|
messageAdmins(`{MAINCOLOUR}All server data saved to database successfully!`, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ function onPlayerQuit(event, client, quitReasonId) {
|
|||||||
|
|
||||||
logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (quitReasonId - ${reasonTextEnglish})`);
|
logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (quitReasonId - ${reasonTextEnglish})`);
|
||||||
//messageDiscordEventChannel(`👋 ${clientName} has left the server (${reasonTextEnglish})`);
|
//messageDiscordEventChannel(`👋 ${clientName} has left the server (${reasonTextEnglish})`);
|
||||||
messageDiscordEventChannel(getLanguageLocaleString(englishLocale, "PlayerLeftServer", clientName, reasonTextEnglish));
|
messageDiscordEventChannel(`👋 ${getLanguageLocaleString(englishLocale, "PlayerLeftServer", clientName, reasonTextEnglish)}`);
|
||||||
|
|
||||||
getClients().filter(c => c != client).forEach(forClient => {
|
getClients().filter(c => c != client).forEach(forClient => {
|
||||||
messagePlayerNormal(forClient, getLocaleString(forClient, "PlayerLeftServer", clientName, getGroupedLocaleString(forClient, "DisconnectReasons", disconnectName)));
|
messagePlayerNormal(forClient, getLocaleString(forClient, "PlayerLeftServer", clientName, getGroupedLocaleString(forClient, "DisconnectReasons", disconnectName)));
|
||||||
@@ -218,9 +218,10 @@ function onPedExitingVehicle(event, ped, vehicle) {
|
|||||||
function onResourceStart(event, resource) {
|
function onResourceStart(event, resource) {
|
||||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} started!`);
|
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} started!`);
|
||||||
|
|
||||||
//if(resource != thisResource) {
|
if (resource == thisResource) {
|
||||||
// messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} started!`);
|
//messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} started!`);
|
||||||
//}
|
messageDiscordEventChannel(`✅ Server is starting up!`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -237,6 +238,8 @@ function onResourceStop(event, resource) {
|
|||||||
saveServerDataToDatabase();
|
saveServerDataToDatabase();
|
||||||
disconnectFromDatabase(persistentDatabaseConnection, true);
|
disconnectFromDatabase(persistentDatabaseConnection, true);
|
||||||
collectAllGarbage();
|
collectAllGarbage();
|
||||||
|
|
||||||
|
messageDiscordEventChannel(`⛔ Server is shutting down!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +399,7 @@ function onPedSpawn(ped) {
|
|||||||
if (ped.type == ELEMENT_PLAYER) {
|
if (ped.type == ELEMENT_PLAYER) {
|
||||||
if (getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
|
if (getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) {
|
||||||
//setTimeout(onPlayerSpawn, 250, ped);
|
//setTimeout(onPlayerSpawn, 250, ped);
|
||||||
onPlayerSpawn();
|
//onPlayerSpawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -676,10 +679,6 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
|||||||
if (ped.isType(ELEMENT_PLAYER)) {
|
if (ped.isType(ELEMENT_PLAYER)) {
|
||||||
let client = getClientFromPlayerElement(ped);
|
let client = getClientFromPlayerElement(ped);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
//if (seat == AGRP_VEHSEAT_DRIVER) {
|
|
||||||
// vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
|
|
||||||
//}
|
|
||||||
|
|
||||||
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
|
||||||
|
|
||||||
stopRadioStreamForPlayer(client);
|
stopRadioStreamForPlayer(client);
|
||||||
@@ -733,7 +732,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
|
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
|
||||||
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
|
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
|
||||||
|
|
||||||
if (getVehicleData(vehicle).buyPrice > 0 && !doesPlayerHaveVehicleKeys(client, vehicle)) {
|
if (getVehicleData(vehicle).buyPrice > 0) {
|
||||||
messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`));
|
messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`));
|
||||||
resetVehiclePosition(vehicle);
|
resetVehiclePosition(vehicle);
|
||||||
} else if (getVehicleData(vehicle).rentPrice > 0) {
|
} else if (getVehicleData(vehicle).rentPrice > 0) {
|
||||||
@@ -765,7 +764,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AGRP_VEHOWNER_BIZ:
|
case AGRP_VEHOWNER_BIZ:
|
||||||
ownerName = getBusinessData(getVehicleData(vehicle).ownerId).name;
|
ownerName = getBusinessData(getBusinessIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
|
||||||
ownerType = getLocaleString(client, "Business");
|
ownerType = getLocaleString(client, "Business");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -8,19 +8,6 @@
|
|||||||
// TYPE: Server (JavaScript)
|
// TYPE: Server (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Prompts (used for client GUI prompt responses)
|
|
||||||
const AGRP_PROMPT_NONE = 0;
|
|
||||||
const AGRP_PROMPT_CREATEFIRSTCHAR = 1;
|
|
||||||
const AGRP_PROMPT_BIZORDER = 2;
|
|
||||||
const AGRP_PROMPT_GIVEVEHTOCLAN = 3;
|
|
||||||
const AGRP_PROMPT_GIVEBIZTOCLAN = 4;
|
|
||||||
const AGRP_PROMPT_GIVEHOUSETOCLAN = 5;
|
|
||||||
const AGRP_PROMPT_BUYBIZ = 6;
|
|
||||||
const AGRP_PROMPT_BUYHOUSE = 7;
|
|
||||||
const AGRP_PROMPT_RESETKEYBINDS = 8;
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function initGUIScript() {
|
function initGUIScript() {
|
||||||
logToConsole(LOG_INFO, "[AGRP.GUI]: Initializing GUI script ...");
|
logToConsole(LOG_INFO, "[AGRP.GUI]: Initializing GUI script ...");
|
||||||
logToConsole(LOG_INFO, "[AGRP.GUI]: GUI script initialized successfully!");
|
logToConsole(LOG_INFO, "[AGRP.GUI]: GUI script initialized successfully!");
|
||||||
@@ -28,266 +15,14 @@ function initGUIScript() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerPromptAnswerNo(client) {
|
function doesPlayerUseGUI(client) {
|
||||||
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
|
||||||
|
|
||||||
switch (getPlayerData(client).promptType) {
|
|
||||||
case AGRP_PROMPT_CREATEFIRSTCHAR:
|
|
||||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
|
||||||
showPlayerErrorGUI(client, getLocaleString(client, "DidNotCreateCharacter"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
|
|
||||||
getPlayerData(targetClient).customDisconnectReason = "FailedToCreateCharacter";
|
|
||||||
setTimeout(function () { disconnectPlayer(client); }, 5000);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BIZORDER:
|
|
||||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
|
||||||
if (canPlayerUseGUI(client)) {
|
|
||||||
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderCanceled"), getLocaleString(client, "Alert"));
|
|
||||||
} else {
|
|
||||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`);
|
|
||||||
messagePlayerError(client, getLocaleString(client, "BusinessOrderCanceled"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
showPlayerErrorGUI(client, getLocaleString(client, "NotOrderingAnyBusinessItems"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
messagePlayerError(client, getLocaleString(client, "NoPromptReject"));
|
|
||||||
submitBugReport(client, `[AUTOMATED REPORT] Tried to reject invalid prompt type: ${getPlayerData(client).promptType}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerPromptAnswerYes(client) {
|
|
||||||
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
|
||||||
|
|
||||||
switch (getPlayerData(client).promptType) {
|
|
||||||
case AGRP_PROMPT_CREATEFIRSTCHAR: {
|
|
||||||
showPlayerNewCharacterGUI(client);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BIZORDER: {
|
|
||||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
|
||||||
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
|
||||||
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderNotEnoughMoney"), getLocaleString(client, "BusinessOrderCanceled"));
|
|
||||||
getPlayerData(client).businessOrderAmount = 0;
|
|
||||||
getPlayerData(client).businessOrderBusiness = false;
|
|
||||||
getPlayerData(client).businessOrderItem = -1;
|
|
||||||
getPlayerData(client).businessOrderValue = -1;
|
|
||||||
} else {
|
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
|
||||||
|
|
||||||
showPlayerInfoGUI(client, getLocaleString(client, "BusinessOrderSuccessInfo", getPlayerData(client).businessOrderAmount, getItemTypeData(getPlayerData(client).businessOrderItem).name, getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue), getPlayerData(client).businessOrderCost), getLocaleString(client, "GUIInfoTitle"));
|
|
||||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
|
||||||
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
|
||||||
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
|
||||||
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
|
||||||
getPlayerData(client).businessOrderAmount = 0;
|
|
||||||
getPlayerData(client).businessOrderBusiness = false;
|
|
||||||
getPlayerData(client).businessOrderItem = -1;
|
|
||||||
getPlayerData(client).businessOrderValue = -1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
showPlayerErrorGUI(client, ``, `Business Order Canceled`);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_GIVEVEHTOCLAN: {
|
|
||||||
if (!isPlayerInAnyVehicle(client)) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeInVehicle"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getVehicleData(getPlayerVehicle(client))) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getVehicleData(getPlayerVehicle(client)).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN;
|
|
||||||
getVehicleData(getPlayerVehicle(client)).ownerId = getPlayerCurrentSubAccount(client).clan;
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "GaveVehicleToClan", getVehicleName(getPlayerVehicle(client))));
|
|
||||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_GIVEHOUSETOCLAN: {
|
|
||||||
let houseId = getPlayerHouse(client);
|
|
||||||
if (!houseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN;
|
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "GaveHouseToClan"));
|
|
||||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_GIVEBIZTOCLAN: {
|
|
||||||
let businessId = getPlayerBusiness(client);
|
|
||||||
if (!businessId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
|
||||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "GaveBusinessToClan"));
|
|
||||||
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BUYHOUSE: {
|
|
||||||
let houseId = getPlayerHouse(client);
|
|
||||||
if (!houseId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getHouseData(houseId).buyPrice <= 0) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "HouseNotForSale"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).cash < getHouseData(houseId).buyPrice) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "HousePurchaseNotEnoughMoney"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
|
||||||
getHouseData(houseId).buyPrice = 0;
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
|
||||||
updateHousePickupLabelData(houseId);
|
|
||||||
|
|
||||||
messageDiscordEventChannel(`🏘️ ${getCharacterFullName(client)} is now the owner of *${getHouseData(houseId).description}*!`);
|
|
||||||
messagePlayerSuccess(client, `🏘️ You are now the owner of {houseGreen}${getHouseData(houseId).description}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_BUYBIZ: {
|
|
||||||
let businessId = getPlayerBusiness(client);
|
|
||||||
if (!businessId) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getBusinessData(businessId).buyPrice <= 0) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "BusinessNotForSale"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getPlayerCurrentSubAccount(client).cash < getBusinessData(businessId).buyPrice) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "BusinessPurchaseNotEnoughMoney"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
|
|
||||||
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
|
||||||
getBusinessData(businessId).buyPrice = 0;
|
|
||||||
getBusinessData(businessId).needsSaved = true;
|
|
||||||
updateBusinessPickupLabelData(businessId);
|
|
||||||
|
|
||||||
messageDiscordEventChannel(`🏢 ${getCharacterFullName(client)} is now the owner of *${getBusinessData(businessId).name}*!`);
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "BusinessPurchased", `{businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR}`));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_RESETKEYBINDS: {
|
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "KeyBindsReset"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case AGRP_PROMPT_COPYKEYBINDSTOSERVER: {
|
|
||||||
//messagePlayerSuccess(client, getLocaleString(client, "KeyBindsCopiedToServer", serverName));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "NoPromptAccept"));
|
|
||||||
submitBugReport(client, `[AUTOMATED REPORT] Tried to accept invalid prompt type: ${getPlayerData(client).promptType}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function canPlayerUseGUI(client) {
|
|
||||||
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerPromptAnswerYesCommand(command, params, client) {
|
|
||||||
playerPromptAnswerYes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerPromptAnswerNoCommand(command, params, client) {
|
|
||||||
playerPromptAnswerNo(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function playerToggledGUI(client) {
|
function playerToggledGUI(client) {
|
||||||
toggleAccountGUICommand("gui", "", client);
|
toggleAccountGUICommand("gui", "", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function showPlayerTwoFactorAuthenticationGUI(client) {
|
|
||||||
sendNetworkEventToPlayer("agrp.2fa", client);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -204,9 +204,9 @@ function showAccountHelpMessage(client) {
|
|||||||
function showVehicleHelpMessage(client) {
|
function showVehicleHelpMessage(client) {
|
||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp")));
|
||||||
|
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 0, `{ALTCOLOUR}/info dealership{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 0));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 1, `{ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 1, `{ALTCOLOUR}/info dealership{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 2));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 2, `{ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 3, `{ALTCOLOUR}/info mechanic{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 3, `{ALTCOLOUR}/info mechanic{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,8 +216,8 @@ function showVehicleDealershipHelpMessage(client) {
|
|||||||
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp")));
|
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp")));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 0, `{ALTCOLOUR}/gps{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 0, `{ALTCOLOUR}/gps{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1, `{ALTCOLOUR}/buyveh{MAINCOLOUR}`));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 2, `{ALTCOLOUR}/buyveh{MAINCOLOUR}`));
|
||||||
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 2));
|
messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ function createHouseCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getGame()].House, -1, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorScene);
|
createHouse(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getGame()].House, -1, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorScene);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created house: {houseGreen}${params}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created house: {houseGreen}${params}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -275,7 +275,7 @@ function setHouseDescriptionCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed house {houseGreen}${oldDescription}{MAINCOLOUR} to {houseGreen}${getHouseData(houseId).description}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed house {houseGreen}${oldDescription}{MAINCOLOUR} to {houseGreen}${getHouseData(houseId).description}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -310,11 +310,12 @@ function setHouseOwnerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||||
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
|
||||||
messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${newHouseOwner.name}`);
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(newHouseOwner)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -345,7 +346,7 @@ function removeHouseOwnerCommand(command, params, client) {
|
|||||||
getHouseData(houseId).ownerId = -1;
|
getHouseData(houseId).ownerId = -1;
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messagePlayerSuccess(client, `{MAINCOLOUR}You removed house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} owner`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} owner`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -385,7 +386,7 @@ function setHouseClanCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_HOUSEGIVETOCLAN;
|
getPlayerData(client).promptType = AGRP_PROMPT_GIVEHOUSETOCLAN;
|
||||||
|
|
||||||
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
|
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
|
||||||
}
|
}
|
||||||
@@ -468,7 +469,7 @@ function setHousePickupCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} pickup display to {ALTCOLOUR}${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} pickup to {ALTCOLOUR}${toLowerCase(typeParam)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -504,7 +505,7 @@ function setHouseInteriorTypeCommand(command, params, client) {
|
|||||||
tempHouseLocation.exitInterior = -1;
|
tempHouseLocation.exitInterior = -1;
|
||||||
getHouseData(houseId).exitPickupModel = -1;
|
getHouseData(houseId).exitPickupModel = -1;
|
||||||
getHouseData(houseId).hasInterior = false;
|
getHouseData(houseId).hasInterior = false;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} removed house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior`, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -534,7 +535,7 @@ function setHouseInteriorTypeCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior type to {ALTCOLOUR}${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} interior type to {ALTCOLOUR}${typeParam}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -585,7 +586,7 @@ function setHouseBlipCommand(command, params, client) {
|
|||||||
resetHouseBlips(houseId);
|
resetHouseBlips(houseId);
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} blip display to {ALTCOLOUR}${toLowerCase(typeParam)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} blip to {ALTCOLOUR}${toLowerCase(typeParam)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -621,7 +622,7 @@ function moveHouseEntranceCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} entrance to their position`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} entrance to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -661,7 +662,7 @@ function moveHouseExitCommand(command, params, client) {
|
|||||||
|
|
||||||
getHouseData(houseId).needsSaved = true;
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} exit to their position`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} moved house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} exit to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1456,8 +1457,8 @@ function buyHouseCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).promptType = AGRP_PROMPT_BUYHOUSE;
|
||||||
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||||
getPlayerData(client).promptType = AGRP_PROMPT_HOUSEBUY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1793,14 +1794,14 @@ function updateHousePickupLabelData(houseId) {
|
|||||||
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true);
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
|
||||||
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true);
|
||||||
|
|
||||||
if (houseData.buyPrice > 0) {
|
if (houseData.buyPrice > 0) {
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
|
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true);
|
||||||
} else {
|
} else if (houseData.rentPrice > 0) {
|
||||||
if (houseData.rentPrice > 0) {
|
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
|
|
||||||
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -373,7 +373,10 @@ function createGroundItemObject(itemId) {
|
|||||||
setElementRotation(getItemData(itemId).object, getItemTypeData(getItemData(itemId).itemTypeIndex).dropRotation);
|
setElementRotation(getItemData(itemId).object, getItemTypeData(getItemData(itemId).itemTypeIndex).dropRotation);
|
||||||
setElementOnAllDimensions(getItemData(itemId).object, false);
|
setElementOnAllDimensions(getItemData(itemId).object, false);
|
||||||
setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension);
|
setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension);
|
||||||
//setEntityData(getItemData(itemId).object, "agrp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
setElementInterior(getItemData(itemId).object, getItemData(itemId).interior);
|
||||||
|
setEntityData(getItemData(itemId).object, "agrp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
||||||
|
setEntityData(getItemData(itemId).object, "agrp.collisions", false, true);
|
||||||
|
forcePlayerToSyncElementProperties(null, getItemData(itemId).object);
|
||||||
addToWorld(getItemData(itemId).object);
|
addToWorld(getItemData(itemId).object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -484,13 +487,13 @@ function useItemCommand(command, params, client) {
|
|||||||
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
||||||
|
|
||||||
if (!getItemData(itemId)) {
|
if (!getItemData(itemId)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "UseItemBug"));
|
messagePlayerError(client, getLocaleString(client, "UseItemBugged"));
|
||||||
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item data for item ${itemId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item data for item ${itemId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
if (!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "UseItemBug"));
|
messagePlayerError(client, getLocaleString(client, "UseItemBugged"));
|
||||||
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item type ${getItemData(itemId).itemType} data for item ${itemId}/${getItemData(itemId).databaseId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
submitBugReport(client, `(AUTOMATED REPORT) Use Item: Getting item type ${getItemData(itemId).itemType} data for item ${itemId}/${getItemData(itemId).databaseId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -691,7 +694,7 @@ function dropItemCommand(command, params, client) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function putItemCommand(command, params, client) {
|
function putItemCommand(command, params, client) {
|
||||||
clearPlayerItemActionState(client);
|
//clearPlayerItemActionState(client);
|
||||||
|
|
||||||
let hotBarSlot = toInteger(params);
|
let hotBarSlot = toInteger(params);
|
||||||
|
|
||||||
@@ -734,6 +737,8 @@ function putItemCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
if (getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) {
|
if (getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) {
|
||||||
forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex, 0.0);
|
forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex, 0.0);
|
||||||
}
|
}
|
||||||
@@ -819,7 +824,7 @@ function createItemTypeCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let itemTypeIndex = createItemType(params);
|
let itemTypeIndex = createItemType(params);
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} created new item {ALTCOLOUR}${params}. {MAINCOLOUR}ID: ${itemTypeIndex}/${getItemTypeData(itemTypeIndex).databaseId}!`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} created new item type: {ALTCOLOUR}${params}. {MAINCOLOUR}ID: ${itemTypeIndex}/${getItemTypeData(itemTypeIndex).databaseId}!`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -839,6 +844,7 @@ function setItemTypeDropModelCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let modelIndex = getObjectModelIndexFromParams(splitParams.slice(-1).join(" "));
|
let modelIndex = getObjectModelIndexFromParams(splitParams.slice(-1).join(" "));
|
||||||
|
|
||||||
@@ -849,7 +855,7 @@ function setItemTypeDropModelCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropModel = modelIndex;
|
getItemTypeData(itemTypeIndex).dropModel = modelIndex;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}'s{MAINCOLOUR} dropped object model index to ${modelIndex}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}'s{MAINCOLOUR} dropped object model index to ${modelIndex}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -869,6 +875,7 @@ function setItemTypeOrderPriceCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let orderPrice = splitParams[splitParams.length - 1];
|
let orderPrice = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -879,7 +886,7 @@ function setItemTypeOrderPriceCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).orderPrice = orderPrice;
|
getItemTypeData(itemTypeIndex).orderPrice = orderPrice;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} base price to {ALTCOLOUR}${getCurrencyString(orderPrice)}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} base price to {ALTCOLOUR}${getCurrencyString(orderPrice)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -899,6 +906,7 @@ function setItemTypeOrderValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let orderValue = splitParams[splitParams.length - 1];
|
let orderValue = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -909,7 +917,7 @@ function setItemTypeOrderValueCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).orderValue = orderValue;
|
getItemTypeData(itemTypeIndex).orderValue = orderValue;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} order value to {ALTCOLOUR}${orderValue}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} order value to {ALTCOLOUR}${orderValue}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -929,6 +937,7 @@ function setItemTypeRiskMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let riskMultiplier = splitParams[splitParams.length - 1];
|
let riskMultiplier = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -937,9 +946,9 @@ function setItemTypeRiskMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).riskMultiplier = riskMultiplier;
|
getItemTypeData(itemTypeIndex).riskMultiplier = riskMultiplier / 100;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} risk multiplier to {ALTCOLOUR}${riskMultiplier}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} risk multiplier to {ALTCOLOUR}${riskMultiplier}%`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -968,7 +977,7 @@ function toggleItemTypeEnabledCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).enabled = !getItemTypeData(itemTypeIndex).enabled;
|
getItemTypeData(itemTypeIndex).enabled = !getItemTypeData(itemTypeIndex).enabled;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} ${getEnabledDisabledFromBool(getItemTypeData(itemTypeIndex).enabled)} item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} ${getEnabledDisabledFromBool(getItemTypeData(itemTypeIndex).enabled)} item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -988,6 +997,7 @@ function setItemTypeUseTypeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let useType = splitParams[splitParams.length - 1];
|
let useType = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -998,7 +1008,7 @@ function setItemTypeUseTypeCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).useType = useType;
|
getItemTypeData(itemTypeIndex).useType = useType;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use type to {ALTCOLOUR}${useType}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use type to {ALTCOLOUR}${useType}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1018,6 +1028,7 @@ function setItemTypeUseValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let useValue = splitParams[splitParams.length - 1];
|
let useValue = splitParams[splitParams.length - 1];
|
||||||
|
|
||||||
@@ -1028,7 +1039,7 @@ function setItemTypeUseValueCommand(command, params, client) {
|
|||||||
|
|
||||||
getItemTypeData(itemTypeIndex).useValue = useValue;
|
getItemTypeData(itemTypeIndex).useValue = useValue;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use value to {ALTCOLOUR}${useValue}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} use value to {ALTCOLOUR}${useValue}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1048,17 +1059,23 @@ function setItemTypeDropFrontDistanceCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -1).join(" "));
|
||||||
let dropFrontDistance = splitParams.slice(-1);
|
let dropFrontDistance = splitParams.slice(-1) || 0.0;
|
||||||
|
|
||||||
if (!getItemTypeData(itemTypeIndex)) {
|
if (!getItemTypeData(itemTypeIndex)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
|
messagePlayerError(client, getLocaleString(client, "InvalidItemType"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(dropFrontDistance)) {
|
||||||
|
messagePlayerError(client, `The distance must be a number!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropFrontDistance = dropFrontDistance;
|
getItemTypeData(itemTypeIndex).dropFrontDistance = dropFrontDistance;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop front distance to {ALTCOLOUR}${dropFrontDistance}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop front distance to {ALTCOLOUR}${dropFrontDistance.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1078,6 +1095,7 @@ function setItemTypeDropPositionCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let x = splitParams.slice(-3, -2) || 0.0;
|
let x = splitParams.slice(-3, -2) || 0.0;
|
||||||
let y = splitParams.slice(-2, -1) || 0.0;
|
let y = splitParams.slice(-2, -1) || 0.0;
|
||||||
@@ -1088,11 +1106,16 @@ function setItemTypeDropPositionCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(x) || isNaN(y) || isNaN(z)) {
|
||||||
|
messagePlayerError(client, `The positions must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dropPosition = toVector3(x, y, z);
|
let dropPosition = toVector3(x, y, z);
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropPosition = dropPosition;
|
getItemTypeData(itemTypeIndex).dropPosition = dropPosition;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop position offset to {ALTCOLOUR}${dropPosition.x}, ${dropPosition.y}, ${dropPosition.z}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop position offset to {ALTCOLOUR}${dropPosition.x.toFixed(2)}, ${dropPosition.y.toFixed(2)}, ${dropPosition.z.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1112,6 +1135,7 @@ function setItemTypeDropRotationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let x = splitParams.slice(-3, -2) || 0.0;
|
let x = splitParams.slice(-3, -2) || 0.0;
|
||||||
let y = splitParams.slice(-2, -1) || 0.0;
|
let y = splitParams.slice(-2, -1) || 0.0;
|
||||||
@@ -1122,11 +1146,16 @@ function setItemTypeDropRotationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(x) || isNaN(y) || isNaN(z)) {
|
||||||
|
messagePlayerError(client, `The positions must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dropRotation = toVector3(x, y, z);
|
let dropRotation = toVector3(x, y, z);
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropRotation = dropRotation;
|
getItemTypeData(itemTypeIndex).dropRotation = dropRotation;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop rotation to {ALTCOLOUR}${dropRotation.x}, ${dropRotation.y}, ${dropRotation.z}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop rotation to {ALTCOLOUR}${dropRotation.x.toFixed(2)}, ${dropRotation.y.toFixed(2)}, ${dropRotation.z.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1146,6 +1175,7 @@ function setItemTypeDropScaleCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let x = splitParams.slice(-3, -2) || 1.0;
|
let x = splitParams.slice(-3, -2) || 1.0;
|
||||||
let y = splitParams.slice(-2, -1) || 1.0;
|
let y = splitParams.slice(-2, -1) || 1.0;
|
||||||
@@ -1156,11 +1186,16 @@ function setItemTypeDropScaleCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(x) || isNaN(y) || isNaN(z)) {
|
||||||
|
messagePlayerError(client, `The positions must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dropScale = toVector3(x, y, z);
|
let dropScale = toVector3(x, y, z);
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).dropScale = dropScale;
|
getItemTypeData(itemTypeIndex).dropScale = dropScale;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop scale to {ALTCOLOUR}${dropScale.x}, ${dropScale.y}, ${dropScale.z}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} drop scale to {ALTCOLOUR}${dropScale.x.toFixed(2)}, ${dropScale.y.toFixed(2)}, ${dropScale.z.toFixed(2)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1180,6 +1215,7 @@ function setItemTypeDemandMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let demandMultiplier = splitParams.slice(-1) || 100;
|
let demandMultiplier = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1188,9 +1224,14 @@ function setItemTypeDemandMultiplierCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).demandMultiplier = demandMultiplayer / 100;
|
if (isNaN(demandMultiplier)) {
|
||||||
|
messagePlayerError(client, `The demand multiplier must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getItemTypeData(itemTypeIndex).demandMultiplier = demandMultiplier / 100;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} demand multiplier to {ALTCOLOUR}${demandMultiplier}%`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} demand multiplier to {ALTCOLOUR}${demandMultiplier}%`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1210,6 +1251,7 @@ function setItemTypeMaxValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let maxValue = splitParams.slice(-1) || 100;
|
let maxValue = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1218,9 +1260,14 @@ function setItemTypeMaxValueCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(maxValue)) {
|
||||||
|
messagePlayerError(client, `The max value must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).maxValue = maxValue;
|
getItemTypeData(itemTypeIndex).maxValue = maxValue;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} max value to {ALTCOLOUR}${maxValue}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} max value to {ALTCOLOUR}${maxValue}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1240,6 +1287,7 @@ function setItemTypeSizeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let size = splitParams.slice(-1) || 100;
|
let size = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1248,9 +1296,14 @@ function setItemTypeSizeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(size)) {
|
||||||
|
messagePlayerError(client, `The size must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).size = size;
|
getItemTypeData(itemTypeIndex).size = size;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} size to {ALTCOLOUR}${size}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} size to {ALTCOLOUR}${size}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1270,6 +1323,7 @@ function setItemTypeCapacityCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
let itemTypeIndex = getItemTypeFromParams(splitParams.slice(0, -3).join(" "));
|
||||||
let capacity = splitParams.slice(-1) || 100;
|
let capacity = splitParams.slice(-1) || 100;
|
||||||
|
|
||||||
@@ -1278,9 +1332,14 @@ function setItemTypeCapacityCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNaN(capacity)) {
|
||||||
|
messagePlayerError(client, `The capacity must be numbers!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
getItemTypeData(itemTypeIndex).capacity = capacity;
|
getItemTypeData(itemTypeIndex).capacity = capacity;
|
||||||
getItemTypeData(itemTypeIndex).needsSaved = true;
|
getItemTypeData(itemTypeIndex).needsSaved = true;
|
||||||
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} capacity to {ALTCOLOUR}${capacity}`);
|
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} capacity to {ALTCOLOUR}${capacity}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2076,7 +2135,7 @@ function cacheAllGroundItems() {
|
|||||||
|
|
||||||
function createAllGroundItemObjects() {
|
function createAllGroundItemObjects() {
|
||||||
for (let i in getServerData().groundItemCache) {
|
for (let i in getServerData().groundItemCache) {
|
||||||
createGroundItemObject(i);
|
createGroundItemObject(getServerData().groundItemCache[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2205,6 +2264,20 @@ function deleteItem(itemId, whoDeleted = -1) {
|
|||||||
function getBestNewOwnerToPutItem(client) {
|
function getBestNewOwnerToPutItem(client) {
|
||||||
let position = getPlayerPosition(client);
|
let position = getPlayerPosition(client);
|
||||||
|
|
||||||
|
let possibleItem = getClosestItemOnGround(position);
|
||||||
|
if (possibleItem != -1) {
|
||||||
|
if (getDistance(getItemPosition(possibleItem), position) <= getGlobalConfig().itemContainerDistance) {
|
||||||
|
return [AGRP_ITEM_OWNER_ITEM, possibleItem];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let possibleVehicle = getClosestVehicle(position);
|
||||||
|
if (possibleVehicle != false) {
|
||||||
|
if (getVehicleData(possibleVehicle) != false && getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= getGlobalConfig().vehicleTrunkDistance) {
|
||||||
|
return [AGRP_ITEM_OWNER_VEHTRUNK, possibleVehicle];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let possibleHouse = getPlayerHouse(client);
|
let possibleHouse = getPlayerHouse(client);
|
||||||
if (possibleHouse != -1) {
|
if (possibleHouse != -1) {
|
||||||
if (getHouseData(possibleHouse) != false) {
|
if (getHouseData(possibleHouse) != false) {
|
||||||
@@ -2219,20 +2292,6 @@ function getBestNewOwnerToPutItem(client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let possibleVehicle = getClosestVehicle(position);
|
|
||||||
if (possibleVehicle != false) {
|
|
||||||
if (getVehicleData(possibleVehicle) != false && getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= getGlobalConfig().vehicleTrunkDistance) {
|
|
||||||
return [AGRP_ITEM_OWNER_VEHTRUNK, possibleVehicle];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let possibleItem = getClosestItemOnGround(position);
|
|
||||||
if (possibleItem != -1) {
|
|
||||||
if (getDistance(getItemPosition(possibleItem), position) <= getGlobalConfig().itemContainerDistance) {
|
|
||||||
return [AGRP_ITEM_OWNER_ITEM, possibleItem];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [AGRP_ITEM_OWNER_NONE, 0];
|
return [AGRP_ITEM_OWNER_NONE, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2245,6 +2304,15 @@ function getBestItemToTake(client, slot) {
|
|||||||
let ownerType = AGRP_ITEM_OWNER_NONE;
|
let ownerType = AGRP_ITEM_OWNER_NONE;
|
||||||
let ownerId = 0;
|
let ownerId = 0;
|
||||||
|
|
||||||
|
let possibleItem = getClosestItemOnGround(position);
|
||||||
|
if (getItemData(possibleItem)) {
|
||||||
|
if (typeof getItemData(possibleItem).itemCache[slot] != "undefined") {
|
||||||
|
itemId = getItemData(possibleItem).itemCache[slot]
|
||||||
|
ownerType = AGRP_ITEM_OWNER_ITEM;
|
||||||
|
ownerId = possibleItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let possibleHouse = getPlayerHouse(client);
|
let possibleHouse = getPlayerHouse(client);
|
||||||
if (getHouseData(possibleHouse)) {
|
if (getHouseData(possibleHouse)) {
|
||||||
if (typeof getHouseData(possibleHouse).itemCache[slot] != "undefined") {
|
if (typeof getHouseData(possibleHouse).itemCache[slot] != "undefined") {
|
||||||
@@ -3014,7 +3082,7 @@ function showBusinessStorageInventoryToPlayer(client, businessId) {
|
|||||||
if (getBusinessData(businessId).storageItemCache == -1) {
|
if (getBusinessData(businessId).storageItemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[i]).itemTypeIndex).name}`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[i]).itemTypeIndex).name} ${getItemValueDisplayForItem(getBusinessData(businessId).storageItemCache[i])}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3032,9 +3100,9 @@ function showItemInventoryToPlayer(client, itemId) {
|
|||||||
let itemDisplay = [];
|
let itemDisplay = [];
|
||||||
for (let i in getItemData(itemId).itemCache) {
|
for (let i in getItemData(itemId).itemCache) {
|
||||||
if (getItemData(itemId).itemCache == -1) {
|
if (getItemData(itemId).itemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getItemData(itemId).itemCache[i]).itemTypeIndex).name}`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getItemData(itemId).itemCache[i]).itemTypeIndex).name} ${getItemValueDisplayForItem(getItemData(itemId).itemCache[i])}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3057,13 +3125,13 @@ function showPlayerInventoryToPlayer(showToClient, targetClient) {
|
|||||||
colour = "{yellow}";
|
colour = "{yellow}";
|
||||||
}
|
}
|
||||||
if (getPlayerData(targetClient).hotBarItems[i] == -1) {
|
if (getPlayerData(targetClient).hotBarItems[i] == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: ${colour}(Empty)`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: ${colour}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
let itemTypeData = getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex);
|
let itemTypeData = getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex);
|
||||||
if (itemTypeData != false) {
|
if (itemTypeData != false) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: ${colour}${itemTypeData.name}`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: ${colour}${itemTypeData.name} ${getItemValueDisplayForItem(getPlayerData(targetClient).hotBarItems[i])}`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: ${colour}(Empty)`);
|
itemDisplay.push(`{businessBlue}${toInteger(i) + 1}: ${colour}(Empty)`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3088,7 +3156,7 @@ function showHouseInventoryToPlayer(client, houseId) {
|
|||||||
if (getHouseData(houseId).itemCache == -1) {
|
if (getHouseData(houseId).itemCache == -1) {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getHouseData(houseId).itemCache[i]).itemTypeIndex).name}`);
|
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getHouseData(houseId).itemCache[i]).itemTypeIndex).name} ${getItemValueDisplayForItem(getHouseData(houseId).itemCache[i])}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2326,7 +2326,7 @@ function jobStartRouteCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getJobData(getPlayerJob(client)).routes.length == 0) {
|
if (getJobData(getPlayerJob(client)).routes.length == 0) {
|
||||||
messagePlayerError(client, getLocaleString(client, "NoRoutesForLocation"));
|
messagePlayerError(client, getLocaleString(client, "NoJobRoutesForLocation"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,37 +41,31 @@ function announceAdminAction(localeString, ...args) {
|
|||||||
function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
|
function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
if (client.console) {
|
if (client.console) {
|
||||||
logToConsole(LOG_INFO, `${messageText}`);
|
logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logToConsole(LOG_INFO, `${messageText}`);
|
|
||||||
|
|
||||||
//messageText = replaceColoursInMessage(messageText);
|
|
||||||
|
|
||||||
//if(client == null) {
|
|
||||||
// message(messageText, colour);
|
|
||||||
//} else {
|
|
||||||
// messageClient(messageText, client, colour);
|
|
||||||
//}
|
|
||||||
|
|
||||||
sendChatBoxMessageToPlayer(client, messageText, colour);
|
sendChatBoxMessageToPlayer(client, messageText, colour);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messageAdmins(messageText, colour = getColourByName("softRed")) {
|
function messageAdmins(messageText, announceToEventChannel = false) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
for (let i in clients) {
|
for (let i in clients) {
|
||||||
if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
||||||
messagePlayerNormal(clients[i], `🛡️ ${messageText}`, colour);
|
messagePlayerNormal(clients[i], `🛡️ ${messageText}`, getColourByName("white"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let plainMessage = removeColoursInMessage(messageText);
|
let plainMessage = removeColoursInMessage(messageText);
|
||||||
messageDiscordAdminChannel(plainMessage);
|
messageDiscordAdminChannel(plainMessage);
|
||||||
|
|
||||||
|
if (announceToEventChannel == true) {
|
||||||
|
messageDiscordEventChannel(`🛡️ ${plainMessage}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -169,7 +163,7 @@ function messagePlayerDoAction(client, doingActionClient, messageText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerMeAction(client, doingActionClient, messageText) {
|
function messagePlayerMeAction(client, doingActionClient, messageText) {
|
||||||
messagePlayerNormal(client, `${getClientSubAccountName(doingActionClient)} ${messageText}`, getColourByType("meActionMessage"));
|
messagePlayerNormal(client, `${getCharacterFullName(doingActionClient)} ${messageText}`, getColourByType("meActionMessage"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -181,7 +175,7 @@ function messagePlayerClanChat(client, clanChattingClient, messageText) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function messagePlayerAdminChat(client, adminChattingClient, messageText) {
|
function messagePlayerAdminChat(client, adminChattingClient, messageText) {
|
||||||
messagePlayerNormal(client, `🛡️ [ADMIN CHAT] {ALTCOLOUR}${getPlayerData(adminChattingClient).accountData.staffTitle} [#CCCCCC]${getPlayerData(adminChattingClient).accountData.name}: {MAINCOLOUR}${messageText}`, getColourByType("orange"));
|
messagePlayerNormal(client, `🛡️ [ADMIN CHAT] {ALTCOLOUR}${getPlayerData(adminChattingClient).accountData.staffTitle} {lightGrey}${getPlayerData(adminChattingClient).accountData.name}: {MAINCOLOUR}${messageText}`, getColourByType("orange"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -241,4 +235,24 @@ function messagePlayerPrivateMessage(toClient, fromClient, messageText) {
|
|||||||
messagePlayerNormal(toClient, `{yellow}[DM] ${getCharacterFullName(fromClient)}{MAINCOLOUR}says: {ALTCOLOUR}${messageText}`);
|
messagePlayerNormal(toClient, `{yellow}[DM] ${getCharacterFullName(fromClient)}{MAINCOLOUR}says: {ALTCOLOUR}${messageText}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerError(client, errorMessage, errorTitle = "Error") {
|
||||||
|
if (doesPlayerUseGUI(client)) {
|
||||||
|
showPlayerErrorGUI(client, errorMessage, errorTitle);
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerAlert(client, alertMessage, alertTitle = "Alert") {
|
||||||
|
if (doesPlayerUseGUI(client)) {
|
||||||
|
showPlayerInfoGUI(client, alertMessage, alertTitle);
|
||||||
|
} else {
|
||||||
|
messagePlayerAlert(client, alertMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -211,11 +211,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE) {
|
// The player's currentPickup wasn't always being set. This prevented entering/exiting a property.
|
||||||
if (!getPlayerData(client).currentPickup) {
|
// Needs further testing and tweaks.
|
||||||
return false;
|
if (!getPlayerData(client).currentPickup) {
|
||||||
}
|
|
||||||
|
|
||||||
let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type");
|
let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type");
|
||||||
let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
|
let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
|
||||||
|
|
||||||
@@ -247,33 +245,43 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
for (let i in getServerData().businesses) {
|
|
||||||
if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
|
|
||||||
let businessId = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
|
||||||
isBusiness = true;
|
|
||||||
isEntrance = true;
|
|
||||||
closestProperty = getServerData().businesses[businessId];
|
|
||||||
} else {
|
|
||||||
let businessId = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
|
||||||
isBusiness = true;
|
|
||||||
isEntrance = false;
|
|
||||||
closestProperty = getServerData().businesses[businessId];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let j in getServerData().houses) {
|
// Check businesses first
|
||||||
if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) {
|
if (closestProperty == null) {
|
||||||
let houseId = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
let businessIndex = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
isBusiness = false;
|
if (getDistance(getBusinessData(businessIndex).entrancePosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
isEntrance = true;
|
isBusiness = true;
|
||||||
closestProperty = getServerData().businesses[houseId];
|
isEntrance = true;
|
||||||
} else {
|
closestProperty = getServerData().businesses[businessIndex];
|
||||||
let houseId = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
}
|
||||||
isBusiness = false;
|
}
|
||||||
isEntrance = false;
|
|
||||||
closestProperty = getServerData().businesses[houseId];
|
if (closestProperty == null) {
|
||||||
}
|
let businessIndex = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if (getDistance(getBusinessData(businessIndex).exitPosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
|
isBusiness = true;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().businesses[businessIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check houses second
|
||||||
|
if (closestProperty == null) {
|
||||||
|
let houseIndex = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if (getDistance(getHouseData(houseIndex).entrancePosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = true;
|
||||||
|
closestProperty = getServerData().houses[houseIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (closestProperty == null) {
|
||||||
|
let houseIndex = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if (getDistance(getHouseData(houseIndex).exitPosition, getPlayerPosition(client)) <= 1.5) {
|
||||||
|
isBusiness = false;
|
||||||
|
isEntrance = false;
|
||||||
|
closestProperty = getServerData().houses[houseIndex];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,10 +469,10 @@ function checkPlayerSpawning() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noButtonText) {
|
function showPlayerPrompt(client, promptMessage, promptTitle, yesButtonText, noButtonText) {
|
||||||
if (canPlayerUseGUI(client)) {
|
if (doesPlayerUseGUI(client)) {
|
||||||
showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerNormal(client, `❓ ${promptMessage} `);
|
messagePlayerNormal(client, `🛎️ ${promptMessage} `);
|
||||||
messagePlayerInfo(client, getLocaleString(client, "PromptResponseTip", `{ALTCOLOUR}/yes{MAINCOLOUR}`, `{ALTCOLOUR}/no{MAINCOLOUR}`));
|
messagePlayerInfo(client, getLocaleString(client, "PromptResponseTip", `{ALTCOLOUR}/yes{MAINCOLOUR}`, `{ALTCOLOUR}/no{MAINCOLOUR}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1212,6 +1212,30 @@ function setElementStreamOutDistance(element, distance) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getElementStreamInDistance(element) {
|
||||||
|
if (!isNull(element) && element != false) {
|
||||||
|
if (typeof element == "Entity") {
|
||||||
|
if (typeof element.streamInDistance != "undefined") {
|
||||||
|
return element.streamInDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getElementStreamOutDistance(element) {
|
||||||
|
if (!isNull(element) && element != false) {
|
||||||
|
if (typeof element == "Entity") {
|
||||||
|
if (typeof element.streamOutDistance != "undefined") {
|
||||||
|
return element.streamOutDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function getPlayerPed(client) {
|
function getPlayerPed(client) {
|
||||||
if (isNull(client)) {
|
if (isNull(client)) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1487,4 +1511,10 @@ function getContentsOfTextFile(filePath) {
|
|||||||
return loadTextFile(filePath);
|
return loadTextFile(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setServerRule(ruleName, ruleValue) {
|
||||||
|
server.setRule(ruleName, ruleValue);
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1201,32 +1201,32 @@ function bindServerEventHandler(eventName, bindTo, handlerFunction) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setElementName(element, name) {
|
function setElementName(element, name) {
|
||||||
element.name = name;
|
//element.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function hideElementForPlayer(element, client) {
|
function hideElementForPlayer(element, client) {
|
||||||
element.setExistsFor(client, false);
|
//element.setExistsFor(client, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showElementForPlayer(element, client) {
|
function showElementForPlayer(element, client) {
|
||||||
element.setExistsFor(client, true);
|
//element.setExistsFor(client, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setElementShownByDefault(element, state) {
|
function setElementShownByDefault(element, state) {
|
||||||
element.netFlags.defaultExistance = state;
|
//element.netFlags.defaultExistance = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
|
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
|
||||||
if (isGameFeatureSupported("attachedBlip")) {
|
if (isGameFeatureSupported("attachedBlip")) {
|
||||||
return game.createBlipAttachedTo(element, type, size, colour, true, false);
|
// return game.createBlipAttachedTo(element, type, size, colour, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1238,6 +1238,11 @@ function deletePlayerPed(client) {
|
|||||||
} else {
|
} else {
|
||||||
sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
|
sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
|
||||||
}
|
}
|
||||||
|
//if (areServerElementsSupported()) {
|
||||||
|
// destroyElement(client.player);
|
||||||
|
//} else {
|
||||||
|
// sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1260,6 +1265,12 @@ function setServerPassword(password) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setServerRule(ruleName, ruleValue) {
|
||||||
|
//server.setRule(ruleName, ruleValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
async function getContentsOfTextFile(filePath) {
|
async function getContentsOfTextFile(filePath) {
|
||||||
let fileContents = fs.readFile(filePath, 'utf8', function (err, data) {
|
let fileContents = fs.readFile(filePath, 'utf8', function (err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ function deleteNPCCommand(command, params, client) {
|
|||||||
let npcName = getNPCData(closestNPC).name;
|
let npcName = getNPCData(closestNPC).name;
|
||||||
|
|
||||||
deleteNPC(closestNPC);
|
deleteNPC(closestNPC);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted NPC {npcPink}${npcName}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} deleted NPC {npcPink}${npcName}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -611,7 +611,7 @@ function setNPCClanCommand(command, params, client) {
|
|||||||
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
|
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
|
||||||
getNPCData(closestNPC).needsSaved = true;
|
getNPCData(closestNPC).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set {npcPink}${getNPCData(closestNPC).name}${MAINCOLOUR}'s clan to {clanOrange}${getClanData(clanId).name}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set {npcPink}${getNPCData(closestNPC).name}${MAINCOLOUR}'s clan to {clanOrange}${getClanData(clanId).name}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -623,25 +623,11 @@ function addNPCTriggerCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let closestNPC = getClosestNPC(getPlayerPosition(client), getPlayerDimension(client), getPlayerInterior(client));
|
let closestNPC = getClosestNPC(getPlayerPosition(client), getPlayerDimension(client), getPlayerInterior(client));
|
||||||
let clanId = getClanFromParams(params);
|
|
||||||
|
|
||||||
if (!getNPCData(closestNPC)) {
|
if (!getNPCData(closestNPC)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidNPC"));
|
messagePlayerError(client, getLocaleString(client, "InvalidNPC"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getClanData(clanId)) {
|
|
||||||
messagePlayerError(client, getLocaleString(client, "InvalidClan"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//let triggerData = new TriggerData();
|
|
||||||
|
|
||||||
getNPCData(closestNPC).ownerType = AGRP_NPC_OWNER_CLAN;
|
|
||||||
getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId;
|
|
||||||
getNPCData(closestNPC).needsSaved = true;
|
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set {npcPink}${getNPCData(closestNPC).name}${MAINCOLOUR}'s clan to {clanOrange}${getClanData(clanId).name}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
285
scripts/server/prompt.js
Normal file
285
scripts/server/prompt.js
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
// ===========================================================================
|
||||||
|
// Asshat Gaming Roleplay
|
||||||
|
// https://github.com/VortrexFTW/agrp_main
|
||||||
|
// (c) 2022 Asshat Gaming
|
||||||
|
// ===========================================================================
|
||||||
|
// FILE: prompt.js
|
||||||
|
// DESC: Provides prompt (yes/no confirmations) functions and usage
|
||||||
|
// TYPE: Server (JavaScript)
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
// Prompts (used for prompt responses)
|
||||||
|
const AGRP_PROMPT_NONE = 0;
|
||||||
|
const AGRP_PROMPT_CREATEFIRSTCHAR = 1;
|
||||||
|
const AGRP_PROMPT_BIZORDER = 2;
|
||||||
|
const AGRP_PROMPT_GIVEVEHTOCLAN = 3;
|
||||||
|
const AGRP_PROMPT_GIVEBIZTOCLAN = 4;
|
||||||
|
const AGRP_PROMPT_GIVEHOUSETOCLAN = 5;
|
||||||
|
const AGRP_PROMPT_BUYBIZ = 6;
|
||||||
|
const AGRP_PROMPT_BUYHOUSE = 7;
|
||||||
|
const AGRP_PROMPT_RESETKEYBINDS = 8;
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function initPromptScript() {
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Prompt]: Initializing Prompt script ...");
|
||||||
|
logToConsole(LOG_INFO, "[AGRP.Prompt]: Prompt script initialized successfully!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerNo(client) {
|
||||||
|
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||||
|
|
||||||
|
switch (getPlayerData(client).promptType) {
|
||||||
|
case AGRP_PROMPT_CREATEFIRSTCHAR:
|
||||||
|
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "DidNotCreateCharacter"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
|
||||||
|
getPlayerData(targetClient).customDisconnectReason = "FailedToCreateCharacter";
|
||||||
|
setTimeout(function () { disconnectPlayer(client); }, 5000);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BIZORDER:
|
||||||
|
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||||
|
if (doesPlayerUseGUI(client)) {
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderCanceled"), getLocaleString(client, "Alert"));
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`);
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessOrderCanceled"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "NotOrderingAnyBusinessItems"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle")));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NoPromptReject"));
|
||||||
|
submitBugReport(client, `[AUTOMATED REPORT] Tried to reject invalid prompt type: ${getPlayerData(client).promptType}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerYes(client) {
|
||||||
|
if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||||
|
|
||||||
|
switch (getPlayerData(client).promptType) {
|
||||||
|
case AGRP_PROMPT_CREATEFIRSTCHAR: {
|
||||||
|
showPlayerNewCharacterGUI(client);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BIZORDER: {
|
||||||
|
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||||
|
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||||
|
if (doesPlayerHaveGUIEnabled(client)) {
|
||||||
|
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderNotEnoughMoney", `{ALTCOLOUR}/bizdeposit{MAINCOLOUR}`), getLocaleString(client, "BusinessOrderCanceled"));
|
||||||
|
} else {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessOrderNotEnoughMoney", `{ALTCOLOUR}/bizdeposit{MAINCOLOUR}`));
|
||||||
|
}
|
||||||
|
getPlayerData(client).businessOrderAmount = 0;
|
||||||
|
getPlayerData(client).businessOrderBusiness = false;
|
||||||
|
getPlayerData(client).businessOrderItem = -1;
|
||||||
|
getPlayerData(client).businessOrderValue = -1;
|
||||||
|
} else {
|
||||||
|
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||||
|
|
||||||
|
showPlayerInfoGUI(client, getLocaleString(client, "BusinessOrderSuccessInfo", getPlayerData(client).businessOrderAmount, getItemTypeData(getPlayerData(client).businessOrderItem).name, getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue), getPlayerData(client).businessOrderCost), getLocaleString(client, "GUIInfoTitle"));
|
||||||
|
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||||
|
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
||||||
|
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
||||||
|
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
||||||
|
getPlayerData(client).businessOrderAmount = 0;
|
||||||
|
getPlayerData(client).businessOrderBusiness = false;
|
||||||
|
getPlayerData(client).businessOrderItem = -1;
|
||||||
|
getPlayerData(client).businessOrderValue = -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showPlayerErrorGUI(client, ``, `Business Order Canceled`);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_GIVEVEHTOCLAN: {
|
||||||
|
if (!isPlayerInAnyVehicle(client)) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustBeInVehicle"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getVehicleData(getPlayerVehicle(client))) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getVehicleData(getPlayerVehicle(client)).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnVehicle"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN;
|
||||||
|
getVehicleData(getPlayerVehicle(client)).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "GaveVehicleToClan", getVehicleName(getPlayerVehicle(client))));
|
||||||
|
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_GIVEHOUSETOCLAN: {
|
||||||
|
let houseId = getPlayerHouse(client);
|
||||||
|
if (!houseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getHouseData(houseId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN;
|
||||||
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "GaveHouseToClan"));
|
||||||
|
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_GIVEBIZTOCLAN: {
|
||||||
|
let businessId = getPlayerBusiness(client);
|
||||||
|
if (!businessId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getBusinessData(businessId).ownerId != getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN;
|
||||||
|
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).clan;
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "GaveBusinessToClan"));
|
||||||
|
//messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BUYHOUSE: {
|
||||||
|
let houseId = getPlayerHouse(client);
|
||||||
|
if (!houseId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getHouseData(houseId).buyPrice <= 0) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "HouseNotForSale"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getPlayerCurrentSubAccount(client).cash < getHouseData(houseId).buyPrice) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "HousePurchaseNotEnoughMoney"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER;
|
||||||
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||||
|
getHouseData(houseId).buyPrice = 0;
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
updateHousePickupLabelData(houseId);
|
||||||
|
|
||||||
|
messageDiscordEventChannel(`🏘️ ${getCharacterFullName(client)} is now the owner of house *${getHouseData(houseId).description}*!`);
|
||||||
|
messagePlayerSuccess(client, `🏘️ You are now the owner of {houseGreen}${getHouseData(houseId).description}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_BUYBIZ: {
|
||||||
|
let businessId = getPlayerBusiness(client);
|
||||||
|
if (!businessId) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getBusinessData(businessId).buyPrice <= 0) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessNotForSale"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getPlayerCurrentSubAccount(client).cash < getBusinessData(businessId).buyPrice) {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "BusinessPurchaseNotEnoughMoney"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER;
|
||||||
|
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||||
|
getBusinessData(businessId).buyPrice = 0;
|
||||||
|
getBusinessData(businessId).needsSaved = true;
|
||||||
|
updateBusinessPickupLabelData(businessId);
|
||||||
|
|
||||||
|
messageDiscordEventChannel(`🏢 ${getCharacterFullName(client)} is now the owner of *${getBusinessData(businessId).name}*!`);
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "BusinessPurchased", `{businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR}`));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_RESETKEYBINDS: {
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "KeyBindsReset"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AGRP_PROMPT_COPYKEYBINDSTOSERVER: {
|
||||||
|
//messagePlayerSuccess(client, getLocaleString(client, "KeyBindsCopiedToServer", serverName));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
messagePlayerError(client, getLocaleString(client, "NoPromptAccept"));
|
||||||
|
submitBugReport(client, `[AUTOMATED REPORT] Tried to accept invalid prompt type: ${getPlayerData(client).promptType}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlayerData(client).promptType = AGRP_PROMPT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerYesCommand(command, params, client) {
|
||||||
|
playerPromptAnswerYes(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function playerPromptAnswerNoCommand(command, params, client) {
|
||||||
|
playerPromptAnswerNo(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerTwoFactorAuthenticationGUI(client) {
|
||||||
|
sendNetworkEventToPlayer("agrp.2fa", client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -390,11 +390,20 @@ function getVehicleCommand(command, params, client) {
|
|||||||
|
|
||||||
let vehicle = getServerData().vehicles[toInteger(params) - 1].vehicle;
|
let vehicle = getServerData().vehicles[toInteger(params) - 1].vehicle;
|
||||||
|
|
||||||
|
let oldStreamInDistance = getElementStreamInDistance(vehicle);
|
||||||
|
let oldStreamOutDistance = getElementStreamOutDistance(vehicle);
|
||||||
|
|
||||||
|
setElementStreamInDistance(vehicle, 9999999);
|
||||||
|
setElementStreamOutDistance(vehicle, 9999999 + 1);
|
||||||
|
|
||||||
setElementPosition(vehicle, getPosInFrontOfPos(getPlayerPosition(client), fixAngle(getPlayerHeading(client)), 5.0));
|
setElementPosition(vehicle, getPosInFrontOfPos(getPlayerPosition(client), fixAngle(getPlayerHeading(client)), 5.0));
|
||||||
setElementInterior(vehicle, getPlayerInterior(client));
|
setElementInterior(vehicle, getPlayerInterior(client));
|
||||||
setElementDimension(vehicle, getPlayerDimension(client));
|
setElementDimension(vehicle, getPlayerDimension(client));
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} teleported a {vehiclePurple}${getVehicleName(vehicle)}{ALTCOLOUR} (ID ${vehicle.id}){MAINCOLOUR} to their position`);
|
setElementStreamInDistance(vehicle, oldStreamInDistance);
|
||||||
|
setElementStreamOutDistance(vehicle, oldStreamOutDistance);
|
||||||
|
|
||||||
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} teleported a {vehiclePurple}${getVehicleName(vehicle)}{ALTCOLOUR} (ID ${vehicle.id}){MAINCOLOUR} to their position`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -888,7 +897,7 @@ function getPlayerCommand(command, params, client) {
|
|||||||
setPlayerInterior(targetClient, getPlayerInterior(client));
|
setPlayerInterior(targetClient, getPlayerInterior(client));
|
||||||
setPlayerDimension(targetClient, getPlayerDimension(client));
|
setPlayerDimension(targetClient, getPlayerDimension(client));
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} teleported {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their position.`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} teleported {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their position.`, true);
|
||||||
messagePlayerAlert(targetClient, `An admin has teleported you to their location`);
|
messagePlayerAlert(targetClient, `An admin has teleported you to their location`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -935,7 +944,7 @@ function returnPlayerCommand(command, params, client) {
|
|||||||
getPlayerData(targetClient).returnToBusiness = null;
|
getPlayerData(targetClient).returnToBusiness = null;
|
||||||
getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_NONE;
|
getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_NONE;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} returned {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their previous position.`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} returned {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their previous position.`, true);
|
||||||
messagePlayerAlert(targetClient, `An admin has returned you to your previous location`);
|
messagePlayerAlert(targetClient, `An admin has returned you to your previous location`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,8 +133,13 @@ function thirtyMinuteTimerFunction() {
|
|||||||
if (getClients().length > 0) {
|
if (getClients().length > 0) {
|
||||||
checkPayDays();
|
checkPayDays();
|
||||||
}
|
}
|
||||||
saveServerDataToDatabase();
|
|
||||||
|
if (isGameFeatureSupported("snow")) {
|
||||||
|
checkSnowChance();
|
||||||
|
}
|
||||||
|
|
||||||
checkInactiveVehicleRespawns();
|
checkInactiveVehicleRespawns();
|
||||||
|
saveServerDataToDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -262,7 +267,7 @@ function checkServerGameTime() {
|
|||||||
game.time.minute = getServerConfig().minute;
|
game.time.minute = getServerConfig().minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTimeRule();
|
updateServerRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -335,4 +340,15 @@ function checkInactiveVehicleRespawns() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function checkSnowChance() {
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
let shouldBeSnowing = getRandomBoolWithProbability(getGlobalConfig().monthlyChanceOfSnow[date.getMonths()]);
|
||||||
|
getServerConfig().groundSnow = shouldBeSnowing;
|
||||||
|
getServerConfig().fallingSnow = shouldBeSnowing;
|
||||||
|
updatePlayerSnowState(null);
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -79,32 +79,44 @@ function initAllClients() {
|
|||||||
function updateServerRules() {
|
function updateServerRules() {
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Updating all server rules ...`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Updating all server rules ...`);
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Time support: ${isTimeSupported()}`);
|
let timeWeatherRule = [];
|
||||||
|
let tempText = "";
|
||||||
|
|
||||||
if (isTimeSupported()) {
|
if (isTimeSupported()) {
|
||||||
if (getServerConfig() != false) {
|
if (getServerConfig() != false) {
|
||||||
let value = makeReadableTime(getServerConfig().hour, getServerConfig().minute);
|
tempText = makeReadableTime(getServerConfig().hour, getServerConfig().minute);
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Setting server rule "Time" as ${value}`);
|
timeWeatherRule.push(tempText);
|
||||||
server.setRule("Time", value);
|
}
|
||||||
|
} else {
|
||||||
|
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
||||||
|
if (isNightTime(getServerConfig().hour)) {
|
||||||
|
tempText = "Night";
|
||||||
|
} else {
|
||||||
|
tempText = "Day";
|
||||||
|
}
|
||||||
|
|
||||||
|
timeWeatherRule.push(tempText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isWeatherSupported()) {
|
if (isWeatherSupported()) {
|
||||||
if (getServerConfig() != false) {
|
if (getServerConfig() != false) {
|
||||||
if (typeof getGameConfig().weatherNames[getGame()] != "undefined") {
|
if (typeof getGameConfig().weatherNames[getGame()] != "undefined") {
|
||||||
let value = getGameConfig().weatherNames[getGame()][getServerConfig().weather];
|
let tempText = getGameConfig().weatherNames[getGame()][getServerConfig().weather];
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Setting server rule "Weather" as ${value}`);
|
timeWeatherRule.push(tempText);
|
||||||
server.setRule("Weather", value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSnowSupported()) {
|
if (isSnowSupported()) {
|
||||||
if (getServerConfig() != false) {
|
if (getServerConfig() != false) {
|
||||||
let value = getYesNoFromBool(getServerConfig().fallingSnow);
|
if (getServerConfig().fallingSnow == true) {
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Setting server rule "Snowing" as ${value}`);
|
timeWeatherRule.push("Snowing");
|
||||||
server.setRule("Snowing", value);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setServerRule("Time & Weather", timeWeatherRule.join(", "));
|
||||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: All server rules updated successfully!`);
|
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: All server rules updated successfully!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,22 +424,6 @@ function clearTemporaryPeds() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateTimeRule() {
|
|
||||||
if (isTimeSupported()) {
|
|
||||||
server.setRule("Time", makeReadableTime(game.time.hour, game.time.minute));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_MAFIA_ONE) {
|
|
||||||
if (isNightTime(getServerConfig().hour)) {
|
|
||||||
server.setRule("Time", "Night");
|
|
||||||
} else {
|
|
||||||
server.setRule("Time", "Day");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function isClientInitialized(client) {
|
function isClientInitialized(client) {
|
||||||
//if (typeof getServerData().clients[getPlayerId(client)] == "undefined") {
|
//if (typeof getServerData().clients[getPlayerId(client)] == "undefined") {
|
||||||
// return false;
|
// return false;
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ function createVehicleCommand(command, params, client) {
|
|||||||
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getGlobalConfig().spawnCarDistance);
|
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getGlobalConfig().spawnCarDistance);
|
||||||
let vehicle = createPermanentVehicle(modelIndex, frontPos, heading, getPlayerInterior(client), getPlayerDimension(client));
|
let vehicle = createPermanentVehicle(modelIndex, frontPos, heading, getPlayerInterior(client), getPlayerDimension(client));
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created a {vehiclePurple}${getVehicleName(vehicle)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created a {vehiclePurple}${getVehicleName(vehicle)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -396,7 +396,7 @@ function createTemporaryVehicleCommand(command, params, client) {
|
|||||||
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getGlobalConfig().spawnCarDistance);
|
let frontPos = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getGlobalConfig().spawnCarDistance);
|
||||||
let vehicle = createTemporaryVehicle(modelIndex, frontPos, getPlayerHeading(client), getPlayerInterior(client), getPlayerDimension(client));
|
let vehicle = createTemporaryVehicle(modelIndex, frontPos, getPlayerHeading(client), getPlayerInterior(client), getPlayerDimension(client));
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created a temporary {vehiclePurple}${getVehicleName(vehicle)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created a temporary {vehiclePurple}${getVehicleName(vehicle)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -902,7 +902,7 @@ function setVehicleJobCommand(command, params, client) {
|
|||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to the {jobYellow}${getJobData(jobId).name} {MAINCOLOUR}job! (Job ID ${jobId})`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to the {jobYellow}${getJobData(jobId).name} {MAINCOLOUR}job! (Job ID ${jobId})`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -933,10 +933,10 @@ function setVehicleRankCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
getVehicleData(vehicle).rank = getClanRankData(getVehicleData(vehicle).ownerId, rankId).databaseId;
|
getVehicleData(vehicle).rank = getClanRankData(getVehicleData(vehicle).ownerId, rankId).databaseId;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rank to {ALTCOLOUR}${getClanRankData(getVehicleData(vehicle).ownerId, rankId).name}{MAINCOLOUR} of the {clanOrange}${getClanData(getVehicleData(vehicle).ownerId).name}{MAINCOLOUR} clan!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} minimum rank to {ALTCOLOUR}${getClanRankData(getVehicleData(vehicle).ownerId, rankId).name}{MAINCOLOUR} of the {clanOrange}${getClanData(getVehicleData(vehicle).ownerId).name}{MAINCOLOUR} clan!`, true);
|
||||||
} else if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
} else if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) {
|
||||||
getVehicleData(vehicle).rank = rankId;
|
getVehicleData(vehicle).rank = rankId;
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rank to {ALTCOLOUR}${rankId}{MAINCOLOUR} of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name}{MAINCOLOUR} job!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} minimum rank to {ALTCOLOUR}${rankId}{MAINCOLOUR} of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name}{MAINCOLOUR} job!`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
@@ -981,14 +981,18 @@ function setVehicleClanCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleToBusinessCommand(command, params, client) {
|
function setVehicleBusinessCommand(command, params, client) {
|
||||||
if (!isPlayerInAnyVehicle(client)) {
|
if (!isPlayerInAnyVehicle(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeInAVehicle"));
|
messagePlayerError(client, getLocaleString(client, "MustBeInAVehicle"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let vehicle = getPlayerVehicle(client);
|
let vehicle = getPlayerVehicle(client);
|
||||||
let businessId = getPlayerBusiness(client);
|
let businessId = getClosestBusinessEntrance(client);
|
||||||
|
|
||||||
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses")) && !isNull(params)) {
|
||||||
|
businessId = getBusinessFromParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
if (!getVehicleData(vehicle)) {
|
if (!getVehicleData(vehicle)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
|
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
|
||||||
@@ -1003,7 +1007,7 @@ function setVehicleToBusinessCommand(command, params, client) {
|
|||||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_BIZ;
|
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_BIZ;
|
||||||
getVehicleData(vehicle).ownerId = getBusinessData(businessId).databaseId;
|
getVehicleData(vehicle).ownerId = getBusinessData(businessId).databaseId;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to the {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}business`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to the {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}business`, true);
|
||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
}
|
}
|
||||||
@@ -1032,7 +1036,7 @@ function setVehicleOwnerCommand(command, params, client) {
|
|||||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PLAYER;
|
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PLAYER;
|
||||||
getVehicleData(vehicle).ownerId = getPlayerCurrentSubAccount(targetClient).databaseId;
|
getVehicleData(vehicle).ownerId = getPlayerCurrentSubAccount(targetClient).databaseId;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to {ALTCOLOUR}${getClientSubAccountName(targetClient)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to {ALTCOLOUR}${getClientSubAccountName(targetClient)}`, true);
|
||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
}
|
}
|
||||||
@@ -1055,7 +1059,7 @@ function setVehiclePublicCommand(command, params, client) {
|
|||||||
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PUBLIC;
|
getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PUBLIC;
|
||||||
getVehicleData(vehicle).ownerId = 0;
|
getVehicleData(vehicle).ownerId = 0;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to a public vehicle!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to a public vehicle!`, true);
|
||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
}
|
}
|
||||||
@@ -1086,7 +1090,7 @@ function setVehicleRentPriceCommand(command, params, client) {
|
|||||||
getVehicleData(vehicle).rentPrice = amount;
|
getVehicleData(vehicle).rentPrice = amount;
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rent price to {ALTCOLOUR}${getCurrencyString(amount)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rent price to {ALTCOLOUR}${getCurrencyString(amount)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1115,7 +1119,7 @@ function setVehicleBuyPriceCommand(command, params, client) {
|
|||||||
getVehicleData(vehicle).buyPrice = amount;
|
getVehicleData(vehicle).buyPrice = amount;
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}'s{MAINCOLOUR} buy price to {ALTCOLOUR}${getCurrencyString(amount)}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}'s{MAINCOLOUR} buy price to {ALTCOLOUR}${getCurrencyString(amount)}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1144,7 +1148,7 @@ function removeVehicleOwnerCommand(command, params, client) {
|
|||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to nobody!`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to nobody!`, true);
|
||||||
messagePlayerInfo(client, `Nobody will be able to use this vehicle until it receives a new owner (either bought or set by admin).`);
|
messagePlayerInfo(client, `Nobody will be able to use this vehicle until it receives a new owner (either bought or set by admin).`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1296,7 +1300,7 @@ function toggleVehicleSpawnLockCommand(command, params, client) {
|
|||||||
getVehicleData(vehicle).spawnRotation = getVehicleHeading(vehicle);
|
getVehicleData(vehicle).spawnRotation = getVehicleHeading(vehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to spawn {ALTCOLOUR}${(getVehicleData(vehicle).spawnLocked) ? "at it's current location" : "wherever a player leaves it."}`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to spawn {ALTCOLOUR}${(getVehicleData(vehicle).spawnLocked) ? "at it's current location" : "wherever a player leaves it."}`, true);
|
||||||
|
|
||||||
getVehicleData(vehicle).needsSaved = true;
|
getVehicleData(vehicle).needsSaved = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,6 +214,16 @@ let supportedFeatures = {
|
|||||||
[AGRP_GAME_MAFIA_THREE]: false,
|
[AGRP_GAME_MAFIA_THREE]: false,
|
||||||
},
|
},
|
||||||
pedScale: {
|
pedScale: {
|
||||||
|
[AGRP_GAME_GTA_III]: true,
|
||||||
|
[AGRP_GAME_GTA_VC]: true,
|
||||||
|
[AGRP_GAME_GTA_SA]: false,
|
||||||
|
[AGRP_GAME_GTA_IV]: false,
|
||||||
|
[AGRP_GAME_GTA_IV_EFLC]: false,
|
||||||
|
[AGRP_GAME_MAFIA_ONE]: false,
|
||||||
|
[AGRP_GAME_MAFIA_TWO]: false,
|
||||||
|
[AGRP_GAME_MAFIA_THREE]: false
|
||||||
|
},
|
||||||
|
objectScale: {
|
||||||
[AGRP_GAME_GTA_III]: false,
|
[AGRP_GAME_GTA_III]: false,
|
||||||
[AGRP_GAME_GTA_VC]: false,
|
[AGRP_GAME_GTA_VC]: false,
|
||||||
[AGRP_GAME_GTA_SA]: false,
|
[AGRP_GAME_GTA_SA]: false,
|
||||||
@@ -282,6 +292,26 @@ let supportedFeatures = {
|
|||||||
[AGRP_GAME_MAFIA_ONE]: false,
|
[AGRP_GAME_MAFIA_ONE]: false,
|
||||||
[AGRP_GAME_MAFIA_TWO]: false,
|
[AGRP_GAME_MAFIA_TWO]: false,
|
||||||
[AGRP_GAME_MAFIA_THREE]: false,
|
[AGRP_GAME_MAFIA_THREE]: false,
|
||||||
|
},
|
||||||
|
toggleCollision: {
|
||||||
|
[AGRP_GAME_GTA_III]: true,
|
||||||
|
[AGRP_GAME_GTA_VC]: true,
|
||||||
|
[AGRP_GAME_GTA_SA]: true,
|
||||||
|
[AGRP_GAME_GTA_IV]: false,
|
||||||
|
[AGRP_GAME_GTA_IV_EFLC]: false,
|
||||||
|
[AGRP_GAME_MAFIA_ONE]: false,
|
||||||
|
[AGRP_GAME_MAFIA_TWO]: false,
|
||||||
|
[AGRP_GAME_MAFIA_THREE]: false,
|
||||||
|
},
|
||||||
|
vehicleUpgrades: {
|
||||||
|
[AGRP_GAME_GTA_III]: false,
|
||||||
|
[AGRP_GAME_GTA_VC]: false,
|
||||||
|
[AGRP_GAME_GTA_SA]: true,
|
||||||
|
[AGRP_GAME_GTA_IV]: true,
|
||||||
|
[AGRP_GAME_GTA_IV_EFLC]: true,
|
||||||
|
[AGRP_GAME_MAFIA_ONE]: false,
|
||||||
|
[AGRP_GAME_MAFIA_TWO]: false,
|
||||||
|
[AGRP_GAME_MAFIA_THREE]: false,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1815,7 +1815,7 @@ function getSkinIndexFromName(name, gameId = getGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getObjectModelIndexFromModel(model, gameId = getGame()) {
|
function getObjectModelIndexFromName(model, gameId = getGame()) {
|
||||||
let objects = getGameConfig().objects[gameId];
|
let objects = getGameConfig().objects[gameId];
|
||||||
for (let i in objects) {
|
for (let i in objects) {
|
||||||
if (toLowerCase(objects[i][0]).indexOf(toLowerCase(model)) != -1) {
|
if (toLowerCase(objects[i][0]).indexOf(toLowerCase(model)) != -1) {
|
||||||
@@ -1828,6 +1828,19 @@ function getObjectModelIndexFromModel(model, gameId = getGame()) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getObjectModelIndexFromModel(model, gameId = getGame()) {
|
||||||
|
let objects = getGameConfig().objects[gameId];
|
||||||
|
for (let i in objects) {
|
||||||
|
if (toLowerCase(objects[i][1]).indexOf(toLowerCase(model)) != -1) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function getGameName(gameId = getGame()) {
|
function getGameName(gameId = getGame()) {
|
||||||
return getGameConfig().gameNames[gameId];
|
return getGameConfig().gameNames[gameId];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user