Mafia Connected support
This commit is contained in:
@@ -58,7 +58,6 @@ function addAllEventHandlers() {
|
|||||||
function onResourceStart(event, resource) {
|
function onResourceStart(event, resource) {
|
||||||
sendResourceStartedSignalToServer();
|
sendResourceStartedSignalToServer();
|
||||||
setUpInitialGame();
|
setUpInitialGame();
|
||||||
|
|
||||||
garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
|
garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ let invalidValueColour = [200, 200, 200];
|
|||||||
|
|
||||||
let focusedColourOffset = 50;
|
let focusedColourOffset = 50;
|
||||||
|
|
||||||
let windowAlpha = 185;
|
let windowColour = (typeof gta == "undefined") ? [24, 24, 24, 150] : [0, 0, 0, 150];
|
||||||
let windowTitleAlpha = 200;
|
let windowTitleAlpha = 180;
|
||||||
let buttonAlpha = 200;
|
let buttonAlpha = 180;
|
||||||
let textInputAlpha = 200;
|
let textInputAlpha = 180;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
||||||
login.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
login.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@@ -235,7 +235,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating two factor auth GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating two factor auth GUI ...`);
|
||||||
twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@@ -313,7 +313,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
||||||
newCharacter.window = mexui.window(game.width/2-130, game.height/2-100, 300, 200, 'Character Name', {
|
newCharacter.window = mexui.window(game.width/2-130, game.height/2-100, 300, 200, 'Character Name', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@@ -405,7 +405,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
||||||
register.window = mexui.window(game.width/2-130, game.height/2-125, 300, 250, 'Register', {
|
register.window = mexui.window(game.width/2-130, game.height/2-125, 300, 250, 'Register', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@@ -472,7 +472,7 @@ function initGUI() {
|
|||||||
},
|
},
|
||||||
placeholder: {
|
placeholder: {
|
||||||
backgroundColour: toColour(0, 0, 0, 120),
|
backgroundColour: toColour(0, 0, 0, 120),
|
||||||
textColour: toColour(150, 150, 150, 200),
|
textColour: toColour(200, 200, 200, 200),
|
||||||
textSize: 10.0,
|
textSize: 10.0,
|
||||||
textFont: robotoFont,
|
textFont: robotoFont,
|
||||||
}
|
}
|
||||||
@@ -518,7 +518,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating error GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating error GUI ...`);
|
||||||
errorDialog.window = mexui.window(game.width/2-200, game.height/2-70, 500, 140, 'ERROR', {
|
errorDialog.window = mexui.window(game.width/2-200, game.height/2-70, 500, 140, 'ERROR', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@@ -564,7 +564,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI ...`);
|
||||||
yesNoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Question', {
|
yesNoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Question', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
transitionTime: 500,
|
transitionTime: 500,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@@ -623,7 +623,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`);
|
||||||
infoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Information', {
|
infoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Information', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
textSize: 11.0,
|
textSize: 11.0,
|
||||||
@@ -668,7 +668,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`);
|
||||||
listDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 500, 'List', {
|
listDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 500, 'List', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
textSize: 11.0,
|
textSize: 11.0,
|
||||||
@@ -699,7 +699,7 @@ function initGUI() {
|
|||||||
|
|
||||||
listDialog.listGrid = listDialog.window.grid(5, 25, 390, 450, {
|
listDialog.listGrid = listDialog.window.grid(5, 25, 390, 450, {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
@@ -709,7 +709,7 @@ function initGUI() {
|
|||||||
textColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
textColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
},
|
},
|
||||||
cell: {
|
cell: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
textColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
textColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||||
},
|
},
|
||||||
row: {
|
row: {
|
||||||
@@ -726,7 +726,7 @@ function initGUI() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
|
||||||
characterSelect.window = mexui.window(game.width/2-215, game.height/2-83, 430, 190, 'Select Character', {
|
characterSelect.window = mexui.window(game.width/2-215, game.height/2-83, 430, 190, 'Select Character', {
|
||||||
main: {
|
main: {
|
||||||
backgroundColour: toColour(0, 0, 0, windowAlpha),
|
backgroundColour: toColour(windowColour[0], windowColour[1], windowColour[2], windowColour[3]),
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
textSize: 11.0,
|
textSize: 11.0,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
let itemActionDelayDuration = 0;
|
let itemActionDelayDuration = 0;
|
||||||
let itemActionDelayStart = 0;
|
let itemActionDelayStart = 0;
|
||||||
let itemActionDelayEnabled = false;
|
let itemActionDelayEnabled = false;
|
||||||
let itemActionDelayPosition = toVector2(gta.width/2-100, gta.height-10);
|
let itemActionDelayPosition = toVector2(game.width/2-100, game.height-10);
|
||||||
let itemActionDelaySize = toVector2(200, 5);
|
let itemActionDelaySize = toVector2(200, 5);
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -37,28 +37,32 @@ function setLocalPlayerWorkingState(tempWorking) {
|
|||||||
|
|
||||||
function showJobRouteStop() {
|
function showJobRouteStop() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Showing route stop`);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Showing route stop`);
|
||||||
if(gta.game == GAME_GTA_SA) {
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
jobRouteStopSphere = gta.createPickup(1318, position, 1);
|
if(gta.game == GAME_GTA_SA) {
|
||||||
} else {
|
jobRouteStopSphere = gta.createPickup(1318, position, 1);
|
||||||
jobRouteStopSphere = gta.createSphere(position, 3);
|
} else {
|
||||||
jobRouteStopSphere.colour = colour;
|
jobRouteStopSphere = gta.createSphere(position, 3);
|
||||||
}
|
jobRouteStopSphere.colour = colour;
|
||||||
|
}
|
||||||
|
|
||||||
jobRouteStopBlip = gta.createBlip(position, 0, 2, colour);
|
jobRouteStopBlip = gta.createBlip(position, 0, 2, colour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showJobRouteStop(position, colour) {
|
function showJobRouteStop(position, colour) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Showing route stop`);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Showing route stop`);
|
||||||
if(gta.game == GAME_GTA_SA) {
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
jobRouteStopSphere = gta.createPickup(1318, position, 1);
|
if(gta.game == GAME_GTA_SA) {
|
||||||
} else {
|
jobRouteStopSphere = gta.createPickup(1318, position, 1);
|
||||||
jobRouteStopSphere = gta.createSphere(position, 3);
|
} else {
|
||||||
jobRouteStopSphere.colour = colour;
|
jobRouteStopSphere = gta.createSphere(position, 3);
|
||||||
}
|
jobRouteStopSphere.colour = colour;
|
||||||
|
}
|
||||||
|
|
||||||
jobRouteStopBlip = gta.createBlip(position, 0, 2, colour);
|
jobRouteStopBlip = gta.createBlip(position, 0, 2, colour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
|
|||||||
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
||||||
let screenPosition = getScreenFromWorldPosition(tempPosition);
|
let screenPosition = getScreenFromWorldPosition(tempPosition);
|
||||||
|
|
||||||
if(screenPosition.x < 0 || screenPosition.x > gta.width) {
|
if(screenPosition.x < 0 || screenPosition.x > game.width) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ function renderPropertyExitLabel(position) {
|
|||||||
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
||||||
let screenPosition = getScreenFromWorldPosition(tempPosition);
|
let screenPosition = getScreenFromWorldPosition(tempPosition);
|
||||||
|
|
||||||
if(screenPosition.x < 0 || screenPosition.x > gta.width) {
|
if(screenPosition.x < 0 || screenPosition.x > game.width) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
tempPosition.z = tempPosition.z + propertyLabelHeight;
|
||||||
let screenPosition = getScreenFromWorldPosition(tempPosition);
|
let screenPosition = getScreenFromWorldPosition(tempPosition);
|
||||||
|
|
||||||
if(screenPosition.x < 0 || screenPosition.x > gta.width) {
|
if(screenPosition.x < 0 || screenPosition.x > game.width) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ function renderJobLabel(name, position, jobType) {
|
|||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
function processLabelRendering() {
|
function processLabelRendering() {
|
||||||
if(renderLabels && gta.game != GAME_GTA_IV) {
|
if(renderLabels && areWorldLabelsSupported()) {
|
||||||
if(localPlayer != null) {
|
if(localPlayer != null) {
|
||||||
let pickups = getElementsByType(ELEMENT_PICKUP);
|
let pickups = getElementsByType(ELEMENT_PICKUP);
|
||||||
for(let i in pickups) {
|
for(let i in pickups) {
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let logoImage = null;
|
let logoImage = null;
|
||||||
let logoPos = toVector2(gta.width-132, gta.height-132);
|
let logoPos = toVector2(game.width-132, game.height-132);
|
||||||
let logoSize = toVector2(128, 128);
|
let logoSize = toVector2(128, 128);
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function initLogoScript() {
|
function initLogoScript() {
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Logo]: Initializing logo script ...");
|
logToConsole(LOG_DEBUG, "[VRR.Logo]: Initializing logo script ...");
|
||||||
logoImage = loadLogoImage();
|
//logoImage = loadLogoImage();
|
||||||
logToConsole(LOG_DEBUG, "[VRR.Logo]: Logo script initialized!");
|
logToConsole(LOG_DEBUG, "[VRR.Logo]: Logo script initialized!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ function loadLogoImage() {
|
|||||||
let logoStream = openFile(mainLogoPath);
|
let logoStream = openFile(mainLogoPath);
|
||||||
let tempLogoImage = null;
|
let tempLogoImage = null;
|
||||||
if(logoStream != null) {
|
if(logoStream != null) {
|
||||||
tempLogoImage = drawing.loadPNG(logoStream);
|
tempLogoImage = graphics.loadPNG(logoStream);
|
||||||
logoStream.close();
|
logoStream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,4 +48,6 @@ let enterPropertyKey = null;
|
|||||||
|
|
||||||
let forcedAnimation = null;
|
let forcedAnimation = null;
|
||||||
|
|
||||||
|
let calledDeathEvent = false;
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -52,7 +52,7 @@ function processSmallGameMessageRendering() {
|
|||||||
if(renderSmallGameMessage) {
|
if(renderSmallGameMessage) {
|
||||||
if(smallGameMessageFont != null) {
|
if(smallGameMessageFont != null) {
|
||||||
if(smallGameMessageFont != "") {
|
if(smallGameMessageFont != "") {
|
||||||
smallGameMessageFont.render(smallGameMessageText, [0, gta.height-50], gta.width, 0.5, 0.0, smallGameMessageFont.size, smallGameMessageColour, true, true, false, true);
|
smallGameMessageFont.render(smallGameMessageText, [0, game.height-50], game.width, 0.5, 0.0, smallGameMessageFont.size, smallGameMessageColour, true, true, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,10 +80,14 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
|
|||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
// Health Bar
|
// Health Bar
|
||||||
|
|
||||||
if(gta.game == GAME_GTA_III) {
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
|
if(gta.game == GAME_GTA_III) {
|
||||||
if(skin == 109) {
|
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
|
||||||
y -= 20;
|
if(skin == 109) {
|
||||||
|
y -= 20;
|
||||||
|
} else {
|
||||||
|
y -= 5;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
y -= 5;
|
y -= 5;
|
||||||
}
|
}
|
||||||
@@ -199,9 +203,9 @@ function getClientFromPlayer(player) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processNameTagRendering(event) {
|
function processNameTagRendering(event) {
|
||||||
if(gta.game >= GAME_GTA_IV) {
|
//if(gta.game >= GAME_GTA_IV) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
|
||||||
getElementsByType(ELEMENT_PLAYER).forEach(function(player) {
|
getElementsByType(ELEMENT_PLAYER).forEach(function(player) {
|
||||||
if(player != localPlayer) {
|
if(player != localPlayer) {
|
||||||
|
|||||||
@@ -10,7 +10,14 @@
|
|||||||
function setUpInitialGame() {
|
function setUpInitialGame() {
|
||||||
if(mafia.game == GAME_MAFIA_ONE) {
|
if(mafia.game == GAME_MAFIA_ONE) {
|
||||||
mafia.mapEnabled = false;
|
mafia.mapEnabled = false;
|
||||||
|
mafia.setTrafficEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
addEventHandler("OnMapLoaded", function(event) {
|
||||||
|
initClientScripts();
|
||||||
|
});
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -129,7 +129,8 @@ function onServerSpawnedPlayer(state) {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
|
logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
|
||||||
isSpawned = state;
|
isSpawned = state;
|
||||||
if(state) {
|
if(state) {
|
||||||
setUpInitialGame
|
setUpInitialGame();
|
||||||
|
calledDeathEvent = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +155,7 @@ function tellServerItemActionDelayComplete() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendServerClientInfo() {
|
function sendServerClientInfo() {
|
||||||
triggerNetworkEvent("vrr.clientInfo", `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`, gta.width, gta.height);
|
triggerNetworkEvent("vrr.clientInfo", `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`, game.width, game.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -63,21 +63,21 @@ function loadSkinSelectMessageFontBottom() {
|
|||||||
function processSkinSelectKeyPress(keyCode) {
|
function processSkinSelectKeyPress(keyCode) {
|
||||||
if(usingSkinSelector) {
|
if(usingSkinSelector) {
|
||||||
if(keyCode == SDLK_RIGHT) {
|
if(keyCode == SDLK_RIGHT) {
|
||||||
if(allowedSkins[gta.game].length-1 == skinSelectorIndex) {
|
if(allowedSkins[game.game].length-1 == skinSelectorIndex) {
|
||||||
skinSelectorIndex = 0;
|
skinSelectorIndex = 0;
|
||||||
} else {
|
} else {
|
||||||
skinSelectorIndex++;
|
skinSelectorIndex++;
|
||||||
}
|
}
|
||||||
localPlayer.skin = allowedSkins[gta.game][skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[game.game][skinSelectorIndex][0];
|
||||||
skinSelectMessageTextTop = allowedSkins[gta.game][skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[game.game][skinSelectorIndex][1];
|
||||||
} else if(keyCode == SDLK_LEFT) {
|
} else if(keyCode == SDLK_LEFT) {
|
||||||
if(skinSelectorIndex <= 0) {
|
if(skinSelectorIndex <= 0) {
|
||||||
skinSelectorIndex = allowedSkins[gta.game].length-1;
|
skinSelectorIndex = allowedSkins[game.game].length-1;
|
||||||
} else {
|
} else {
|
||||||
skinSelectorIndex--;
|
skinSelectorIndex--;
|
||||||
}
|
}
|
||||||
localPlayer.skin = allowedSkins[gta.game][skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[game.game][skinSelectorIndex][0];
|
||||||
skinSelectMessageTextTop = allowedSkins[gta.game][skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[game.game][skinSelectorIndex][1];
|
||||||
} else if(keyCode == SDLK_RETURN) {
|
} else if(keyCode == SDLK_RETURN) {
|
||||||
triggerNetworkEvent("vrr.skinSelected", skinSelectorIndex);
|
triggerNetworkEvent("vrr.skinSelected", skinSelectorIndex);
|
||||||
} else if(keyCode == SDLK_BACKSPACE) {
|
} else if(keyCode == SDLK_BACKSPACE) {
|
||||||
@@ -91,16 +91,18 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
function processSkinSelectRendering() {
|
function processSkinSelectRendering() {
|
||||||
if(usingSkinSelector) {
|
if(usingSkinSelector) {
|
||||||
if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
|
if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
|
||||||
if(gta.game != GAME_GTA_VC) {
|
//if(gta.game != GAME_GTA_VC) {
|
||||||
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, gta.height-100], gta.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
|
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
|
||||||
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, gta.height-65], gta.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
localPlayer.position = skinSelectPosition;
|
localPlayer.position = skinSelectPosition;
|
||||||
localPlayer.heading = skinSelectHeading;
|
localPlayer.heading = skinSelectHeading;
|
||||||
if(gta.game == GAME_GTA_III || gta.game == GAME_GTA_VC) {
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
localPlayer.clearObjective();
|
if(gta.game == GAME_GTA_III || gta.game == GAME_GTA_VC) {
|
||||||
|
localPlayer.clearObjective();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,14 +112,18 @@ function processSkinSelectRendering() {
|
|||||||
function toggleSkinSelect(state) {
|
function toggleSkinSelect(state) {
|
||||||
if(state) {
|
if(state) {
|
||||||
skinSelectorIndex = 0;
|
skinSelectorIndex = 0;
|
||||||
if(localPlayer.skin != allowedSkins[gta.game][skinSelectorIndex][0]) {
|
if(localPlayer.skin != allowedSkins[game.game][skinSelectorIndex][0]) {
|
||||||
localPlayer.skin = allowedSkins[gta.game][skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[game.game][skinSelectorIndex][0];
|
||||||
}
|
}
|
||||||
usingSkinSelector = true;
|
usingSkinSelector = true;
|
||||||
let tempPosition = localPlayer.position;
|
let tempPosition = localPlayer.position;
|
||||||
tempPosition.z += 0.5;
|
tempPosition.z += 0.5;
|
||||||
let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
|
let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
|
||||||
gta.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
|
|
||||||
|
if(isCustomCameraSupported()) {
|
||||||
|
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
|
||||||
|
}
|
||||||
|
|
||||||
gui.showCursor(true, false);
|
gui.showCursor(true, false);
|
||||||
localPlayer.invincible = true;
|
localPlayer.invincible = true;
|
||||||
localPlayer.setProofs(true, true, true, true, true);
|
localPlayer.setProofs(true, true, true, true, true);
|
||||||
|
|||||||
@@ -9,27 +9,30 @@
|
|||||||
|
|
||||||
function processSync(event, deltaTime) {
|
function processSync(event, deltaTime) {
|
||||||
if(localPlayer != null) {
|
if(localPlayer != null) {
|
||||||
if(gta.game == GAME_GTA_IV) {
|
if(!doesGameHaveServerElements()) {
|
||||||
triggerNetworkEvent("vrr.player.position", localPlayer.position);
|
triggerNetworkEvent("vrr.player.position", localPlayer.position);
|
||||||
triggerNetworkEvent("vrr.player.heading", localPlayer.heading);
|
triggerNetworkEvent("vrr.player.heading", localPlayer.heading);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gta.game == GAME_GTA_SA) {
|
//if(gta.game == GAME_GTA_SA) {
|
||||||
let lookAtPos = getLocalPlayerLookAtPosition();
|
// let lookAtPos = getLocalPlayerLookAtPosition();
|
||||||
triggerNetworkEvent("vrr.player.lookat", lookAtPos);
|
// triggerNetworkEvent("vrr.player.lookat", lookAtPos);
|
||||||
setEntityData(localPlayer, "vrr.headLook", lookAtPos);
|
// setEntityData(localPlayer, "vrr.headLook", lookAtPos);
|
||||||
let peds = getPeds();
|
// let peds = getPeds();
|
||||||
for(let i in peds) {
|
// for(let i in peds) {
|
||||||
if(doesEntityDataExist(peds[i], "vrr.headLook")) {
|
// if(doesEntityDataExist(peds[i], "vrr.headLook")) {
|
||||||
peds[i].lookAt(getEntityData(peds[i], "vrr.headLook"), 99999);
|
// peds[i].lookAt(getEntityData(peds[i], "vrr.headLook"), 99999);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(localPlayer.health <= 0) {
|
if(localPlayer.health <= 0) {
|
||||||
logToConsole(LOG_DEBUG, `Local player died`);
|
if(!calledDeathEvent) {
|
||||||
localPlayer.clearWeapons();
|
logToConsole(LOG_DEBUG, `Local player died`);
|
||||||
triggerNetworkEvent("vrr.playerDeath", localPlayer.position);
|
localPlayer.clearWeapons();
|
||||||
|
calledDeathEvent = true;
|
||||||
|
triggerNetworkEvent("vrr.playerDeath");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(streamingRadioElement) {
|
if(streamingRadioElement) {
|
||||||
|
|||||||
@@ -194,8 +194,13 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function fadeLocalCamera(state, time) {
|
function fadeLocalCamera(state, time) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
|
if(isFadeCameraSupported()) {
|
||||||
gta.fadeCamera(state, time);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
|
||||||
|
|
||||||
|
if(isFadeCameraSupported()) {
|
||||||
|
gta.fadeCamera(state, time);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -208,7 +213,9 @@ function removeLocalPlayerFromVehicle() {
|
|||||||
|
|
||||||
function restoreLocalCamera() {
|
function restoreLocalCamera() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
|
||||||
gta.restoreCamera(true);
|
if(isCustomCameraSupported()) {
|
||||||
|
gta.restoreCamera(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -223,22 +230,27 @@ function clearLocalPlayerOwnedPeds() {
|
|||||||
|
|
||||||
function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
|
function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
|
||||||
gta.setCameraLookAt(cameraPosition, cameraLookAt, true);
|
if(isCustomCameraSupported()) {
|
||||||
|
gta.setCameraLookAt(cameraPosition, cameraLookAt, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setCityAmbienceState(state, clearElements = false) {
|
function setCityAmbienceState(state, clearElements = false) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
|
||||||
gta.setTrafficEnabled(state);
|
game.setTrafficEnabled(state);
|
||||||
gta.setGenerateCarsAroundCamera(state);
|
|
||||||
if(gta.game != GAME_GTA_SA) {
|
|
||||||
gta.setCiviliansEnabled(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(clearElements) {
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
clearSelfOwnedPeds();
|
gta.setGenerateCarsAroundCamera(state);
|
||||||
clearSelfOwnedVehicles();
|
if(gta.game != GAME_GTA_SA) {
|
||||||
|
gta.setCiviliansEnabled(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(clearElements) {
|
||||||
|
clearSelfOwnedPeds();
|
||||||
|
clearSelfOwnedVehicles();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,8 +333,10 @@ function setLocalPlayerHeading(heading) {
|
|||||||
|
|
||||||
function setLocalPlayerInterior(interior) {
|
function setLocalPlayerInterior(interior) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
|
||||||
localPlayer.interior = interior;
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
gta.cameraInterior = interior;
|
localPlayer.interior = interior;
|
||||||
|
gta.cameraInterior = interior;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -351,7 +365,9 @@ function isSnowEnabled() {
|
|||||||
|
|
||||||
function playPedSpeech(pedName, speechId) {
|
function playPedSpeech(pedName, speechId) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`);
|
||||||
gta.SET_CHAR_SAY(int, int);
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
|
gta.SET_CHAR_SAY(int, int);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -364,23 +380,25 @@ function clearLocalPedState() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getWeaponSlot(weaponId) {
|
function getWeaponSlot(weaponId) {
|
||||||
return weaponSlots[gta.game][weaponId];
|
return weaponSlots[game.game][weaponId];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerDrunkEffect(amount, duration) {
|
function setLocalPlayerDrunkEffect(amount, duration) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`);
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
drunkEffectAmount = 0;
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`);
|
||||||
drunkEffectDurationTimer = setInterval(function() {
|
drunkEffectAmount = 0;
|
||||||
drunkEffectAmount = drunkEffectAmount;
|
drunkEffectDurationTimer = setInterval(function() {
|
||||||
if(drunkEffectAmount > 0) {
|
drunkEffectAmount = drunkEffectAmount;
|
||||||
gta.SET_MOTION_BLUR(drunkEffectAmount);
|
if(drunkEffectAmount > 0) {
|
||||||
} else {
|
gta.SET_MOTION_BLUR(drunkEffectAmount);
|
||||||
clearInterval(drunkEffectDurationTimer);
|
} else {
|
||||||
drunkEffectDurationTimer = null;
|
clearInterval(drunkEffectDurationTimer);
|
||||||
}
|
drunkEffectDurationTimer = null;
|
||||||
}, 1000);
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -456,7 +474,10 @@ function setLocalPlayerCash(amount) {
|
|||||||
function removeWorldObject(model, position, range) {
|
function removeWorldObject(model, position, range) {
|
||||||
if(isRemovingWorldObjectsSupported()) {
|
if(isRemovingWorldObjectsSupported()) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Removing world object ${model} at X: ${position.x}, Y: ${position.x}, Z: ${position.x} with range of ${range}`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Removing world object ${model} at X: ${position.x}, Y: ${position.x}, Z: ${position.x} with range of ${range}`);
|
||||||
gta.removeWorldObject(model, position, range);
|
|
||||||
|
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
|
game.removeWorldObject(model, position, range);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,8 +653,8 @@ function getPosInFrontOfPos(pos, angle, distance) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllowedSkinIndexBySkinId(skinId) {
|
function getAllowedSkinIndexBySkinId(skinId) {
|
||||||
for(let i in allowedSkins[gta.game]) {
|
for(let i in allowedSkins[game.game]) {
|
||||||
if(skinId == allowedSkins[gta.game][i][0]) {
|
if(skinId == allowedSkins[game.game][i][0]) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -644,7 +665,10 @@ function getAllowedSkinIndexBySkinId(skinId) {
|
|||||||
|
|
||||||
function setMinuteDuration(minuteDuration) {
|
function setMinuteDuration(minuteDuration) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`);
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`);
|
||||||
gta.time.minuteDuration = minuteDuration;
|
|
||||||
|
if(isTimeSupported()) {
|
||||||
|
gta.time.minuteDuration = minuteDuration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -657,7 +681,7 @@ function getStreamingRadioVolumeForPosition(position) {
|
|||||||
|
|
||||||
function getLocalPlayerLookAtPosition() {
|
function getLocalPlayerLookAtPosition() {
|
||||||
if(localPlayer != null) {
|
if(localPlayer != null) {
|
||||||
let centerCameraPos = getWorldFromScreenPosition(toVector3(gta.width/2, gta.height/2, 0));
|
let centerCameraPos = getWorldFromScreenPosition(toVector3(game.width/2, game.height/2, 0));
|
||||||
return getWorldFromScreenPosition(toVector3(gta.width/2, gta.height/2, getDistance(centerCameraPos, localPlayer.position)+20));
|
return getWorldFromScreenPosition(toVector3(game.width/2, game.height/2, getDistance(centerCameraPos, localPlayer.position)+20));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -522,54 +522,48 @@ function loginSuccess(client) {
|
|||||||
function saveAccountToDatabase(accountData) {
|
function saveAccountToDatabase(accountData) {
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if(dbConnection) {
|
||||||
//logToConsole(LOG_VERBOSE, `Escaping account data for ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_VERBOSE, `Escaping account data for ${accountData.name}`);
|
||||||
|
let safeAccountName = escapeDatabaseString(dbConnection, accountData.name);
|
||||||
|
logToConsole(LOG_VERBOSE, `${accountData.name}'s name escaped successfully`);
|
||||||
let safePassword = escapeDatabaseString(dbConnection, accountData.password);
|
let safePassword = escapeDatabaseString(dbConnection, accountData.password);
|
||||||
//logToConsole(LOG_VERBOSE, `${getPlayerDisplayForConsole(accountData.name)}'s password escaped successfully`);
|
logToConsole(LOG_VERBOSE, `${accountData.name}'s password escaped successfully`);
|
||||||
let safeStaffTitle = escapeDatabaseString(dbConnection, accountData.staffTitle);
|
let safeStaffTitle = escapeDatabaseString(dbConnection, accountData.staffTitle);
|
||||||
//logToConsole(LOG_VERBOSE, `${getPlayerDisplayForConsole(client)}'s staff title escaped successfully`);
|
logToConsole(LOG_VERBOSE, `${accountData.name}'s staff title escaped successfully`);
|
||||||
let safeEmailAddress = escapeDatabaseString(dbConnection, accountData.emailAddress);
|
let safeEmailAddress = escapeDatabaseString(dbConnection, accountData.emailAddress);
|
||||||
//logToConsole(LOG_VERBOSE, `${getPlayerDisplayForConsole(client)}'s email address escaped successfully`);
|
logToConsole(LOG_VERBOSE, `${accountData.name}'s email address escaped successfully`);
|
||||||
|
|
||||||
let dbQueryString =
|
let data = [
|
||||||
`UPDATE acct_main SET
|
["acct_name", safeAccountName],
|
||||||
acct_email='${safeEmailAddress}',
|
["acct_pass", safePassword],
|
||||||
acct_pass='${safePassword}',
|
//["acct_staff_title", safeStaffTitle],
|
||||||
acct_discord=${accountData.discordAccount},
|
["acct_email", safeEmailAddress],
|
||||||
acct_ip=INET_ATON('${accountData.ipAddress}'),
|
//["acct_irc", safeIRC],
|
||||||
acct_code_verifyemail='${accountData.emailVerificationCode}',
|
["acct_discord", accountData.discordAccount],
|
||||||
acct_streaming_radio_volume=${accountData.streamingRadioVolume}
|
["acct_code_verifyemail", accountData.emailVerificationCode],
|
||||||
WHERE acct_id=${accountData.databaseId}`;
|
["acct_streaming_radio_volume", accountData.streamingRadioVolume],
|
||||||
|
["acct_ip", accountData.ipAddress],
|
||||||
|
];
|
||||||
|
|
||||||
/*
|
let dbQuery = null;
|
||||||
acct_settings=${accountData.settings},
|
let queryString = createDatabaseUpdateQuery("acct_main", data, `acct_id=${accountData.databaseId}`);
|
||||||
acct_staff_title='${safeStaffTitle}',
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
acct_staff_flags=${accountData.flags.admin},
|
|
||||||
acct_mod_flags=${accountData.flags.moderation},
|
|
||||||
*/
|
|
||||||
|
|
||||||
//dbQueryString = dbQueryString.trim();
|
|
||||||
dbQueryString = dbQueryString.replace(/(?:\r\n|\r|\n|\t)/g, "");
|
|
||||||
|
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
|
|
||||||
|
let data2 = [
|
||||||
|
["acct_svr_settings", accountData.flags.settings],
|
||||||
|
["acct_svr_staff_title", safeStaffTitle],
|
||||||
|
["acct_svr_staff_flags", accountData.flags.admin],
|
||||||
|
["acct_svr_mod_flags", accountData.flags.moderation],
|
||||||
|
["acct_svr_chat_scroll_lines", accountData.chatScrollLines],
|
||||||
|
];
|
||||||
|
|
||||||
dbQuery = null;
|
dbQuery = null;
|
||||||
|
queryString = "";
|
||||||
dbQueryString =
|
queryString = createDatabaseUpdateQuery("acct_svr", data2, `acct_svr_acct=${accountData.databaseId} AND acct_svr_svr = ${getServerId()}`);
|
||||||
`UPDATE acct_svr SET
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
acct_svr_acct='${accountData.databaseId}',
|
|
||||||
acct_svr_settings=${accountData.flags.settings},
|
|
||||||
acct_svr_staff_title='${safeStaffTitle}',
|
|
||||||
acct_svr_staff_flags=${accountData.flags.admin},
|
|
||||||
acct_svr_mod_flags=${accountData.flags.moderation},
|
|
||||||
acct_svr_chat_scroll_lines=${accountData.chatScrollLines}
|
|
||||||
WHERE acct_svr_acct=${accountData.databaseId} AND acct_svr_svr = ${getServerId()}`;
|
|
||||||
|
|
||||||
//dbQueryString = dbQueryString.trim();
|
|
||||||
dbQueryString = dbQueryString.replace(/(?:\r\n|\r|\n|\t)/g, "");
|
|
||||||
|
|
||||||
dbQuery = queryDatabase(dbConnection, dbQueryString);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,7 +968,7 @@ function createDefaultKeybindsForAccount(accountDatabaseId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createDefaultAccountServerData(accountDatabaseId) {
|
function createDefaultAccountServerData(accountDatabaseId) {
|
||||||
for(let i = 1 ; i <= 4 ; i++) {
|
for(let i = 1 ; i <= 5 ; i++) {
|
||||||
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${i})`;
|
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${i})`;
|
||||||
quickDatabaseQuery(dbQueryString);
|
quickDatabaseQuery(dbQueryString);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -773,13 +773,13 @@ function buyBusinessCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getBusinessData(client).ownerType = VRR_BIZOWNER_PLAYER;
|
getBusinessData(businessId).ownerType = VRR_BIZOWNER_PLAYER;
|
||||||
getBusinessData(client).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||||
getBusinessData(client).buyPrice = 0;
|
getBusinessData(businessId).buyPrice = 0;
|
||||||
|
|
||||||
updateBusinessPickupLabelData(businessId);
|
updateBusinessPickupLabelData(businessId);
|
||||||
|
|
||||||
messagePlayerSuccess(client, `Business ${getInlineChatColourByType("businessBlue")}${getBusinessData(businessId).name} ${getInlineChatColourByName("white")}till has ${getInlineChatColourByName("lightGrey")}$${getBusinessData(businessId).till}`);
|
messagePlayerSuccess(client, `You are now the owner of ${getInlineChatColourByType("businessBlue")}${getBusinessData(businessId).name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -882,7 +882,9 @@ function getPlayerBusiness(client) {
|
|||||||
|
|
||||||
function saveAllBusinessesToDatabase() {
|
function saveAllBusinessesToDatabase() {
|
||||||
for(let i in getServerData().businesses) {
|
for(let i in getServerData().businesses) {
|
||||||
saveBusinessToDatabase(i);
|
if(getServerData().businesses[i].needsSaved) {
|
||||||
|
saveBusinessToDatabase(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -904,7 +906,7 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
["biz_entrance_fee", tempBusinessData.entranceFee],
|
["biz_entrance_fee", tempBusinessData.entranceFee],
|
||||||
["biz_till", tempBusinessData.till],
|
["biz_till", tempBusinessData.till],
|
||||||
["biz_entrance_pos_x", tempBusinessData.entrancePosition.x],
|
["biz_entrance_pos_x", tempBusinessData.entrancePosition.x],
|
||||||
["biz_entrance_pos_y", tempBusinessData.entrancePosition.x],
|
["biz_entrance_pos_y", tempBusinessData.entrancePosition.y],
|
||||||
["biz_entrance_pos_z", tempBusinessData.entrancePosition.z],
|
["biz_entrance_pos_z", tempBusinessData.entrancePosition.z],
|
||||||
["biz_entrance_rot_z", tempBusinessData.entranceRotation],
|
["biz_entrance_rot_z", tempBusinessData.entranceRotation],
|
||||||
["biz_entrance_int", tempBusinessData.entranceInterior],
|
["biz_entrance_int", tempBusinessData.entranceInterior],
|
||||||
@@ -928,10 +930,12 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
getServerData().businesses[businessId].databaseId = getDatabaseInsertId(dbConnection);
|
getServerData().businesses[businessId].databaseId = getDatabaseInsertId(dbConnection);
|
||||||
} else {
|
} else {
|
||||||
let queryString = createDatabaseUpdateQuery("biz_main", data, `WHERE biz_id=${tempBusinessData.databaseId}`);
|
let queryString = createDatabaseUpdateQuery("biz_main", data, `biz_id=${tempBusinessData.databaseId}`);
|
||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBusinessData(businessId).needsSaved = false;
|
||||||
|
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -618,6 +618,10 @@ function saveAllClanRanksToDatabase(clanId) {
|
|||||||
function saveClanToDatabase(clanId) {
|
function saveClanToDatabase(clanId) {
|
||||||
let tempClanData = getClanData(clanId);
|
let tempClanData = getClanData(clanId);
|
||||||
|
|
||||||
|
if(!tempClanData) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let dbConnection = connectToDatabase();
|
let dbConnection = connectToDatabase();
|
||||||
if(dbConnection) {
|
if(dbConnection) {
|
||||||
if(tempClanData.needsSaved) {
|
if(tempClanData.needsSaved) {
|
||||||
@@ -625,7 +629,7 @@ function saveClanToDatabase(clanId) {
|
|||||||
let safeTag = escapeDatabaseString(dbConnection, tempClanData.tag);
|
let safeTag = escapeDatabaseString(dbConnection, tempClanData.tag);
|
||||||
let safeMOTD = escapeDatabaseString(dbConnection, tempClanData.motd);
|
let safeMOTD = escapeDatabaseString(dbConnection, tempClanData.motd);
|
||||||
|
|
||||||
let queryData = [
|
let data = [
|
||||||
["clan_main", safeName],
|
["clan_main", safeName],
|
||||||
["clan_owner", tempClanData.ownerId],
|
["clan_owner", tempClanData.ownerId],
|
||||||
["clan_tag", safeTag],
|
["clan_tag", safeTag],
|
||||||
@@ -639,7 +643,7 @@ function saveClanToDatabase(clanId) {
|
|||||||
getClanData(clanId).databaseId = getDatabaseInsertId(dbConnection);
|
getClanData(clanId).databaseId = getDatabaseInsertId(dbConnection);
|
||||||
getClanData(clanId).needsSaved = false;
|
getClanData(clanId).needsSaved = false;
|
||||||
} else {
|
} else {
|
||||||
let queryString = createDatabaseUpdateQuery("clan_main", data, `WHERE clan_id=${tempClanData.databaseId} LIMIT 1`);
|
let queryString = createDatabaseUpdateQuery("clan_main", data, `clan_id=${tempClanData.databaseId} LIMIT 1`);
|
||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
getClanData(clanId).needsSaved = false;
|
getClanData(clanId).needsSaved = false;
|
||||||
}
|
}
|
||||||
@@ -667,7 +671,7 @@ function saveClanRankToDatabase(clanData, rankId) {
|
|||||||
let safeTag = escapeDatabaseString(dbConnection, tempClanRankData.customTag);
|
let safeTag = escapeDatabaseString(dbConnection, tempClanRankData.customTag);
|
||||||
let safeTitle = escapeDatabaseString(dbConnection, tempClanRankData.customTitle);
|
let safeTitle = escapeDatabaseString(dbConnection, tempClanRankData.customTitle);
|
||||||
|
|
||||||
let queryData = [
|
let data = [
|
||||||
["clan_rank_name", safeName],
|
["clan_rank_name", safeName],
|
||||||
["clan_rank_clan", tempClanRankData.clanId],
|
["clan_rank_clan", tempClanRankData.clanId],
|
||||||
["clan_rank_tag", safeTag],
|
["clan_rank_tag", safeTag],
|
||||||
@@ -684,7 +688,7 @@ function saveClanRankToDatabase(clanData, rankId) {
|
|||||||
getClanRankData(clanId, rankId).databaseId = getDatabaseInsertId(dbConnection);
|
getClanRankData(clanId, rankId).databaseId = getDatabaseInsertId(dbConnection);
|
||||||
getClanRankData(clanId, rankId).needsSaved = false;
|
getClanRankData(clanId, rankId).needsSaved = false;
|
||||||
} else {
|
} else {
|
||||||
let queryString = createDatabaseUpdateQuery("clan_rank_main", data, `WHERE clan_rank_id=${tempClanRankData.databaseId} LIMIT 1`);
|
let queryString = createDatabaseUpdateQuery("clan_rank_main", data, `clan_rank_id=${tempClanRankData.databaseId} LIMIT 1`);
|
||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
getClanRankData(clanId, rankId).needsSaved = false;
|
getClanRankData(clanId, rankId).needsSaved = false;
|
||||||
}
|
}
|
||||||
@@ -738,7 +742,7 @@ function setClanRankTitle(clanId, rankId, title) {
|
|||||||
|
|
||||||
function saveAllClansToDatabase() {
|
function saveAllClansToDatabase() {
|
||||||
for(let i in getServerData().clans) {
|
for(let i in getServerData().clans) {
|
||||||
saveClanToDatabase(getServerData().clans[i]);
|
saveClanToDatabase(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -414,8 +414,9 @@ function initClassTable() {
|
|||||||
this.account = toInteger(dbAssoc["sacct_acct"]);
|
this.account = toInteger(dbAssoc["sacct_acct"]);
|
||||||
this.skin = toInteger(dbAssoc["sacct_svr_skin"]);
|
this.skin = toInteger(dbAssoc["sacct_svr_skin"]);
|
||||||
this.cash = toInteger(dbAssoc["sacct_cash"]);
|
this.cash = toInteger(dbAssoc["sacct_cash"]);
|
||||||
|
console.log(dbAssoc["sacct_pos_x"]);
|
||||||
this.spawnPosition = toVector3(toFloat(dbAssoc["sacct_pos_x"]), toFloat(dbAssoc["sacct_pos_y"]), toFloat(dbAssoc["sacct_pos_z"]));
|
this.spawnPosition = toVector3(toFloat(dbAssoc["sacct_pos_x"]), toFloat(dbAssoc["sacct_pos_y"]), toFloat(dbAssoc["sacct_pos_z"]));
|
||||||
this.spawnHeading = toFloat(dbAssoc["sacct_angle"]);
|
this.spawnHeading = toFloat(dbAssoc["sacct_rot_z"]);
|
||||||
this.lastLogin = toInteger(dbAssoc["sacct_when_lastlogin"]);
|
this.lastLogin = toInteger(dbAssoc["sacct_when_lastlogin"]);
|
||||||
this.clan = toInteger(dbAssoc["sacct_svr_clan"]);
|
this.clan = toInteger(dbAssoc["sacct_svr_clan"]);
|
||||||
this.clanFlags = toInteger(dbAssoc["sacct_svr_clan_flags"]);
|
this.clanFlags = toInteger(dbAssoc["sacct_svr_clan_flags"]);
|
||||||
@@ -1267,6 +1268,7 @@ function initClassTable() {
|
|||||||
this.supplyMultiplier = 1;
|
this.supplyMultiplier = 1;
|
||||||
this.riskMultiplier = 1;
|
this.riskMultiplier = 1;
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
|
this.useDelay = 0;
|
||||||
this.switchDelay = 0;
|
this.switchDelay = 0;
|
||||||
this.pickupDelay = 0;
|
this.pickupDelay = 0;
|
||||||
this.putDelay = 0;
|
this.putDelay = 0;
|
||||||
|
|||||||
@@ -522,12 +522,9 @@ function showPlayerItemTakeDelay(client, itemId) {
|
|||||||
if(delay > 0) {
|
if(delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
||||||
setTimeout(function() {
|
|
||||||
playerItemActionDelayComplete(client);
|
|
||||||
}, delay+getGlobalConfig().itemActionDelayExtraTimeout);
|
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerTakeItem(client, itemId);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -540,12 +537,9 @@ function showPlayerItemUseDelay(client, itemSlot) {
|
|||||||
if(delay > 0) {
|
if(delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
||||||
setTimeout(function() {
|
|
||||||
playerItemActionDelayComplete(client);
|
|
||||||
}, delay+getGlobalConfig().itemActionDelayExtraTimeout);
|
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerUseItem(client, itemSlot);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -558,12 +552,9 @@ function showPlayerItemDropDelay(client, itemSlot) {
|
|||||||
if(delay > 0) {
|
if(delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
||||||
setTimeout(function() {
|
|
||||||
playerItemActionDelayComplete(client);
|
|
||||||
}, delay+getGlobalConfig().itemActionDelayExtraTimeout);
|
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerDropItem(client, itemSlot);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -576,12 +567,9 @@ function showPlayerItemPickupDelay(client, itemId) {
|
|||||||
if(delay > 0) {
|
if(delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
||||||
setTimeout(function() {
|
|
||||||
playerItemActionDelayComplete(client);
|
|
||||||
}, delay+getGlobalConfig().itemActionDelayExtraTimeout);
|
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerPickupItem(client, itemId);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -594,12 +582,9 @@ function showPlayerItemPutDelay(client, itemSlot) {
|
|||||||
if(delay > 0) {
|
if(delay > 0) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
||||||
setTimeout(function() {
|
|
||||||
playerItemActionDelayComplete(client);
|
|
||||||
}, delay+getGlobalConfig().itemActionDelayExtraTimeout);
|
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerPutItem(client, itemSlot);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -610,14 +595,16 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
|
|||||||
if(itemSlot != -1) {
|
if(itemSlot != -1) {
|
||||||
if(getPlayerData(client).hotBarItems[itemSlot] != -1) {
|
if(getPlayerData(client).hotBarItems[itemSlot] != -1) {
|
||||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
|
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
if(delay > 0) {
|
||||||
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||||
setTimeout(function() {
|
triggerNetworkEvent("vrr.showItemActionDelay", client, delay);
|
||||||
|
} else{
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerItemActionDelayComplete(client);
|
playerItemActionDelayComplete(client);
|
||||||
}, delay+getGlobalConfig().itemActionDelayExtraTimeout);
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
playerSwitchItem(client, itemSlot);
|
playerItemActionDelayComplete(client);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||||
|
|||||||
@@ -196,11 +196,12 @@ function loadCommands() {
|
|||||||
commandData("housereloadall", reloadAllHousesCommand, "", getStaffFlagValue("manageHouses"), true, false),
|
commandData("housereloadall", reloadAllHousesCommand, "", getStaffFlagValue("manageHouses"), true, false),
|
||||||
|
|
||||||
commandData("houseinfo", getHouseInfoCommand, "", getStaffFlagValue("none"), true, false),
|
commandData("houseinfo", getHouseInfoCommand, "", getStaffFlagValue("none"), true, false),
|
||||||
commandData("housedesc", setHouseDescriptionCommand, "", getStaffFlagValue("none"), true, false),
|
commandData("housebuy", buyHouseCommand, "", getStaffFlagValue("none"), true, false),
|
||||||
|
commandData("housedesc", setHouseDescriptionCommand, "", getStaffFlagValue("manageHouses"), true, false),
|
||||||
commandData("houselock", lockUnlockHouseCommand, "", getStaffFlagValue("none"), true, false),
|
commandData("houselock", lockUnlockHouseCommand, "", getStaffFlagValue("none"), true, false),
|
||||||
commandData("houseowner", setHouseOwnerCommand, "", getStaffFlagValue("none"), true, false),
|
commandData("houseowner", setHouseOwnerCommand, "", getStaffFlagValue("manageHouses"), true, false),
|
||||||
//commandData("housebuyprice", setHouseBuyPriceCommand, "", getStaffFlagValue("none"), true, false),
|
commandData("housebuyprice", setHouseBuyPriceCommand, "", getStaffFlagValue("none"), true, false),
|
||||||
//commandData("houserentprice", setHouseRentPriceCommand, "", getStaffFlagValue("none"), true, false),
|
commandData("houserentprice", setHouseRentPriceCommand, "", getStaffFlagValue("none"), true, false),
|
||||||
commandData("houseblip", setHouseBlipCommand, "<type name/model id>", getStaffFlagValue("manageHouses"), true, true),
|
commandData("houseblip", setHouseBlipCommand, "<type name/model id>", getStaffFlagValue("manageHouses"), true, true),
|
||||||
commandData("housepickup", setHousePickupCommand, "<type name/model id>", getStaffFlagValue("manageHouses"), true, true),
|
commandData("housepickup", setHousePickupCommand, "<type name/model id>", getStaffFlagValue("manageHouses"), true, true),
|
||||||
commandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("manageHouses"), true, true),
|
commandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("manageHouses"), true, true),
|
||||||
|
|||||||
@@ -62,868 +62,7 @@ function loadGlobalConfig() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadGameConfig() {
|
function loadGameConfig() {
|
||||||
return {
|
return gameData;
|
||||||
blipSprites: [
|
|
||||||
false,
|
|
||||||
{ // GTA III
|
|
||||||
policeStation: 8,
|
|
||||||
fireStation: 9,
|
|
||||||
hospital: 12,
|
|
||||||
ammunation: 20,
|
|
||||||
payAndSpray: 18,
|
|
||||||
vehicleDealership: 6,
|
|
||||||
restaurant: -1,
|
|
||||||
fastFood: -1,
|
|
||||||
bank: 0,
|
|
||||||
fuelStation: -1,
|
|
||||||
business: -1,
|
|
||||||
house: -1,
|
|
||||||
},
|
|
||||||
{ // GTA VC
|
|
||||||
policeStation: 0,
|
|
||||||
fireStation: 0,
|
|
||||||
hospital: 0,
|
|
||||||
ammunation: 16,
|
|
||||||
payAndSpray: 27,
|
|
||||||
vehicleDealership: 7,
|
|
||||||
restaurant: -1,
|
|
||||||
fastFood: -1,
|
|
||||||
bank: 0,
|
|
||||||
fuelStation: -1,
|
|
||||||
business: -1,
|
|
||||||
house: -1,
|
|
||||||
},
|
|
||||||
{ // GTA SA
|
|
||||||
policeStation: 30,
|
|
||||||
fireStation: 20,
|
|
||||||
hospital: 22,
|
|
||||||
ammunation: 6,
|
|
||||||
payAndSpray: 63,
|
|
||||||
vehicleDealership: 55,
|
|
||||||
airplaneDealership: 5,
|
|
||||||
boatDealership: 9,
|
|
||||||
restaurant: 50,
|
|
||||||
fastFood: -1,
|
|
||||||
clothes: 45,
|
|
||||||
pizza: 29,
|
|
||||||
chicken: 14,
|
|
||||||
burger: 10,
|
|
||||||
bank: 52,
|
|
||||||
gasStation: 17,
|
|
||||||
business: -1,
|
|
||||||
house: 31,
|
|
||||||
bar: 49,
|
|
||||||
club: 48,
|
|
||||||
gym: 54,
|
|
||||||
repairGarage: 27,
|
|
||||||
trophy: 33,
|
|
||||||
race2: 53,
|
|
||||||
job: 56,
|
|
||||||
},
|
|
||||||
{ // GTA UG
|
|
||||||
policeStation: 8,
|
|
||||||
fireStation: 9,
|
|
||||||
hospital: 12,
|
|
||||||
ammunation: 20,
|
|
||||||
payAndSpray: 18,
|
|
||||||
vehicleDealership: 6,
|
|
||||||
restaurant: -1,
|
|
||||||
fastFood: -1,
|
|
||||||
bank: 52,
|
|
||||||
fuelStation: 0,
|
|
||||||
business: -1,
|
|
||||||
house: -1,
|
|
||||||
},
|
|
||||||
{ // GTA IV
|
|
||||||
policeStation: 8,
|
|
||||||
fireStation: 9,
|
|
||||||
hospital: 12,
|
|
||||||
ammunation: 20,
|
|
||||||
payAndSpray: 18,
|
|
||||||
vehicleDealership: 6,
|
|
||||||
restaurant: -1,
|
|
||||||
fastFood: -1,
|
|
||||||
bank: 52,
|
|
||||||
fuelStation: 0,
|
|
||||||
business: -1,
|
|
||||||
house: -1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
pickupModels: [
|
|
||||||
{},
|
|
||||||
|
|
||||||
{ // GTA 3
|
|
||||||
policeStation: 1361,
|
|
||||||
fireStation: 1361,
|
|
||||||
hospital: 1361,
|
|
||||||
ammunation: 1361,
|
|
||||||
payAndSpray: 1361,
|
|
||||||
vehicleDealership: 1361,
|
|
||||||
restaurant: 1361,
|
|
||||||
fastFood: 1361,
|
|
||||||
bank: 1323,
|
|
||||||
fuelStation: 1361,
|
|
||||||
business: 1361,
|
|
||||||
house: 1361,
|
|
||||||
clothes: 1361,
|
|
||||||
misc: 1361,
|
|
||||||
exit: 1361
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA Vice City
|
|
||||||
policeStation: 375,
|
|
||||||
fireStation: 406,
|
|
||||||
hospital: 366,
|
|
||||||
ammunation: 406,
|
|
||||||
payAndSpray: 406,
|
|
||||||
vehicleDealership: 406,
|
|
||||||
restaurant: 406,
|
|
||||||
fastFood: 406,
|
|
||||||
bank: 408,
|
|
||||||
fuelStation: 406,
|
|
||||||
business: 406,
|
|
||||||
house: 407,
|
|
||||||
clothes: 409,
|
|
||||||
misc: 406,
|
|
||||||
exit: 406,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA San Andreas
|
|
||||||
policeStation: 1247,
|
|
||||||
fireStation: 1318,
|
|
||||||
hospital: 1240,
|
|
||||||
ammunation: 1239,
|
|
||||||
payAndSpray: 1239,
|
|
||||||
vehicleDealership: 1239,
|
|
||||||
restaurant: 1239,
|
|
||||||
fastFood: 1239,
|
|
||||||
bank: 1274,
|
|
||||||
fuelStation: 1239,
|
|
||||||
business: 1272,
|
|
||||||
house: 1273,
|
|
||||||
clothes: 1275,
|
|
||||||
misc: 1239,
|
|
||||||
exit: 1318,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
pickupTypes: [
|
|
||||||
{},
|
|
||||||
|
|
||||||
{ // GTA 3
|
|
||||||
business: 0,
|
|
||||||
house: 0,
|
|
||||||
bank: 0,
|
|
||||||
clothes: 0,
|
|
||||||
info: 0,
|
|
||||||
job: 0,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA Vice City
|
|
||||||
business: 2,
|
|
||||||
house: 2,
|
|
||||||
bank: 2,
|
|
||||||
clothes: 2,
|
|
||||||
info: 2,
|
|
||||||
job: 2,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA San Andreas
|
|
||||||
business: 1,
|
|
||||||
house: 1,
|
|
||||||
bank: 1,
|
|
||||||
clothes: 1,
|
|
||||||
info: 1,
|
|
||||||
job: 1,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
// THIS IS SCREEN HEIGHT, NOT ACTUAL DOOR POSITION IN THE WORLD
|
|
||||||
propertyLabelHeight: [
|
|
||||||
false,
|
|
||||||
85,
|
|
||||||
85,
|
|
||||||
85,
|
|
||||||
85,
|
|
||||||
85,
|
|
||||||
85,
|
|
||||||
],
|
|
||||||
|
|
||||||
removedWorldObjects: [
|
|
||||||
false,
|
|
||||||
|
|
||||||
[ // GTA III
|
|
||||||
new serverClasses.removedWorldObjectData("fraightback04", toVector3(1229.88, -84.8012, 13.4004), 50.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
|
||||||
new serverClasses.removedWorldObjectData("fraightback03", toVector3(1239.49, -68.0529, 11.6914), 50.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA VC
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA SA
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA IV
|
|
||||||
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
excludedGroundSnowModels: [
|
|
||||||
false,
|
|
||||||
|
|
||||||
[ // GTA III
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA VC
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA SA
|
|
||||||
// Twin tunnels from Rodeo, Los Santos to/from Flint County
|
|
||||||
13682, // TCElawcuntunb
|
|
||||||
13680, // TCElawcuntunb
|
|
||||||
13676, // TCElawcuntun1a_law2
|
|
||||||
13677, // TCElawcuntun1a_law2
|
|
||||||
|
|
||||||
// Los Santos
|
|
||||||
6387, // century03_LAw2 (L.A. Century Plaza underground parking)
|
|
||||||
17633, // lae2_ground08
|
|
||||||
4818, // TRNTRK8_LAS
|
|
||||||
4884, // lastranentun1_LAS
|
|
||||||
4885, // lastranentun4_LAS
|
|
||||||
|
|
||||||
// Train Tunnel under Los Santos
|
|
||||||
6248, // RailTunn01_LAw
|
|
||||||
6249, // RailTunn02_LAw
|
|
||||||
6250, // RailTunn03_LAw
|
|
||||||
6251, // RailTunn04_LAw
|
|
||||||
6252, // RailTunn05_LAw
|
|
||||||
5772, // RailTunn01_LAwN (Market Station lower level)
|
|
||||||
5773, // TrainStat01_LAwN (Market Station upper/ground level)
|
|
||||||
6502, // RailTunn04_LAw2
|
|
||||||
6290, // RailTunn02_LAw2
|
|
||||||
6501, // RailTunn03_LAw2
|
|
||||||
6292, // RailTunn01_LAw2N
|
|
||||||
|
|
||||||
6966, // vegasNbank1 (L.V. north building underground parking, upper level)
|
|
||||||
7245, // vegasNbank1ug (L.V. north building underground parking, lower level)
|
|
||||||
7011, // courthse_vgn01 (L.V. courthouse parking structure)
|
|
||||||
8390, // multicarpark01_lvS (Large parking structure next to pyramid)
|
|
||||||
|
|
||||||
// Train tunnel next to Las Venturas
|
|
||||||
6982, // vgsNtraintunnel01
|
|
||||||
6983, // vgsNtraintunnel02
|
|
||||||
6984, // vgsNtraintunnel03
|
|
||||||
6981, // vgsNtraintunnel04
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
[ // GTA IV
|
|
||||||
|
|
||||||
],
|
|
||||||
],
|
|
||||||
defaultBusinessItems:
|
|
||||||
[
|
|
||||||
{
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
clothingStore: [
|
|
||||||
["Outfit", 500, 2]
|
|
||||||
],
|
|
||||||
legalGunStore: [
|
|
||||||
["Colt 45", 500, 2],
|
|
||||||
["Shotgun", 500, 2],
|
|
||||||
["Baseball Bat", 500, 2]
|
|
||||||
],
|
|
||||||
illegalGunStore: [
|
|
||||||
["Uzi", 500, 2],
|
|
||||||
["AK-47", 500, 2],
|
|
||||||
["M16", 500, 2],
|
|
||||||
["Sniper Rifle", 500, 2]
|
|
||||||
],
|
|
||||||
gasStation: [
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Can of Soda", 500, 2],
|
|
||||||
["Slice of Pizza", 500, 2],
|
|
||||||
["Bottle of Water", 500, 2],
|
|
||||||
["Can of Beer", 500, 2],
|
|
||||||
],
|
|
||||||
electronicsStore: [
|
|
||||||
["Phone", 500, 2],
|
|
||||||
["Walkie Talkie", 500, 2],
|
|
||||||
["Megaphone", 500, 2],
|
|
||||||
["Tazer", 500, 2],
|
|
||||||
["Camera", 500, 2],
|
|
||||||
],
|
|
||||||
bar: [
|
|
||||||
["Bottle of Vodka", 500, 2],
|
|
||||||
["Bottle of Whiskey", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Bottle of Bourbon", 500, 2],
|
|
||||||
["Shot of Bourbon", 500, 2],
|
|
||||||
["Shot of Vodka", 500, 2],
|
|
||||||
["Shot of Whiskey", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
],
|
|
||||||
club: [
|
|
||||||
["Bottle of Vodka", 500, 2],
|
|
||||||
["Bottle of Whiskey", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Bottle of Bourbon", 500, 2],
|
|
||||||
["Shot of Bourbon", 500, 2],
|
|
||||||
["Shot of Vodka", 500, 2],
|
|
||||||
["Shot of Whiskey", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
],
|
|
||||||
chicken: [
|
|
||||||
["Bucket of Chicken", 500, 2],
|
|
||||||
["Chicken Tenders Meal", 500, 2],
|
|
||||||
["Large Fries", 500, 2],
|
|
||||||
["Small Fries", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
burger: [
|
|
||||||
["Bacon Cheeseburger", 500, 2],
|
|
||||||
["Double Cheeseburger", 500, 2],
|
|
||||||
["Big Boy Burger", 500, 2],
|
|
||||||
["Large Fries", 500, 2],
|
|
||||||
["Small Fries", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
chinese: [
|
|
||||||
["Egg Roll", 500, 2],
|
|
||||||
["Lo Mein", 500, 2],
|
|
||||||
["Fried Rice", 500, 2],
|
|
||||||
["Crab Rangoon", 500, 2],
|
|
||||||
["Egg Drop Soup", 500, 2],
|
|
||||||
["Moo Shu Pork", 500, 2],
|
|
||||||
["Egg Foo Young", 500, 2],
|
|
||||||
["Sesame Chicken", 500, 2],
|
|
||||||
],
|
|
||||||
italian: [
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
["Arancini", 500, 2],
|
|
||||||
["Lasagne", 500, 2],
|
|
||||||
["Chicken Alfredo", 500, 2],
|
|
||||||
["Fettucine Alfredo", 500, 2],
|
|
||||||
["Chicken Parmigiana", 500, 2],
|
|
||||||
["Chicken Carbonara", 500, 2],
|
|
||||||
["Sausage Rigatoni", 500, 2],
|
|
||||||
["Chicken Salad", 500, 2],
|
|
||||||
["Caesar Salad", 500, 2],
|
|
||||||
],
|
|
||||||
mexican: [
|
|
||||||
["Crunchy Taco", 500, 2],
|
|
||||||
["Beaf and Bean Burrito", 500, 2],
|
|
||||||
["Burrito Supreme", 500, 2],
|
|
||||||
["Cheesy Nachos", 500, 2],
|
|
||||||
["Nacho Supreme", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
pizza: [
|
|
||||||
["Large Pizza", 500, 2],
|
|
||||||
["Medium Pizza", 500, 2],
|
|
||||||
["Small Pizza", 500, 2],
|
|
||||||
["Buffalo Wings", 500, 2],
|
|
||||||
["Hot Wings", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
clothingStore: [
|
|
||||||
["Outfit", 500, 2]
|
|
||||||
],
|
|
||||||
legalGunStore: [
|
|
||||||
["Colt .45", 500, 2],
|
|
||||||
["Python", 500, 2],
|
|
||||||
["Shotgun", 500, 2],
|
|
||||||
["Stubby Shotgun", 500, 2],
|
|
||||||
["Baseball Bat", 500, 2],
|
|
||||||
["Brass Knuckles", 500, 2],
|
|
||||||
],
|
|
||||||
illegalGunStore: [
|
|
||||||
["Uzi", 500, 2],
|
|
||||||
["MP5", 500, 2],
|
|
||||||
["Tec-9", 500, 2],
|
|
||||||
["Ingram", 500, 2],
|
|
||||||
["Ruger", 500, 2],
|
|
||||||
["M4", 500, 2],
|
|
||||||
["Sniper Rifle", 500, 2],
|
|
||||||
["Laser Sniper", 500, 2],
|
|
||||||
],
|
|
||||||
gasStation: [
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Can of Soda", 500, 2],
|
|
||||||
["Slice of Pizza", 500, 2],
|
|
||||||
["Bottle of Water", 500, 2],
|
|
||||||
["Can of Beer", 500, 2]
|
|
||||||
],
|
|
||||||
electronicsStore: [
|
|
||||||
["Phone", 500, 2],
|
|
||||||
["Walkie Talkie", 500, 2],
|
|
||||||
["Megaphone", 500, 2],
|
|
||||||
["Tazer", 500, 2],
|
|
||||||
["Camera", 500, 2]
|
|
||||||
],
|
|
||||||
bar: [
|
|
||||||
["Bottle of Vodka", 500, 2],
|
|
||||||
["Bottle of Whiskey", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Bottle of Bourbon", 500, 2],
|
|
||||||
["Shot of Bourbon", 500, 2],
|
|
||||||
["Shot of Vodka", 500, 2],
|
|
||||||
["Shot of Whiskey", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
],
|
|
||||||
club: [
|
|
||||||
["Bottle of Vodka", 500, 2],
|
|
||||||
["Bottle of Whiskey", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Bottle of Bourbon", 500, 2],
|
|
||||||
["Shot of Bourbon", 500, 2],
|
|
||||||
["Shot of Vodka", 500, 2],
|
|
||||||
["Shot of Whiskey", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
],
|
|
||||||
chicken: [
|
|
||||||
["Bucket of Chicken", 500, 2],
|
|
||||||
["Chicken Tenders Meal", 500, 2],
|
|
||||||
["Large Fries", 500, 2],
|
|
||||||
["Small Fries", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
burger: [
|
|
||||||
["Bacon Cheeseburger", 500, 2],
|
|
||||||
["Double Cheeseburger", 500, 2],
|
|
||||||
["Big Boy Burger", 500, 2],
|
|
||||||
["Large Fries", 500, 2],
|
|
||||||
["Small Fries", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
chinese: [
|
|
||||||
["Egg Roll", 500, 2],
|
|
||||||
["Lo Mein", 500, 2],
|
|
||||||
["Fried Rice", 500, 2],
|
|
||||||
["Crab Rangoon", 500, 2],
|
|
||||||
["Egg Drop Soup", 500, 2],
|
|
||||||
["Moo Shu Pork", 500, 2],
|
|
||||||
["Egg Foo Young", 500, 2],
|
|
||||||
["Sesame Chicken", 500, 2],
|
|
||||||
],
|
|
||||||
italian: [
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
["Arancini", 500, 2],
|
|
||||||
["Lasagne", 500, 2],
|
|
||||||
["Chicken Alfredo", 500, 2],
|
|
||||||
["Fettucine Alfredo", 500, 2],
|
|
||||||
["Chicken Parmigiana", 500, 2],
|
|
||||||
["Chicken Carbonara", 500, 2],
|
|
||||||
["Sausage Rigatoni", 500, 2],
|
|
||||||
["Chicken Salad", 500, 2],
|
|
||||||
["Caesar Salad", 500, 2],
|
|
||||||
],
|
|
||||||
mexican: [
|
|
||||||
["Crunchy Taco", 500, 2],
|
|
||||||
["Beaf and Bean Burrito", 500, 2],
|
|
||||||
["Burrito Supreme", 500, 2],
|
|
||||||
["Cheesy Nachos", 500, 2],
|
|
||||||
["Nacho Supreme", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
pizza: [
|
|
||||||
["Large Pizza", 500, 2],
|
|
||||||
["Medium Pizza", 500, 2],
|
|
||||||
["Small Pizza", 500, 2],
|
|
||||||
["Buffalo Wings", 500, 2],
|
|
||||||
["Hot Wings", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
clothingStore: [
|
|
||||||
["Outfit", 500, 2]
|
|
||||||
],
|
|
||||||
legalGunStore: [
|
|
||||||
["Baseball Bat", 500, 2],
|
|
||||||
["Pepper Spray", 500, 2],
|
|
||||||
["Brass Knuckles", 500, 2],
|
|
||||||
["9mm", 500, 2],
|
|
||||||
["Desert Eagle", 500, 2],
|
|
||||||
["Shotgun", 500, 2],
|
|
||||||
["Country Rifle", 500, 2]
|
|
||||||
],
|
|
||||||
illegalGunStore: [
|
|
||||||
["Micro SMG/Uzi", 500, 2],
|
|
||||||
["MP5", 500, 2],
|
|
||||||
["Tec-9", 500, 2],
|
|
||||||
["AK-47", 500, 2],
|
|
||||||
["M4", 500, 2],
|
|
||||||
["Combat Shotgun", 500, 2],
|
|
||||||
["Sniper Rifle", 500, 2]
|
|
||||||
],
|
|
||||||
sexShop: [
|
|
||||||
["Purple Dildo", 500, 2],
|
|
||||||
["Dildo", 500, 2],
|
|
||||||
["Vibrator", 500, 2],
|
|
||||||
["Silver Vibrator", 500, 2],
|
|
||||||
["Flowers", 500, 2]
|
|
||||||
],
|
|
||||||
gasStation: [
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Can of Soda", 500, 2],
|
|
||||||
["Slice of Pizza", 500, 2],
|
|
||||||
["Bottle of Water", 500, 2],
|
|
||||||
["Can of Beer", 500, 2]
|
|
||||||
],
|
|
||||||
electronicsStore: [
|
|
||||||
["Phone", 500, 2],
|
|
||||||
["Walkie Talkie", 500, 2],
|
|
||||||
["Megaphone", 500, 2],
|
|
||||||
["Tazer", 500, 2],
|
|
||||||
["Camera", 500, 2]
|
|
||||||
],
|
|
||||||
bar: [
|
|
||||||
["Bottle of Vodka", 500, 2],
|
|
||||||
["Bottle of Whiskey", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Bottle of Bourbon", 500, 2],
|
|
||||||
["Shot of Bourbon", 500, 2],
|
|
||||||
["Shot of Vodka", 500, 2],
|
|
||||||
["Shot of Whiskey", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
],
|
|
||||||
club: [
|
|
||||||
["Bottle of Vodka", 500, 2],
|
|
||||||
["Bottle of Whiskey", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Bottle of Bourbon", 500, 2],
|
|
||||||
["Shot of Bourbon", 500, 2],
|
|
||||||
["Shot of Vodka", 500, 2],
|
|
||||||
["Shot of Whiskey", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
],
|
|
||||||
chicken: [
|
|
||||||
["Bucket of Chicken", 500, 2],
|
|
||||||
["Chicken Tenders Meal", 500, 2],
|
|
||||||
["Large Fries", 500, 2],
|
|
||||||
["Small Fries", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
burger: [
|
|
||||||
["Bacon Cheeseburger", 500, 2],
|
|
||||||
["Double Cheeseburger", 500, 2],
|
|
||||||
["Big Boy Burger", 500, 2],
|
|
||||||
["Large Fries", 500, 2],
|
|
||||||
["Small Fries", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
chinese: [
|
|
||||||
["Egg Roll", 500, 2],
|
|
||||||
["Lo Mein", 500, 2],
|
|
||||||
["Fried Rice", 500, 2],
|
|
||||||
["Crab Rangoon", 500, 2],
|
|
||||||
["Egg Drop Soup", 500, 2],
|
|
||||||
["Moo Shu Pork", 500, 2],
|
|
||||||
["Egg Foo Young", 500, 2],
|
|
||||||
["Sesame Chicken", 500, 2],
|
|
||||||
],
|
|
||||||
italian: [
|
|
||||||
["Bottle of Wine", 500, 2],
|
|
||||||
["Glass of Wine", 500, 2],
|
|
||||||
["Arancini", 500, 2],
|
|
||||||
["Lasagne", 500, 2],
|
|
||||||
["Chicken Alfredo", 500, 2],
|
|
||||||
["Fettucine Alfredo", 500, 2],
|
|
||||||
["Chicken Parmigiana", 500, 2],
|
|
||||||
["Chicken Carbonara", 500, 2],
|
|
||||||
["Sausage Rigatoni", 500, 2],
|
|
||||||
["Chicken Salad", 500, 2],
|
|
||||||
["Caesar Salad", 500, 2],
|
|
||||||
],
|
|
||||||
mexican: [
|
|
||||||
["Crunchy Taco", 500, 2],
|
|
||||||
["Beaf and Bean Burrito", 500, 2],
|
|
||||||
["Burrito Supreme", 500, 2],
|
|
||||||
["Cheesy Nachos", 500, 2],
|
|
||||||
["Nacho Supreme", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
pizza: [
|
|
||||||
["Large Pizza", 500, 2],
|
|
||||||
["Medium Pizza", 500, 2],
|
|
||||||
["Small Pizza", 500, 2],
|
|
||||||
["Buffalo Wings", 500, 2],
|
|
||||||
["Hot Wings", 500, 2],
|
|
||||||
["Bottle of Soda", 500, 2],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
interiorTemplates: [
|
|
||||||
false,
|
|
||||||
|
|
||||||
{ // GTA 3
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA VC
|
|
||||||
mall: new serverClasses.interiorTemplateData(toVector3(379.62, 1007.00, 19.22), 4),
|
|
||||||
malibu: new serverClasses.interiorTemplateData(toVector3(489.83, -76.49, 11.48), 17),
|
|
||||||
vcpd: new serverClasses.interiorTemplateData(toVector3(396.38, -472.96, 12.34), 12),
|
|
||||||
apartment: new serverClasses.interiorTemplateData(toVector3(26.67, -1328.89, 13.00), 11),
|
|
||||||
hotelLobby: new serverClasses.interiorTemplateData(toVector3(228.53, -1277.12, 12.07), 1),
|
|
||||||
bikerBar: new serverClasses.interiorTemplateData(toVector3(-597.41, 651.84, 11.30), 11),
|
|
||||||
mansion: new serverClasses.interiorTemplateData(toVector3(-379.14, -551.65, 19.32), 2),
|
|
||||||
gunRange: new serverClasses.interiorTemplateData(toVector3(-667.79, 1217.51, 11.10), 10),
|
|
||||||
bank: new serverClasses.interiorTemplateData(toVector3(-894.52, -341.16, 13.45), 3),
|
|
||||||
stripClub: new serverClasses.interiorTemplateData(toVector3(97.53, -1472.06, 10.43), 5),
|
|
||||||
rosenberg: new serverClasses.interiorTemplateData(toVector3(120.82, -827.98, 10.62), 6),
|
|
||||||
arena: new serverClasses.interiorTemplateData(toVector3(-1080.49, 1331.16, 13.91), 15),
|
|
||||||
ghettoShack: new serverClasses.interiorTemplateData(toVector3(-962.74, 146.96, 9.40), 12),
|
|
||||||
hotelRoom: new serverClasses.interiorTemplateData(toVector3(226.47, -1274.98, 19.271), 2.933),
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA SA
|
|
||||||
lspd: new serverClasses.interiorTemplateData(toVector3(247.113, 62.929, 1003.64), 2),
|
|
||||||
lvpd: new serverClasses.interiorTemplateData(toVector3(288.82, 167.39, 1007.17), 3),
|
|
||||||
sfpd: new serverClasses.interiorTemplateData(toVector3(246.40, 110.84, 1003.22), 10),
|
|
||||||
reeceBarberShop: new serverClasses.interiorTemplateData(toVector3(411.62, -21.43, 1001.80), 2),
|
|
||||||
fourDragons: new serverClasses.interiorTemplateData(toVector3(2016.26, 1017.77, 996.87), 10),
|
|
||||||
caligula: new serverClasses.interiorTemplateData(toVector3(2233.8, 1712.23, 1011.76), 1),
|
|
||||||
genericCasino: new serverClasses.interiorTemplateData(toVector3(1118.88, -10.27, 1002.08), 12),
|
|
||||||
cluckinBell: new serverClasses.interiorTemplateData(toVector3(365.71, -9.88, 1001.85), 9),
|
|
||||||
pizzaStack: new serverClasses.interiorTemplateData(toVector3(372.35, -131.65, 1001.49), 5),
|
|
||||||
burgerShot: new serverClasses.interiorTemplateData(toVector3(375.96, -65.81, 1001.50), 10),
|
|
||||||
tattooParlor: new serverClasses.interiorTemplateData(toVector3(-203.07, -24.16, 1002.27), 16),
|
|
||||||
bank: new serverClasses.interiorTemplateData(toVector3(2305.14, -16.274, 26.74), 1),
|
|
||||||
gas1: new serverClasses.interiorTemplateData(toVector3(-25.88, -185.86, 1003.54), 17),
|
|
||||||
gas2: new serverClasses.interiorTemplateData(toVector3(6.09, -29.27, 1003.54), 10),
|
|
||||||
gas3: new serverClasses.interiorTemplateData(toVector3(-30.94, -89.60, 1003.54), 18),
|
|
||||||
gas4: new serverClasses.interiorTemplateData(toVector3(-25.13, -139.06, 1003.54), 16),
|
|
||||||
gas5: new serverClasses.interiorTemplateData(toVector3( -27.31, -29.27, 1003.54), 4),
|
|
||||||
gas6: new serverClasses.interiorTemplateData(toVector3(-26.69, -55.71, 1003.54), 6),
|
|
||||||
shamal: new serverClasses.interiorTemplateData(toVector3(2.38, 33.10, 1199.84), 1),
|
|
||||||
andromeda: new serverClasses.interiorTemplateData(toVector3(315.85, 1024.49, 1949.79), 9),
|
|
||||||
airportTickets: new serverClasses.interiorTemplateData(toVector3(-1827.14, 7.20, 1061.14), 14),
|
|
||||||
airportBaggage: new serverClasses.interiorTemplateData(toVector3(-1855.56, 41.26, 1061.14), 14),
|
|
||||||
ammu1: new serverClasses.interiorTemplateData(toVector3(286.14, -40.64, 1001.56), 1),
|
|
||||||
ammu2: new serverClasses.interiorTemplateData(toVector3(286.80, -82.54, 1001.53), 4),
|
|
||||||
ammu3: new serverClasses.interiorTemplateData(toVector3(296.91, -108.07, 1001.56), 6),
|
|
||||||
ammu4: new serverClasses.interiorTemplateData(toVector3(314.82, -141.43, 999.66), 7),
|
|
||||||
ammu5: new serverClasses.interiorTemplateData(toVector3(316.52, -167.70, 999.66), 6),
|
|
||||||
ammuBooth: new serverClasses.interiorTemplateData(toVector3(302.29, -143.13, 1004.06), 7),
|
|
||||||
ammuRange: new serverClasses.interiorTemplateData(toVector3(280.79, -135.20, 1004.06), 7),
|
|
||||||
house1: new serverClasses.interiorTemplateData(toVector3(235.51, 1189.17, 1080.34), 3),
|
|
||||||
house2: new serverClasses.interiorTemplateData(toVector3(225.76, 1240.00, 1082.15), 2),
|
|
||||||
house3: new serverClasses.interiorTemplateData(toVector3(223.04, 1289.26, 1082.20), 1),
|
|
||||||
house4: new serverClasses.interiorTemplateData(toVector3(225.63, 1022.48, 1084.07), 7),
|
|
||||||
house5: new serverClasses.interiorTemplateData(toVector3(295.14, 1474.47, 1080.52), 15),
|
|
||||||
house6: new serverClasses.interiorTemplateData(toVector3(328.49, 1480.59, 1084.45), 15),
|
|
||||||
house7: new serverClasses.interiorTemplateData(toVector3(385.80, 1471.77, 1080.21), 15),
|
|
||||||
atrium: new serverClasses.interiorTemplateData(toVector3(1726.18, -1641.00, 20.23), 18),
|
|
||||||
crackPalace: new serverClasses.interiorTemplateData(toVector3(2,567.52, -1294.59, 1063.25), 2),
|
|
||||||
bloodbowlStadium: new serverClasses.interiorTemplateData(toVector3(-1394.20, 987.62, 1023.96), 15),
|
|
||||||
burningDesireHouse: new serverClasses.interiorTemplateData(toVector3(2338.32, -1180.61, 1027.98), 5),
|
|
||||||
furhbergerHouse: new serverClasses.interiorTemplateData(toVector3(2807.63, -1170.15, 1025.57), 8),
|
|
||||||
dillimoreGas: new serverClasses.interiorTemplateData(toVector3(664.19, -570.73, 16.34), 0),
|
|
||||||
donutShop: new serverClasses.interiorTemplateData(toVector3(376.99, -191.21, 1000.63), 17),
|
|
||||||
airport: new serverClasses.interiorTemplateData(toVector3(-1830.81, 16.83, 1061.14), 14),
|
|
||||||
jeffersonMotel: new serverClasses.interiorTemplateData(toVector3(2220.26, -1,148.01, 1025.80), 15),
|
|
||||||
kickstartStadium: new serverClasses.interiorTemplateData(toVector3(-1410.72, 1,591.16, 1052.53), 14),
|
|
||||||
libertyCity: new serverClasses.interiorTemplateData(toVector3(-750.80, 491.00, 1371.70), 1),
|
|
||||||
lsxBaggageReclaim: new serverClasses.interiorTemplateData(toVector3(-1870.80, 59.81, 1056.25), 14),
|
|
||||||
jizzy: new serverClasses.interiorTemplateData(toVector3(-2637.69, 1404.24, 906.46), 3),
|
|
||||||
rcBattlefield: new serverClasses.interiorTemplateData(toVector3(-1079.99, 1061.58, 1343.04), 10),
|
|
||||||
ryderHouse: new serverClasses.interiorTemplateData(toVector3(2451.77, -1699.80, 1013.51), 2),
|
|
||||||
sfGarage: new serverClasses.interiorTemplateData(toVector3(-2042.42, 178.59, 28.84), 1),
|
|
||||||
sweetHouse: new serverClasses.interiorTemplateData(toVector3(2535.83, -1,674.32, 1015.50), 1),
|
|
||||||
katieHouse: new serverClasses.interiorTemplateData(toVector3(267.22, 304.71, 999.14), 2),
|
|
||||||
helenaHouse: new serverClasses.interiorTemplateData(toVector3(292.44, 308.77, 999.14), 3),
|
|
||||||
welcomePump: new serverClasses.interiorTemplateData(toVector3(681.66, -453.32, -25.61), 1),
|
|
||||||
woozieApartment: new serverClasses.interiorTemplateData(toVector3(-2158.72, 641.29, 1052.38), 1),
|
|
||||||
eightTrackStadium: new serverClasses.interiorTemplateData(toVector3(-1395.96, -208.20, 1051.17), 7),
|
|
||||||
dirtBikeStadium: new serverClasses.interiorTemplateData(toVector3(-1424.93, -664.59, 1059.86), 4),
|
|
||||||
crackDen: new serverClasses.interiorTemplateData(toVector3(318.57, 1115.21, 1082.98), 5),
|
|
||||||
motelRoom: new serverClasses.interiorTemplateData(toVector3(2251.85, -1138.16, 1050.63), 9),
|
|
||||||
hashburyHouse: new serverClasses.interiorTemplateData(toVector3(2260.76, -1210.45, 1049.02), 10),
|
|
||||||
cjHouse: new serverClasses.interiorTemplateData(toVector3(2496.65, -1696.55, 1014.74), 3),
|
|
||||||
maddDoggMansion: new serverClasses.interiorTemplateData(toVector3(1299.14, -794.77, 1084.00), 5),
|
|
||||||
motelRoom2: new serverClasses.interiorTemplateData(toVector3(2262.83, -1137.71, 1050.63), 10),
|
|
||||||
safeHouse1: new serverClasses.interiorTemplateData(toVector3(2365.42, -1131.85, 1050.88), 8),
|
|
||||||
safeHouse2: new serverClasses.interiorTemplateData(toVector3(2324.33, -1144.79, 1050.71), 12),
|
|
||||||
zeroStore: new serverClasses.interiorTemplateData(toVector3(-2240.00, 131.00, 1035.40), 6),
|
|
||||||
brothel1: new serverClasses.interiorTemplateData(toVector3(940.65, -18.48, 1000.93), 3),
|
|
||||||
brothel2: new serverClasses.interiorTemplateData(toVector3(967.53, -53.02, 1001.12), 3),
|
|
||||||
brothel3: new serverClasses.interiorTemplateData(toVector3(744.27, 1437.25, 1102.70), 6),
|
|
||||||
prolapsStore: new serverClasses.interiorTemplateData(toVector3(207.35, -138.00, 1003.31), 3),
|
|
||||||
victimStore: new serverClasses.interiorTemplateData(toVector3(221.33, -6.61, 1005.19), 5),
|
|
||||||
suburbanStore: new serverClasses.interiorTemplateData(toVector3(203.81, -46.53, 1001.80), 1),
|
|
||||||
sexShop: new serverClasses.interiorTemplateData(toVector3(-106.72, -19.64, 1000.71), 3),
|
|
||||||
bincoStore: new serverClasses.interiorTemplateData(toVector3(207.54, -109.00, 1005.13), 15),
|
|
||||||
wardrobe: new serverClasses.interiorTemplateData(toVector3(255.71, -41.13, 1002.02), 14),
|
|
||||||
cityHall: new serverClasses.interiorTemplateData(toVector3(389.538, 173.652, 1008.38), 3),
|
|
||||||
gantonGym: new serverClasses.interiorTemplateData(toVector3(772.2,-5.06,1000.73), 1),
|
|
||||||
kungFuGym: new serverClasses.interiorTemplateData(toVector3(774.21, -48.92, 1000.58), 6),
|
|
||||||
lvGym: new serverClasses.interiorTemplateData(toVector3(773.57, -77.09, 1000.65), 7),
|
|
||||||
insuranceCompany: new serverClasses.interiorTemplateData(toVector3(-2029.76, -119.624, 1035.17), 1),
|
|
||||||
stripClub1: new serverClasses.interiorTemplateData(toVector3(1204.80,-11.58,1000.92), 2),
|
|
||||||
stripClub1Private: new serverClasses.interiorTemplateData(toVector3(1204.80, 13.89, 1000.92), 2),
|
|
||||||
nightClub: new serverClasses.interiorTemplateData(toVector3(493.39,-22.72,1000.67), 17),
|
|
||||||
warehouse1: new serverClasses.interiorTemplateData(toVector3(1412.63, -1.78, 1000.92), 1),
|
|
||||||
warehouse2: new serverClasses.interiorTemplateData(toVector3(1302.51, -1.78, 1001.02), 18),
|
|
||||||
warehouse3: new serverClasses.interiorTemplateData(toVector3(76.63, -301.15, 1.57), 0),
|
|
||||||
warehouse4: new serverClasses.interiorTemplateData(toVector3(1059.89, 2081.68, 10.82), 0),
|
|
||||||
bikeSchool: new serverClasses.interiorTemplateData(toVector3(1494.32, 1304.94, 1093.28), 3),
|
|
||||||
bar1: new serverClasses.interiorTemplateData(toVector3(501.98,-69.15,998.75), 11),
|
|
||||||
diner1: new serverClasses.interiorTemplateData(toVector3(457.30, -88.42, 999.55), 4),
|
|
||||||
diner2: new serverClasses.interiorTemplateData(toVector3(454.97, -110.10, 1000.07), 4),
|
|
||||||
diner3: new serverClasses.interiorTemplateData(toVector3(435.27, -80.95, 999.55), 5),
|
|
||||||
smallPoliceStation: new serverClasses.interiorTemplateData(toVector3(322.19, 302.49, 999.14), 5),
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA UG
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // GTA IV
|
|
||||||
|
|
||||||
},
|
|
||||||
],
|
|
||||||
skinChangePosition: [
|
|
||||||
[],
|
|
||||||
[],
|
|
||||||
[],
|
|
||||||
[toVector3(258.14, -41.76, 1002.023), 1.322, 14],
|
|
||||||
[],
|
|
||||||
[],
|
|
||||||
],
|
|
||||||
/*
|
|
||||||
animations: [
|
|
||||||
false,
|
|
||||||
{
|
|
||||||
itemDrop: new serverClasses.animationData(),
|
|
||||||
itemPickup: new serverClasses.animationData(),
|
|
||||||
itemUse: new serverClasses.animationData(),
|
|
||||||
itemThrow: new serverClasses.animationData(),
|
|
||||||
itemPut: new serverClasses.animationData(),
|
|
||||||
itemTake: new serverClasses.animationData(),
|
|
||||||
itemGiveTake: new serverClasses.animationData(),
|
|
||||||
sit: new serverClasses.animationData(),
|
|
||||||
stand: new serverClasses.animationData(),
|
|
||||||
sitToStand: new serverClasses.animationData(),
|
|
||||||
standToSit: new serverClasses.animationData(),
|
|
||||||
standIdle: new serverClasses.animationData(),
|
|
||||||
talk: new serverClasses.animationData(),
|
|
||||||
wave: new serverClasses.animationData(),
|
|
||||||
greet: new serverClasses.animationData(),
|
|
||||||
handCuff: new serverClasses.animationData(),
|
|
||||||
handsUp: new serverClasses.animationData(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
itemDrop: new serverClasses.animationData(),
|
|
||||||
itemPickup: new serverClasses.animationData(),
|
|
||||||
itemUse: new serverClasses.animationData(),
|
|
||||||
itemThrow: new serverClasses.animationData(),
|
|
||||||
itemPut: new serverClasses.animationData(),
|
|
||||||
itemTake: new serverClasses.animationData(),
|
|
||||||
itemGiveTake: new serverClasses.animationData(),
|
|
||||||
sit: new serverClasses.animationData(),
|
|
||||||
stand: new serverClasses.animationData(),
|
|
||||||
sitToStand: new serverClasses.animationData(),
|
|
||||||
standToSit: new serverClasses.animationData(),
|
|
||||||
standIdle: new serverClasses.animationData(),
|
|
||||||
talk: new serverClasses.animationData(),
|
|
||||||
wave: new serverClasses.animationData(),
|
|
||||||
greet: new serverClasses.animationData(),
|
|
||||||
handCuff: new serverClasses.animationData(),
|
|
||||||
handsUp: new serverClasses.animationData(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
itemDrop: new serverClasses.animationData(),
|
|
||||||
itemPickup: new serverClasses.animationData(),
|
|
||||||
itemUse: new serverClasses.animationData(),
|
|
||||||
itemThrow: new serverClasses.animationData(),
|
|
||||||
itemPut: new serverClasses.animationData(),
|
|
||||||
itemTake: new serverClasses.animationData(),
|
|
||||||
itemGiveTake: new serverClasses.animationData(),
|
|
||||||
sit: new serverClasses.animationData(),
|
|
||||||
stand: new serverClasses.animationData(),
|
|
||||||
sitToStand: new serverClasses.animationData(),
|
|
||||||
standToSit: new serverClasses.animationData(),
|
|
||||||
standIdle: new serverClasses.animationData(),
|
|
||||||
talk: new serverClasses.animationData(),
|
|
||||||
wave: new serverClasses.animationData(),
|
|
||||||
greet: new serverClasses.animationData(),
|
|
||||||
handCuff: new serverClasses.animationData(),
|
|
||||||
handsUp: new serverClasses.animationData(),
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
{
|
|
||||||
itemDrop: new serverClasses.animationData(),
|
|
||||||
itemPickup: new serverClasses.animationData(),
|
|
||||||
itemUse: new serverClasses.animationData(),
|
|
||||||
itemThrow: new serverClasses.animationData(),
|
|
||||||
itemPut: new serverClasses.animationData(),
|
|
||||||
itemTake: new serverClasses.animationData(),
|
|
||||||
itemGiveTake: new serverClasses.animationData(),
|
|
||||||
sit: new serverClasses.animationData(),
|
|
||||||
stand: new serverClasses.animationData(),
|
|
||||||
sitToStand: new serverClasses.animationData(),
|
|
||||||
standToSit: new serverClasses.animationData(),
|
|
||||||
standIdle: new serverClasses.animationData(),
|
|
||||||
talk: new serverClasses.animationData(),
|
|
||||||
wave: new serverClasses.animationData(),
|
|
||||||
greet: new serverClasses.animationData(),
|
|
||||||
handCuff: new serverClasses.animationData(),
|
|
||||||
handsUp: new serverClasses.animationData(),
|
|
||||||
}
|
|
||||||
],
|
|
||||||
tutorial: {
|
|
||||||
spawnPosition: [
|
|
||||||
false,
|
|
||||||
new serverClasses.tutorialVehicleData(new Vec3(0.0, 0.0, 0.0), 0.0, 0, 0),
|
|
||||||
new serverClasses.tutorialVehicleData(new Vec3(0.0, 0.0, 0.0), 0.0, 0, 0),
|
|
||||||
new serverClasses.tutorialSpawnData(new Vec3(0.0, 0.0, 0.0), 0.0, 0, 0),
|
|
||||||
false,
|
|
||||||
new serverClasses.tutorialVehicleData(new Vec3(0.0, 0.0, 0.0), 0.0, 0, 0),
|
|
||||||
],
|
|
||||||
vehicle: [
|
|
||||||
false,
|
|
||||||
new serverClasses.tutorialVehicleData(111, new Vec3(0.0, 0.0, 0.0)),
|
|
||||||
new serverClasses.tutorialVehicleData(175, new Vec3(0.0, 0.0, 0.0), 0.0),
|
|
||||||
new serverClasses.tutorialVehicleData(445, new Vec3(0.0, 0.0, 0.0), 0.0),
|
|
||||||
false,
|
|
||||||
new serverClasses.tutorialVehicleData(0, new Vec3(0.0, 0.0, 0.0), 0.0),
|
|
||||||
],
|
|
||||||
item: [
|
|
||||||
false,
|
|
||||||
new serverClasses.tutorialItemData(new Vec3(0.0, 0.0, 0.0)),
|
|
||||||
new serverClasses.tutorialItemData(new Vec3(0.0, 0.0, 0.0), 0.0),
|
|
||||||
new serverClasses.tutorialItemData(new Vec3(0.0, 0.0, 0.0), 0.0),
|
|
||||||
false,
|
|
||||||
new serverClasses.tutorialItemData(new Vec3(0.0, 0.0, 0.0), 0.0),
|
|
||||||
],
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -29,363 +29,6 @@ let serverData = {
|
|||||||
whiteListedGameScripts: [],
|
whiteListedGameScripts: [],
|
||||||
blackListedGameScripts: [],
|
blackListedGameScripts: [],
|
||||||
},
|
},
|
||||||
policeStations: [
|
|
||||||
false,
|
|
||||||
[ // GTA 3
|
|
||||||
{
|
|
||||||
position: toVector3(1143.875, -675.1875, 14.97),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Portland",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(340.25, -1123.375, 25.98),
|
|
||||||
heading: 3.14,
|
|
||||||
blip: false,
|
|
||||||
name: "Staunton Island",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1253.0, -138.1875, 58.75),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Shoreside Vale",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA VC
|
|
||||||
{
|
|
||||||
position: toVector3(399.77, -468.90, 11.73),
|
|
||||||
heading: 0.0,
|
|
||||||
blip: false,
|
|
||||||
name: "Washington Beach",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(508.96, 512.07, 12.10),
|
|
||||||
heading: 0.0,
|
|
||||||
blip: false,
|
|
||||||
name: "Vice Point",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-657.43, 762.31, 11.59),
|
|
||||||
heading: 0.0,
|
|
||||||
blip: false,
|
|
||||||
name: "Downtown",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-885.08, -470.44, 13.11),
|
|
||||||
heading: 0.0,
|
|
||||||
blip: false,
|
|
||||||
name: "Little Havana",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA SA
|
|
||||||
{
|
|
||||||
position: toVector3(1545.53, -1675.64, 13.561),
|
|
||||||
heading: -1.575,
|
|
||||||
blip: false,
|
|
||||||
name: "Los Santos",
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA IV
|
|
||||||
|
|
||||||
{
|
|
||||||
position: toVector3(894.99, -357.39, 18.185),
|
|
||||||
heading: 2.923,
|
|
||||||
blip: false,
|
|
||||||
name: "Broker",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(435.40, 1592.29, 17.353),
|
|
||||||
heading: 3.087,
|
|
||||||
blip: false,
|
|
||||||
name: "South Bohan",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(974.93, 1870.45, 23.073),
|
|
||||||
heading: -1.621,
|
|
||||||
blip: false,
|
|
||||||
name: "Northern Gardens",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(1233.25, -89.13, 28.034),
|
|
||||||
heading: 1.568,
|
|
||||||
blip: false,
|
|
||||||
name: "South Slopes",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(50.12, 679.88, 15.316),
|
|
||||||
heading: 1.569,
|
|
||||||
blip: false,
|
|
||||||
name: "Middle Park East",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(85.21, 1189.82, 14.755),
|
|
||||||
heading: 3.127,
|
|
||||||
blip: false,
|
|
||||||
name: "East Holland",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(2170.87, 448.87, 6.085),
|
|
||||||
heading: 1.501,
|
|
||||||
blip: false,
|
|
||||||
name: "Francis International Airport",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(213.12, -211.70, 10.752),
|
|
||||||
heading: 0.200,
|
|
||||||
blip: false,
|
|
||||||
name: "Chinatown",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1714.95, 276.31, 22.134),
|
|
||||||
heading: 1.127,
|
|
||||||
blip: false,
|
|
||||||
name: "Acter",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1220.73, -231.53, 3.024),
|
|
||||||
heading: 2.210,
|
|
||||||
blip: false,
|
|
||||||
name: "Port Tudor",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-927.66, 1263.63, 24.587),
|
|
||||||
heading: -0.913,
|
|
||||||
blip: false,
|
|
||||||
name: "Leftwood",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
],
|
|
||||||
fireStations: [
|
|
||||||
false,
|
|
||||||
[ // GTA 3
|
|
||||||
{
|
|
||||||
position: toVector3(1103.70, -52.45, 7.49),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Portland",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-78.48, -436.80, 16.17),
|
|
||||||
heading: 3.14,
|
|
||||||
blip: false,
|
|
||||||
name: "Staunton Island",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1202.10, -14.67, 53.20),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Shoreside Vale",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA VC
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA SA
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA IV
|
|
||||||
{
|
|
||||||
position: toVector3(953.13, 95.90, 35.004),
|
|
||||||
heading: 1.595,
|
|
||||||
blip: false,
|
|
||||||
name: "Broker",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-271.02, 1542.15, 20.420),
|
|
||||||
heading: -1.160,
|
|
||||||
blip: false,
|
|
||||||
name: "Northwood",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(1120.47, 1712.36, 10.534),
|
|
||||||
heading: -0.682,
|
|
||||||
blip: false,
|
|
||||||
name: "Northern Gardens",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(2364.87, 166.83, 5.813),
|
|
||||||
heading: 0.156,
|
|
||||||
blip: false,
|
|
||||||
name: "Francis International Airport",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(295.40, -336.88, 4.963),
|
|
||||||
heading: 2.887,
|
|
||||||
blip: false,
|
|
||||||
name: "Chinatown",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
],
|
|
||||||
hospitals: [
|
|
||||||
false,
|
|
||||||
[ // GTA 3
|
|
||||||
{
|
|
||||||
position: toVector3(1144.25, -596.875, 14.97),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Portland",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(183.5, -17.75, 16.21),
|
|
||||||
heading: 3.14,
|
|
||||||
blip: false,
|
|
||||||
name: "Staunton Island",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1259.5, -44.5, 58.89),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Shoreside Vale",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA VC
|
|
||||||
{
|
|
||||||
position: toVector3(493.14, 709.31, 11.80),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Unknown",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-826.06, 1144.41, 12.41),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "Unknown",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA SA
|
|
||||||
{
|
|
||||||
position: toVector3(1172.96, -1323.42, 15.40),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "All Saints",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(2034.04, -1405.07, 17.24),
|
|
||||||
heading: 1.5,
|
|
||||||
blip: false,
|
|
||||||
name: "County General",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA IV
|
|
||||||
{
|
|
||||||
position: toVector3(1199.59, 196.78, 33.554),
|
|
||||||
heading: 1.633,
|
|
||||||
blip: false,
|
|
||||||
name: "Schottler",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(980.71, 1831.61, 23.898),
|
|
||||||
heading: -0.049,
|
|
||||||
blip: false,
|
|
||||||
name: "Northern Gardens",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1317.27, 1277.20, 22.370),
|
|
||||||
heading: 2.246,
|
|
||||||
blip: false,
|
|
||||||
name: "Leftwood",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1538.43, 344.58, 20.943),
|
|
||||||
heading: -0.156,
|
|
||||||
blip: false,
|
|
||||||
name: "Acter",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
],
|
|
||||||
payAndSprays: [
|
|
||||||
false,
|
|
||||||
[ // GTA 3
|
|
||||||
{
|
|
||||||
position: toVector3(925.4, -360.3, 10.83),
|
|
||||||
blip: false,
|
|
||||||
name: "Portland",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(381.8, -493.8, 25.95),
|
|
||||||
blip: false,
|
|
||||||
name: "Staunton Island",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(-1142.4, 35.01, 58.61),
|
|
||||||
blip: false,
|
|
||||||
name: "Shoreside Vale",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA VC
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA SA
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA IV
|
|
||||||
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
ammunations: [
|
|
||||||
false,
|
|
||||||
[ // GTA 3
|
|
||||||
{
|
|
||||||
position: toVector3(1068.3, -400.9, 15.24),
|
|
||||||
blip: false,
|
|
||||||
name: "Portland",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
position: toVector3(348.2, -717.9, 26.43),
|
|
||||||
blip: false,
|
|
||||||
name: "Staunton Island",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA VC
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA SA
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA IV
|
|
||||||
|
|
||||||
]
|
|
||||||
],
|
|
||||||
fuelStations: [
|
|
||||||
false,
|
|
||||||
[ // GTA 3
|
|
||||||
|
|
||||||
{
|
|
||||||
position: toVector3(1161.9, -76.73, 7.27),
|
|
||||||
blip: false,
|
|
||||||
name: "Portland",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[ // GTA VC
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA SA
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA UG
|
|
||||||
|
|
||||||
],
|
|
||||||
[ // GTA IV
|
|
||||||
|
|
||||||
]
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ function createDatabaseInsertQuery(tableName, data) {
|
|||||||
for(let i in data) {
|
for(let i in data) {
|
||||||
fields.push(data[i][0]);
|
fields.push(data[i][0]);
|
||||||
|
|
||||||
if(typeof values[i][1] == "string") {
|
if(typeof data[i][1] == "string") {
|
||||||
values.push(`'${data[i][1]}'`);
|
values.push(`'${data[i][1]}'`);
|
||||||
} else {
|
} else {
|
||||||
values.push(data[i][1]);
|
values.push(data[i][1]);
|
||||||
@@ -216,14 +216,14 @@ function createDatabaseUpdateQuery(tableName, data, whereClause) {
|
|||||||
let values = [];
|
let values = [];
|
||||||
|
|
||||||
for(let i in data) {
|
for(let i in data) {
|
||||||
if(typeof values[i][1] == "string") {
|
if(typeof data[i][1] == "string") {
|
||||||
values.push(`${data[i][0]}='${data[i][1]}'`);
|
values.push(`${data[i][0]}='${data[i][1]}'`);
|
||||||
} else {
|
} else {
|
||||||
values.push(`${data[i][0]}=${data[i][1]}`);
|
values.push(`${data[i][0]}=${data[i][1]}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let queryString = `INSERT INTO ${tableName} SET ${values.join(", ")} WHERE ${whereClause}`;
|
let queryString = `UPDATE ${tableName} SET ${values.join(", ")} WHERE ${whereClause}`;
|
||||||
return queryString;
|
return queryString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -468,4 +468,18 @@ function togglePauseSavingToDatabase() {
|
|||||||
getServerConfig().pauseSavingToDatabase = !getServerConfig().pauseSavingToDatabase;
|
getServerConfig().pauseSavingToDatabase = !getServerConfig().pauseSavingToDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function createAccountDataForNewServer(serverId) {
|
||||||
|
let dbConnection = connectToDatabase();
|
||||||
|
let dbQuery = false;
|
||||||
|
if(dbConnection) {
|
||||||
|
dbQuery = queryDatabase(dbConnection, `SELECT * FROM acct_main`);
|
||||||
|
if(dbQuery) {
|
||||||
|
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${serverId})`;
|
||||||
|
quickDatabaseQuery(dbQueryString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -46,7 +46,9 @@ function onPlayerConnect(event, ipAddress, port) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function onPlayerJoin(event, client) {
|
function onPlayerJoin(event, client) {
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -81,21 +83,24 @@ function onPlayerQuit(event, client, quitReasonId) {
|
|||||||
function onPlayerChat(event, client, messageText) {
|
function onPlayerChat(event, client, messageText) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if(!isNull(getPlayerData(client))) {
|
if(!getPlayerData(client)) {
|
||||||
if(!isPlayerLoggedIn(client)) {
|
messagePlayerError(client, "You need to login before you can chat!");
|
||||||
messagePlayerError(client, "You need to login before you can chat!");
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(!isPlayerSpawned(client)) {
|
if(!isPlayerLoggedIn(client)) {
|
||||||
messagePlayerError(client, "You need to login before you can chat!");
|
messagePlayerError(client, "You need to login before you can chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isPlayerMuted(client)) {
|
if(!isPlayerSpawned(client)) {
|
||||||
messagePlayerError(client, "You are muted and can't chat!");
|
messagePlayerError(client, "You need to spawn before you can chat!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isPlayerMuted(client)) {
|
||||||
|
messagePlayerError(client, "You are muted and can't chat!");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageText = messageText.substring(0, 128);
|
messageText = messageText.substring(0, 128);
|
||||||
@@ -320,11 +325,13 @@ function onPlayerDeath(client, position) {
|
|||||||
updatePlayerSpawnedState(client, false);
|
updatePlayerSpawnedState(client, false);
|
||||||
setPlayerControlState(client, false);
|
setPlayerControlState(client, false);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
fadeCamera(client, false, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, false, 1.0);
|
||||||
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
client.despawnPlayer();
|
|
||||||
if(getPlayerCurrentSubAccount(client).inJail) {
|
if(getPlayerCurrentSubAccount(client).inJail) {
|
||||||
let closestJail = getClosestJail(position);
|
let closestJail = getClosestJail(getPlayerPosition(client));
|
||||||
|
client.despawnPlayer();
|
||||||
getPlayerCurrentSubAccount(client).interior = closestJail.interior;
|
getPlayerCurrentSubAccount(client).interior = closestJail.interior;
|
||||||
getPlayerCurrentSubAccount(client).dimension = closestJail.dimension;
|
getPlayerCurrentSubAccount(client).dimension = closestJail.dimension;
|
||||||
if(getServerGame() == GAME_GTA_IV) {
|
if(getServerGame() == GAME_GTA_IV) {
|
||||||
@@ -333,19 +340,24 @@ function onPlayerDeath(client, position) {
|
|||||||
spawnPlayer(client, closestJail.position, closestJail.heading, getPlayerCurrentSubAccount(client).skin);
|
spawnPlayer(client, closestJail.position, closestJail.heading, getPlayerCurrentSubAccount(client).skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
updatePlayerSpawnedState(client, true);
|
updatePlayerSpawnedState(client, true);
|
||||||
} else {
|
} else {
|
||||||
let closestHospital = getClosestHospital(position);
|
let closestHospital = getClosestHospital(getPlayerPosition(client));
|
||||||
getPlayerCurrentSubAccount(client).interior = 0;
|
client.despawnPlayer();
|
||||||
getPlayerCurrentSubAccount(client).dimension = 0;
|
getPlayerCurrentSubAccount(client).interior = closestHospital.interior;
|
||||||
|
getPlayerCurrentSubAccount(client).dimension = closestHospital.dimension;
|
||||||
if(getServerGame() == GAME_GTA_IV) {
|
if(getServerGame() == GAME_GTA_IV) {
|
||||||
spawnPlayer(client, closestHospital, 0.0, getPlayerCurrentSubAccount(client).skin);
|
spawnPlayer(client, closestHospital.position, closestHospital.heading, getPlayerCurrentSubAccount(client).skin);
|
||||||
} else {
|
} else {
|
||||||
spawnPlayer(client, closestHospital, 0.0, getPlayerCurrentSubAccount(client).skin);
|
spawnPlayer(client, closestHospital.position, closestHospital.heading, getPlayerCurrentSubAccount(client).skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
updatePlayerSpawnedState(client, true);
|
updatePlayerSpawnedState(client, true);
|
||||||
}
|
}
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ function createHouseCommand(command, params, client) {
|
|||||||
createHouseEntranceBlip(houseId);
|
createHouseEntranceBlip(houseId);
|
||||||
createHouseExitBlip(houseId);
|
createHouseExitBlip(houseId);
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}created house ${getInlineChatColourByType("houseGreen")}${tempHouseData.description}`);
|
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}created house ${getInlineChatColourByType("houseGreen")}${tempHouseData.description}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +86,8 @@ function lockUnlockHouseCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messagePlayerSuccess(client, `House '${getHouseData(houseId).description}' ${getLockedUnlockedTextFromBool((getHouseData(houseId).locked))}!`);
|
messagePlayerSuccess(client, `House '${getHouseData(houseId).description}' ${getLockedUnlockedTextFromBool((getHouseData(houseId).locked))}!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,6 +112,8 @@ function setHouseDescriptionCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`${getPlayerName(client)} renamed house ${getInlineChatColourByType("houseGreen")}${oldDescription} ${getInlineChatColourByName("white")}to ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description}`);
|
messageAdmins(`${getPlayerName(client)} renamed house ${getInlineChatColourByType("houseGreen")}${oldDescription} ${getInlineChatColourByName("white")}to ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,6 +133,8 @@ function setHouseOwnerCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = VRR_HOUSEOWNER_PLAYER;
|
getHouseData(houseId).ownerType = VRR_HOUSEOWNER_PLAYER;
|
||||||
getHouseData(houseId).ownerId = getServerData().clients[newHouseOwner.index].accountData.databaseId;
|
getHouseData(houseId).ownerId = getServerData().clients[newHouseOwner.index].accountData.databaseId;
|
||||||
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}set house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}owner to ${getInlineChatColourByName("lightGrey")}${newHouseOwner.name}`);
|
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}set house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}owner to ${getInlineChatColourByName("lightGrey")}${newHouseOwner.name}`);
|
||||||
@@ -149,6 +157,8 @@ function setHouseClanCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
getHouseData(houseId).ownerType = VRR_HOUSEOWNER_CLAN;
|
getHouseData(houseId).ownerType = VRR_HOUSEOWNER_CLAN;
|
||||||
getHouseData(houseId).ownerId = getClanData(clanId).databaseId;
|
getHouseData(houseId).ownerId = getClanData(clanId).databaseId;
|
||||||
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}set house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}owner to the ${getInlineChatColourByType("clanOrange")}${getClanData(clanId).name} ${getInlineChatColourByName("white")}clan!`);
|
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}set house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}owner to the ${getInlineChatColourByType("clanOrange")}${getClanData(clanId).name} ${getInlineChatColourByName("white")}clan!`);
|
||||||
@@ -185,6 +195,8 @@ function setHousePickupCommand(command, params, client) {
|
|||||||
createHouseEntrancePickup(houseId);
|
createHouseEntrancePickup(houseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`[#AAAAAA]${client.name} [#FFFFFF]set house [#11CC11]${getHouseData(houseId).description} [#FFFFFF]pickup display to [#AAAAAA]${toLowerCase(typeParam)}`);
|
messageAdmins(`[#AAAAAA]${client.name} [#FFFFFF]set house [#11CC11]${getHouseData(houseId).description} [#FFFFFF]pickup display to [#AAAAAA]${toLowerCase(typeParam)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,6 +239,8 @@ function setHouseInteriorTypeCommand(command, params, client) {
|
|||||||
createHouseEntrancePickup(houseId);
|
createHouseEntrancePickup(houseId);
|
||||||
createHouseExitPickup(houseId);
|
createHouseExitPickup(houseId);
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`[#AAAAAA]${client.name} [#FFFFFF]set house [#11CC11]${getHouseData(houseId).description} [#FFFFFF]interior type to [#AAAAAA]${toLowerCase(typeParam)}`);
|
messageAdmins(`[#AAAAAA]${client.name} [#FFFFFF]set house [#11CC11]${getHouseData(houseId).description} [#FFFFFF]interior type to [#AAAAAA]${toLowerCase(typeParam)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,6 +275,8 @@ function setHouseBlipCommand(command, params, client) {
|
|||||||
createHouseEntranceBlip(houseId);
|
createHouseEntranceBlip(houseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`[#AAAAAA]${client.name} [#FFFFFF]set house [#11CC11]${getHouseData(houseId).description} [#FFFFFF]blip display to [#AAAAAA]${toLowerCase(typeParam)}`);
|
messageAdmins(`[#AAAAAA]${client.name} [#FFFFFF]set house [#11CC11]${getHouseData(houseId).description} [#FFFFFF]blip display to [#AAAAAA]${toLowerCase(typeParam)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,6 +299,8 @@ function moveHouseEntranceCommand(command, params, client) {
|
|||||||
createAllHouseBlips(houseId);
|
createAllHouseBlips(houseId);
|
||||||
createAllHousePickups(houseId);
|
createAllHousePickups(houseId);
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}moved house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}entrance to their position`);
|
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}moved house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}entrance to their position`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +325,8 @@ function moveHouseExitCommand(command, params, client) {
|
|||||||
createAllHouseBlips(houseId);
|
createAllHouseBlips(houseId);
|
||||||
createAllHousePickups(houseId);
|
createAllHousePickups(houseId);
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = true;
|
||||||
|
|
||||||
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}moved house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}exit to their position`);
|
messageAdmins(`${getInlineChatColourByName("lightGrey")}${getPlayerName(client)} ${getInlineChatColourByName("white")}moved house ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}exit to their position`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +441,9 @@ function getPlayerHouse(client) {
|
|||||||
function saveAllHousesToDatabase() {
|
function saveAllHousesToDatabase() {
|
||||||
logToConsole(LOG_INFO, `[VRR.House]: Saving all server houses to database ...`);
|
logToConsole(LOG_INFO, `[VRR.House]: Saving all server houses to database ...`);
|
||||||
for(let i in getServerData().houses) {
|
for(let i in getServerData().houses) {
|
||||||
saveHouseToDatabase(i);
|
if(getServerData().houses[i].needsSaved) {
|
||||||
|
saveHouseToDatabase(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_INFO, `[VRR.House]: Saving all server houses to database ...`);
|
logToConsole(LOG_INFO, `[VRR.House]: Saving all server houses to database ...`);
|
||||||
}
|
}
|
||||||
@@ -442,9 +464,9 @@ function saveHouseToDatabase(houseId) {
|
|||||||
["house_owner_type", tempHouseData.ownerType],
|
["house_owner_type", tempHouseData.ownerType],
|
||||||
["house_owner_id", tempHouseData.ownerId],
|
["house_owner_id", tempHouseData.ownerId],
|
||||||
["house_locked", boolToInt(tempHouseData.locked)],
|
["house_locked", boolToInt(tempHouseData.locked)],
|
||||||
["house_entrance_fee", tempHouseData.entranceFee],
|
//["house_entrance_fee", tempHouseData.entranceFee],
|
||||||
["house_entrance_pos_x", tempHouseData.entrancePosition.x],
|
["house_entrance_pos_x", tempHouseData.entrancePosition.x],
|
||||||
["house_entrance_pos_y", tempHouseData.entrancePosition.x],
|
["house_entrance_pos_y", tempHouseData.entrancePosition.y],
|
||||||
["house_entrance_pos_z", tempHouseData.entrancePosition.z],
|
["house_entrance_pos_z", tempHouseData.entrancePosition.z],
|
||||||
["house_entrance_rot_z", tempHouseData.entranceRotation],
|
["house_entrance_rot_z", tempHouseData.entranceRotation],
|
||||||
["house_entrance_int", tempHouseData.entranceInterior],
|
["house_entrance_int", tempHouseData.entranceInterior],
|
||||||
@@ -470,10 +492,11 @@ function saveHouseToDatabase(houseId) {
|
|||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
getServerData().houses[houseId].databaseId = getDatabaseInsertId(dbConnection);
|
getServerData().houses[houseId].databaseId = getDatabaseInsertId(dbConnection);
|
||||||
} else {
|
} else {
|
||||||
let queryString = createDatabaseUpdateQuery("house_main", data, `WHERE house_id=${tempHouseData.databaseId}`);
|
let queryString = createDatabaseUpdateQuery("house_main", data, `house_id=${tempHouseData.databaseId}`);
|
||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).needsSaved = false;
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
return true;
|
return true;
|
||||||
@@ -673,6 +696,91 @@ function getHouseInfoCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setHouseBuyPriceCommand(command, params, client) {
|
||||||
|
if(areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
|
|
||||||
|
let amount = toInteger(splitParams[0]) || 0;
|
||||||
|
let houseId = (isPlayerInAnyHouse(client)) ? getPlayerHouse(client) : getClosestHouseEntrance(getPlayerPosition(client));
|
||||||
|
|
||||||
|
if(!getHouseData(houseId)) {
|
||||||
|
messagePlayerError(client, "Business not found!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(amount < 0) {
|
||||||
|
messagePlayerError(client, `The amount can't be less than 0!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).buyPrice = amount;
|
||||||
|
setEntityData(getHouseData(houseId).entrancePickup, "vrr.label.price", getHouseData(houseId).buyPrice, true);
|
||||||
|
messagePlayerSuccess(client, `${getInlineChatColourByName("white")}You set business ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description}'s ${getInlineChatColourByName("white")}for-sale price to ${getInlineChatColourByName("lightGrey")}$${makeLargeNumberReadable(amount)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setHouseRentPriceCommand(command, params, client) {
|
||||||
|
if(areParamsEmpty(params)) {
|
||||||
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let splitParams = params.split(" ");
|
||||||
|
|
||||||
|
let amount = toInteger(splitParams[0]) || 0;
|
||||||
|
let houseId = (isPlayerInAnyHouse(client)) ? getPlayerHouse(client) : getClosestHouseEntrance(getPlayerPosition(client));
|
||||||
|
|
||||||
|
if(!getHouseData(houseId)) {
|
||||||
|
messagePlayerError(client, "Business not found!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(amount < 0) {
|
||||||
|
messagePlayerError(client, `The amount can't be less than 0!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).rentPrice = amount;
|
||||||
|
setEntityData(getHouseData(houseId).entrancePickup, "vrr.label.price", `Rent: ${getHouseData(houseId).rentPrice}`, true);
|
||||||
|
messagePlayerSuccess(client, `${getInlineChatColourByName("white")}You set business ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description}'s ${getInlineChatColourByName("white")}rent price to ${getInlineChatColourByName("lightGrey")}$${makeLargeNumberReadable(amount)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function buyHouseCommand(command, params, client) {
|
||||||
|
let houseId = (isPlayerInAnyHouse(client)) ? getPlayerHouse(client) : getClosestHouseEntrance(getPlayerPosition(client));
|
||||||
|
|
||||||
|
if(!getHouseData(houseId)) {
|
||||||
|
messagePlayerError(client, "House not found!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getHouseData(houseId).buyPrice <= 0) {
|
||||||
|
messagePlayerError(client, `${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description} ${getInlineChatColourByName("white")}is not for sale!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getPlayerCurrentSubAccount(client).cash < getHouseData(houseId).buyPrice) {
|
||||||
|
messagePlayerError(client, `You don't have enough money to buy business ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).name}!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHouseData(houseId).ownerType = VRR_BIZOWNER_PLAYER;
|
||||||
|
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId;
|
||||||
|
getHouseData(houseId).buyPrice = 0;
|
||||||
|
|
||||||
|
updateHousePickupLabelData(houseId);
|
||||||
|
|
||||||
|
messagePlayerSuccess(client, `You are now the owner of ${getInlineChatColourByType("houseGreen")}${getHouseData(houseId).description}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function isPlayerInAnyHouse(client) {
|
function isPlayerInAnyHouse(client) {
|
||||||
return doesEntityDataExist(client, "vrr.inHouse");
|
return doesEntityDataExist(client, "vrr.inHouse");
|
||||||
}
|
}
|
||||||
@@ -807,4 +915,5 @@ function getHouseIdFromDatabaseId(databaseId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -107,8 +107,9 @@ 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, "vrr.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
//setEntityData(getItemData(itemId).object, "vrr.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
||||||
addToWorld(getItemData(itemId).object);
|
addToWorld(getItemData(itemId).object);
|
||||||
|
//setEntityData(getItemData(itemId).object, "vrr.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
|
||||||
|
|
||||||
getServerData().groundItemCache.push(itemId);
|
getServerData().groundItemCache.push(itemId);
|
||||||
}
|
}
|
||||||
@@ -172,6 +173,8 @@ function createItemCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function useItemCommand(command, params, client) {
|
function useItemCommand(command, params, client) {
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
let hotBarSlot = getPlayerData(client).activeHotBarSlot;
|
let hotBarSlot = getPlayerData(client).activeHotBarSlot;
|
||||||
if(!areParamsEmpty(params)) {
|
if(!areParamsEmpty(params)) {
|
||||||
hotBarSlot = toInteger(params);
|
hotBarSlot = toInteger(params);
|
||||||
@@ -196,11 +199,12 @@ function useItemCommand(command, params, client) {
|
|||||||
|
|
||||||
if(!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
if(!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
||||||
messagePlayerError(client, `The item you're trying to use is bugged. A bug report has been sent to the server developers.`);
|
messagePlayerError(client, `The item you're trying to use is bugged. A bug report has been sent to the server developers.`);
|
||||||
submitBugReport(client, `(AUTOMATED REPORT) Drop 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getItemTypeData(getItemData(itemId).itemTypeIndex).useType == VRR_ITEM_USETYPE_NONE || getItemTypeData(getItemData(itemId).itemTypeIndex).useType == VRR_ITEM_USETYPE_WEAPON) {
|
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
||||||
|
messagePlayerError(client, `Your hands are busy.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +212,7 @@ function useItemCommand(command, params, client) {
|
|||||||
getPlayerData(client).itemActionItem = hotBarSlot;
|
getPlayerData(client).itemActionItem = hotBarSlot;
|
||||||
showPlayerItemUseDelay(client, hotBarSlot);
|
showPlayerItemUseDelay(client, hotBarSlot);
|
||||||
|
|
||||||
clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
//clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -236,6 +240,8 @@ function deleteGroundItemCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function pickupItemCommand(command, params, client) {
|
function pickupItemCommand(command, params, client) {
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
let itemId = getClosestItemOnGround(getPlayerPosition(client));
|
let itemId = getClosestItemOnGround(getPlayerPosition(client));
|
||||||
|
|
||||||
if(!getItemData(itemId)) {
|
if(!getItemData(itemId)) {
|
||||||
@@ -262,6 +268,7 @@ function pickupItemCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
||||||
|
messagePlayerError(client, `Your hands are busy.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,16 +276,18 @@ function pickupItemCommand(command, params, client) {
|
|||||||
getPlayerData(client).itemActionItem = itemId;
|
getPlayerData(client).itemActionItem = itemId;
|
||||||
showPlayerItemPickupDelay(client, itemId);
|
showPlayerItemPickupDelay(client, itemId);
|
||||||
|
|
||||||
clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
//clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function dropItemCommand(command, params, client) {
|
function dropItemCommand(command, params, client) {
|
||||||
let hotBarSlot = getPlayerData(client).activeHotBarSlot;
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
|
let hotBarSlot = getPlayerData(client).activeHotBarSlot;
|
||||||
if(!areParamsEmpty(params)) {
|
if(!areParamsEmpty(params)) {
|
||||||
hotBarSlot = toInteger(params);
|
hotBarSlot = toInteger(params);
|
||||||
|
hotBarSlot = hotBarSlot-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hotBarSlot == -1) {
|
if(hotBarSlot == -1) {
|
||||||
@@ -286,7 +295,6 @@ function dropItemCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).hotBarItems[hotBarSlot] == -1) {
|
if(getPlayerData(client).hotBarItems[hotBarSlot] == -1) {
|
||||||
messagePlayerError(client, `Please equip an item or provide a slot ID to drop an item`);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,19 +313,22 @@ function dropItemCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
||||||
|
messagePlayerError(client, `Your hands are busy.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerData(client).itemActionItem = hotBarSlot;
|
|
||||||
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_DROP;
|
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_DROP;
|
||||||
showPlayerItemDropDelay(client, itemId);
|
getPlayerData(client).itemActionItem = hotBarSlot;
|
||||||
|
showPlayerItemDropDelay(client, hotBarSlot);
|
||||||
|
|
||||||
clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
//clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function putItemCommand(command, params, client) {
|
function putItemCommand(command, params, client) {
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
let hotBarSlot = toInteger(params);
|
let hotBarSlot = toInteger(params);
|
||||||
|
|
||||||
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
||||||
@@ -335,6 +346,7 @@ function putItemCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
||||||
|
messagePlayerError(client, `Your hands are busy.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,12 +354,14 @@ function putItemCommand(command, params, client) {
|
|||||||
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_PUT;
|
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_PUT;
|
||||||
showPlayerItemPutDelay(client, hotBarSlot);
|
showPlayerItemPutDelay(client, hotBarSlot);
|
||||||
|
|
||||||
clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
//clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function takeItemCommand(command, params, client) {
|
function takeItemCommand(command, params, client) {
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
let firstSlot = getPlayerFirstEmptyHotBarSlot(client);
|
let firstSlot = getPlayerFirstEmptyHotBarSlot(client);
|
||||||
if(firstSlot == -1) {
|
if(firstSlot == -1) {
|
||||||
messagePlayerError(client, `You don't have any space to hold another item (full inventory)!`);
|
messagePlayerError(client, `You don't have any space to hold another item (full inventory)!`);
|
||||||
@@ -365,6 +379,7 @@ function takeItemCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
||||||
|
messagePlayerError(client, `Your hands are busy.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +387,7 @@ function takeItemCommand(command, params, client) {
|
|||||||
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_TAKE;
|
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_TAKE;
|
||||||
showPlayerItemTakeDelay(client, itemId);
|
showPlayerItemTakeDelay(client, itemId);
|
||||||
|
|
||||||
clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
//clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -692,6 +707,7 @@ function playerDropItem(client, hotBarSlot) {
|
|||||||
meActionToNearbyPlayers(client, `drops ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} on the ground`);
|
meActionToNearbyPlayers(client, `drops ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} on the ground`);
|
||||||
|
|
||||||
resyncWeaponItemAmmo(client);
|
resyncWeaponItemAmmo(client);
|
||||||
|
clearPlayerWeapons(client);
|
||||||
|
|
||||||
getPlayerData(client).hotBarItems[hotBarSlot] = -1;
|
getPlayerData(client).hotBarItems[hotBarSlot] = -1;
|
||||||
updatePlayerHotBar(client);
|
updatePlayerHotBar(client);
|
||||||
@@ -731,6 +747,7 @@ function playerPutItem(client, hotBarSlot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resyncWeaponItemAmmo(client);
|
resyncWeaponItemAmmo(client);
|
||||||
|
clearPlayerWeapons(client);
|
||||||
|
|
||||||
getItemData(itemId).ownerType = ownerType;
|
getItemData(itemId).ownerType = ownerType;
|
||||||
getItemData(itemId).ownerId = ownerId;
|
getItemData(itemId).ownerId = ownerId;
|
||||||
@@ -812,14 +829,15 @@ function playerSwitchItem(client, newHotBarSlot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resyncWeaponItemAmmo(client);
|
resyncWeaponItemAmmo(client);
|
||||||
|
clearPlayerWeapons(client);
|
||||||
|
|
||||||
if(currentHotBarItem != -1) {
|
//if(currentHotBarItem != -1) {
|
||||||
if(getItemData(currentHotBarItem)) {
|
// if(getItemData(currentHotBarItem)) {
|
||||||
if(getGlobalConfig().weaponEquippableTypes.indexOf(getItemTypeData(getItemData(currentHotBarItem).itemTypeIndex).useType) != -1) {
|
// if(getGlobalConfig().weaponEquippableTypes.indexOf(getItemTypeData(getItemData(currentHotBarItem).itemTypeIndex).useType) != -1) {
|
||||||
clearPlayerWeapons(client);
|
// clearPlayerWeapons(client);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(newHotBarItem != -1) {
|
if(newHotBarItem != -1) {
|
||||||
if(getItemData(newHotBarItem)) {
|
if(getItemData(newHotBarItem)) {
|
||||||
@@ -865,6 +883,8 @@ function playerSwitchItem(client, newHotBarSlot) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerSwitchHotBarSlotCommand(command, params, client) {
|
function playerSwitchHotBarSlotCommand(command, params, client) {
|
||||||
|
clearPlayerItemActionState(client);
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if(areParamsEmpty(params)) {
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
@@ -888,6 +908,7 @@ function playerSwitchHotBarSlotCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
||||||
|
messagePlayerError(client, `Your hands are busy.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1273,36 +1294,37 @@ function getItemTypeIndexFromDatabaseId(databaseId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function playerItemActionDelayComplete(client) {
|
function playerItemActionDelayComplete(client) {
|
||||||
if(getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) {
|
logToConsole(LOG_VERBOSE, `[VRR.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`);
|
||||||
switch(getPlayerData(client).itemActionState) {
|
switch(getPlayerData(client).itemActionState) {
|
||||||
case VRR_ITEM_ACTION_USE:
|
case VRR_ITEM_ACTION_USE:
|
||||||
playerUseItem(client, getPlayerData(client).itemActionItem);
|
playerUseItem(client, getPlayerData(client).itemActionItem);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_ITEM_ACTION_DROP:
|
case VRR_ITEM_ACTION_DROP:
|
||||||
playerDropItem(client, getPlayerData(client).itemActionItem);
|
playerDropItem(client, getPlayerData(client).itemActionItem);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_ITEM_ACTION_TAKE:
|
case VRR_ITEM_ACTION_TAKE:
|
||||||
playerTakeItem(client, getPlayerData(client).itemActionItem);
|
playerTakeItem(client, getPlayerData(client).itemActionItem);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_ITEM_ACTION_PUT:
|
case VRR_ITEM_ACTION_PUT:
|
||||||
playerPutItem(client, getPlayerData(client).itemActionItem);
|
playerPutItem(client, getPlayerData(client).itemActionItem);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_ITEM_ACTION_PICKUP:
|
case VRR_ITEM_ACTION_PICKUP:
|
||||||
playerPickupItem(client, getPlayerData(client).itemActionItem);
|
playerPickupItem(client, getPlayerData(client).itemActionItem);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VRR_ITEM_ACTION_SWITCH:
|
case VRR_ITEM_ACTION_SWITCH:
|
||||||
playerSwitchItem(client, getPlayerData(client).itemActionItem);
|
playerSwitchItem(client, getPlayerData(client).itemActionItem);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_NONE;
|
clearPlayerItemActionState(client);
|
||||||
getPlayerData(client).itemActionItem = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1424,6 +1446,7 @@ function getOrderPriceForItemType(itemType) {
|
|||||||
|
|
||||||
function clearPlayerItemActionState(client) {
|
function clearPlayerItemActionState(client) {
|
||||||
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_NONE;
|
getPlayerData(client).itemActionState = VRR_ITEM_ACTION_NONE;
|
||||||
|
getPlayerData(client).itemActionItem = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1519,10 +1542,14 @@ function showPlayerInventoryToPlayer(client, targetClient) {
|
|||||||
resyncWeaponItemAmmo(targetClient);
|
resyncWeaponItemAmmo(targetClient);
|
||||||
let itemDisplay = [];
|
let itemDisplay = [];
|
||||||
for(let i in getPlayerData(targetClient).hotBarItems) {
|
for(let i in getPlayerData(targetClient).hotBarItems) {
|
||||||
|
let colour = getInlineChatColourByName("lightGrey");
|
||||||
|
if(getPlayerData(targetClient).activeHotBarSlot == i) {
|
||||||
|
colour = getInlineChatColourByName("yellow");
|
||||||
|
}
|
||||||
if(getPlayerData(targetClient).hotBarItems[i] == -1) {
|
if(getPlayerData(targetClient).hotBarItems[i] == -1) {
|
||||||
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${getInlineChatColourByName("lightGrey")}(Empty)`);
|
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${colour}(Empty)`);
|
||||||
} else {
|
} else {
|
||||||
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${getInlineChatColourByName("lightGrey")}${getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex).name}[${getItemValueDisplayForItem(getPlayerData(targetClient).hotBarItems[i])}]`);
|
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${colour}${getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex).name}[${getItemValueDisplayForItem(getPlayerData(targetClient).hotBarItems[i])}]`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1577,7 +1604,7 @@ function switchPlayerActiveHotBarSlot(client, slotId) {
|
|||||||
if(slotId != -1) {
|
if(slotId != -1) {
|
||||||
showPlayerItemSwitchDelay(client, slotId);
|
showPlayerItemSwitchDelay(client, slotId);
|
||||||
}
|
}
|
||||||
clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
//clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1589,8 +1589,8 @@ function createJobLocationPickup(jobId, locationId) {
|
|||||||
pickupModelId = getJobData(jobId).pickupModel;
|
pickupModelId = getJobData(jobId).pickupModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
getJobData(jobId).locations[locationId].pickup = gta.createPickup(pickupModelId, getJobData(jobId).locations[locationId].position, getGameConfig().pickupTypes[getServerGame()].job);
|
getJobData(jobId).locations[locationId].pickup = createGamePickup(pickupModelId, getJobData(jobId).locations[locationId].position, getGameConfig().pickupTypes[getServerGame()].job);
|
||||||
getJobData(jobId).locations[locationId].pickup.dimension = getJobData(jobId).locations[locationId].dimension;
|
setElementDimension(getJobData(jobId).locations[locationId].pickup, getJobData(jobId).locations[locationId].dimension);
|
||||||
setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.owner.type", VRR_PICKUP_JOB, false);
|
setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.owner.type", VRR_PICKUP_JOB, false);
|
||||||
setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.owner.id", locationId, false);
|
setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.owner.id", locationId, false);
|
||||||
setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.label.type", VRR_LABEL_JOB, true);
|
setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.label.type", VRR_LABEL_JOB, true);
|
||||||
|
|||||||
@@ -129,7 +129,11 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
clearPlayerStateToEnterExitProperty(client);
|
clearPlayerStateToEnterExitProperty(client);
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGPROPERTY;
|
getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGPROPERTY;
|
||||||
meActionToNearbyPlayers(client, "opens the door and exits the house");
|
meActionToNearbyPlayers(client, "opens the door and exits the house");
|
||||||
fadeCamera(client, false, 1.0);
|
|
||||||
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, false, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
disableCityAmbienceForPlayer(client, true);
|
disableCityAmbienceForPlayer(client, true);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
setPlayerPosition(client, inHouse.entrancePosition);
|
setPlayerPosition(client, inHouse.entrancePosition);
|
||||||
@@ -137,7 +141,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
setPlayerDimension(client, inHouse.entranceDimension);
|
setPlayerDimension(client, inHouse.entranceDimension);
|
||||||
setPlayerInterior(client, inHouse.entranceInterior);
|
setPlayerInterior(client, inHouse.entranceInterior);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
enableCityAmbienceForPlayer(client);
|
enableCityAmbienceForPlayer(client);
|
||||||
clearPlayerOwnedPeds(client);
|
clearPlayerOwnedPeds(client);
|
||||||
@@ -163,7 +169,11 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGPROPERTY;
|
getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGPROPERTY;
|
||||||
clearPlayerStateToEnterExitProperty(client)
|
clearPlayerStateToEnterExitProperty(client)
|
||||||
meActionToNearbyPlayers(client, "opens the door and exits the business");
|
meActionToNearbyPlayers(client, "opens the door and exits the business");
|
||||||
fadeCamera(client, false, 1.0);
|
|
||||||
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, false, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
disableCityAmbienceForPlayer(client, true);
|
disableCityAmbienceForPlayer(client, true);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
setPlayerPosition(client, inBusiness.entrancePosition);
|
setPlayerPosition(client, inBusiness.entrancePosition);
|
||||||
@@ -171,7 +181,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
setPlayerDimension(client, inBusiness.entranceDimension);
|
setPlayerDimension(client, inBusiness.entranceDimension);
|
||||||
setPlayerInterior(client, inBusiness.entranceInterior);
|
setPlayerInterior(client, inBusiness.entranceInterior);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
enableCityAmbienceForPlayer(client);
|
enableCityAmbienceForPlayer(client);
|
||||||
clearPlayerOwnedPeds(client);
|
clearPlayerOwnedPeds(client);
|
||||||
@@ -205,7 +217,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
clearPlayerStateToEnterExitProperty(client)
|
clearPlayerStateToEnterExitProperty(client)
|
||||||
meActionToNearbyPlayers(client, "opens the door and enters the business");
|
meActionToNearbyPlayers(client, "opens the door and enters the business");
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
|
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
|
||||||
fadeCamera(client, false, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, false, 1.0);
|
||||||
|
}
|
||||||
disableCityAmbienceForPlayer(client);
|
disableCityAmbienceForPlayer(client);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
setPlayerPosition(client, closestBusiness.exitPosition);
|
setPlayerPosition(client, closestBusiness.exitPosition);
|
||||||
@@ -213,7 +227,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
setPlayerDimension(client, closestBusiness.exitDimension);
|
setPlayerDimension(client, closestBusiness.exitDimension);
|
||||||
setPlayerInterior(client, closestBusiness.exitInterior);
|
setPlayerInterior(client, closestBusiness.exitInterior);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
||||||
if(doesBusinessHaveAnyItemsToBuy(closestBusinessId)) {
|
if(doesBusinessHaveAnyItemsToBuy(closestBusinessId)) {
|
||||||
messagePlayerInfo(client, "Use /buy to purchase items from this business");
|
messagePlayerInfo(client, "Use /buy to purchase items from this business");
|
||||||
@@ -251,7 +267,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
clearPlayerStateToEnterExitProperty(client)
|
clearPlayerStateToEnterExitProperty(client)
|
||||||
meActionToNearbyPlayers(client, "opens the door and enters the house");
|
meActionToNearbyPlayers(client, "opens the door and enters the house");
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
|
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
|
||||||
fadeCamera(client, false, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, false, 1.0);
|
||||||
|
}
|
||||||
disableCityAmbienceForPlayer(client);
|
disableCityAmbienceForPlayer(client);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
setPlayerPosition(client, closestHouse.exitPosition);
|
setPlayerPosition(client, closestHouse.exitPosition);
|
||||||
@@ -259,7 +277,9 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
setPlayerDimension(client, closestHouse.exitDimension);
|
setPlayerDimension(client, closestHouse.exitDimension);
|
||||||
setPlayerInterior(client, closestHouse.exitInterior);
|
setPlayerInterior(client, closestHouse.exitInterior);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
fadeCamera(client, true, 1.0);
|
if(isFadeCameraSupported()) {
|
||||||
|
fadeCamera(client, true, 1.0);
|
||||||
|
}
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if(closestHouse.streamingRadioStation != -1) {
|
if(closestHouse.streamingRadioStation != -1) {
|
||||||
@@ -281,16 +301,16 @@ function enterExitPropertyCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function loadGameFixesResource() {
|
function loadGameFixesResource() {
|
||||||
switch(getServerGame()) {
|
//switch(getServerGame()) {
|
||||||
case GAME_GTA_III:
|
// case GAME_GTA_III:
|
||||||
if(findResourceByName("asshat-gta3") != null) {
|
// if(findResourceByName("asshat-gta3") != null) {
|
||||||
findResourceByName("asshat-gta3").start();
|
// findResourceByName("asshat-gta3").start();
|
||||||
}
|
// }
|
||||||
break;
|
// break;
|
||||||
|
//
|
||||||
default:
|
// default:
|
||||||
break;
|
// break;
|
||||||
}
|
//}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,8 +381,10 @@ function showPlayerPrompt(client, promptType, promptMessage, promptTitle) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateServerGameTime() {
|
function updateServerGameTime() {
|
||||||
gta.time.hour = getServerConfig().hour;
|
if(isTimeSupported()) {
|
||||||
gta.time.minute = getServerConfig().minute;
|
gta.time.hour = getServerConfig().hour;
|
||||||
|
gta.time.minute = getServerConfig().minute;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -904,9 +904,9 @@ function getAllVehiclesOwnedByPlayerCommand(command, params, client) {
|
|||||||
|
|
||||||
let vehicles = getAllVehiclesOwnedByPlayer(targetClient);
|
let vehicles = getAllVehiclesOwnedByPlayer(targetClient);
|
||||||
|
|
||||||
messageClientInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Player Houses ${getInlineChatColourByType("clanOrange")}==========================`);
|
messagePlayerInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Player Vehicles ${getInlineChatColourByType("clanOrange")}==========================`);
|
||||||
for(let i in vehicles) {
|
for(let i in vehicles) {
|
||||||
messagePlayerNormal(client, `🚗 ${getInlineChatColourByType("vehiclePurple")}[Vehicle Info] ${getInlineChatColourByName("white")}ID: ${getInlineChatColourByName("lightGrey")}${vehicles[i].vehicle.id}, ${getInlineChatColourByName("white")}DatabaseID: ${getInlineChatColourByName("lightGrey")}${vehicles[i].databaseId}, ${getInlineChatColourByName("white")}Type: ${getInlineChatColourByName("lightGrey")}${getVehicleName(vehicles[i].vehicle)}[${vehicles[i].model}], ${getInlineChatColourByName("white")}BuyPrice: ${getInlineChatColourByName("lightGrey")}${vehicles[i].buyPrice}, ${getInlineChatColourByName("white")}RentPrice: ${getInlineChatColourByName("lightGrey")}${vehicles[i].rentPrice}, ${getInlineChatColourByName("white")}Locked: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(vehicles[i].locked)}, ${getInlineChatColourByName("white")}Engine: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(vehicles[i].engine)}`);
|
messagePlayerNormal(client, `🚗 ${getInlineChatColourByType("vehiclePurple")}[Vehicle Info] ${getInlineChatColourByName("white")}ID: ${getInlineChatColourByName("lightGrey")}${vehicles[i].index}, ${getInlineChatColourByName("white")}DatabaseID: ${getInlineChatColourByName("lightGrey")}${vehicles[i].databaseId}, ${getInlineChatColourByName("white")}Type: ${getInlineChatColourByName("lightGrey")}${getVehicleName(vehicles[i].vehicle)}[${vehicles[i].model}], ${getInlineChatColourByName("white")}BuyPrice: ${getInlineChatColourByName("lightGrey")}${vehicles[i].buyPrice}, ${getInlineChatColourByName("white")}RentPrice: ${getInlineChatColourByName("lightGrey")}${vehicles[i].rentPrice}, ${getInlineChatColourByName("white")}Locked: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(vehicles[i].locked)}, ${getInlineChatColourByName("white")}Engine: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(vehicles[i].engine)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -927,7 +927,7 @@ function getAllBusinessesOwnedByPlayerCommand(command, params, client) {
|
|||||||
|
|
||||||
let businesses = getAllBusinessesOwnedByPlayer(targetClient);
|
let businesses = getAllBusinessesOwnedByPlayer(targetClient);
|
||||||
|
|
||||||
messageClientInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Player Businesses ${getInlineChatColourByType("clanOrange")}========================`);
|
messagePlayerInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Player Businesses ${getInlineChatColourByType("clanOrange")}========================`);
|
||||||
for(let i in businesses) {
|
for(let i in businesses) {
|
||||||
messagePlayerNormal(client, `🏢 ${getInlineChatColourByType("businessBlue")}[Business Info] ${getInlineChatColourByName("white")}Name: ${getInlineChatColourByName("lightGrey")}${businesses[i].name}, ${getInlineChatColourByName("white")}Locked: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(intToBool(businesses[i].locked))}, ${getInlineChatColourByName("white")}ID: ${getInlineChatColourByName("lightGrey")}${businesses[i].index}/${businesses[i].databaseId}`);
|
messagePlayerNormal(client, `🏢 ${getInlineChatColourByType("businessBlue")}[Business Info] ${getInlineChatColourByName("white")}Name: ${getInlineChatColourByName("lightGrey")}${businesses[i].name}, ${getInlineChatColourByName("white")}Locked: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(intToBool(businesses[i].locked))}, ${getInlineChatColourByName("white")}ID: ${getInlineChatColourByName("lightGrey")}${businesses[i].index}/${businesses[i].databaseId}`);
|
||||||
}
|
}
|
||||||
@@ -950,7 +950,7 @@ function getAllHousesOwnedByPlayerCommand(command, params, client) {
|
|||||||
|
|
||||||
let houses = getAllHousesOwnedByPlayer(targetClient);
|
let houses = getAllHousesOwnedByPlayer(targetClient);
|
||||||
|
|
||||||
messageClientInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Player Houses ${getInlineChatColourByType("clanOrange")}============================`);
|
messagePlayerInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Player Houses ${getInlineChatColourByType("clanOrange")}============================`);
|
||||||
for(let i in houses) {
|
for(let i in houses) {
|
||||||
messagePlayerNormal(client, `🏠 ${getInlineChatColourByType("houseGreen")}[House Info] ${getInlineChatColourByName("white")}Description: ${getInlineChatColourByName("lightGrey")}${houses[i].description}, ${getInlineChatColourByName("white")}Locked: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(intToBool(houses[i].locked))}, ${getInlineChatColourByName("white")}ID: ${getInlineChatColourByName("lightGrey")}${houses[i].index}/${houses[i].databaseId}`);
|
messagePlayerNormal(client, `🏠 ${getInlineChatColourByType("houseGreen")}[House Info] ${getInlineChatColourByName("white")}Description: ${getInlineChatColourByName("lightGrey")}${houses[i].description}, ${getInlineChatColourByName("white")}Locked: ${getInlineChatColourByName("lightGrey")}${getYesNoFromBool(intToBool(houses[i].locked))}, ${getInlineChatColourByName("white")}ID: ${getInlineChatColourByName("lightGrey")}${houses[i].index}/${houses[i].databaseId}`);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -723,6 +723,9 @@ let gameData = {
|
|||||||
"UfoPanak",
|
"UfoPanak",
|
||||||
"invisible"
|
"invisible"
|
||||||
],
|
],
|
||||||
|
],
|
||||||
|
objectModels: [
|
||||||
|
|
||||||
],
|
],
|
||||||
weaponModels: [
|
weaponModels: [
|
||||||
[],
|
[],
|
||||||
@@ -775,7 +778,244 @@ let gameData = {
|
|||||||
meleeWeapons: [
|
meleeWeapons: [
|
||||||
[],
|
[],
|
||||||
[2, 3, 4],
|
[2, 3, 4],
|
||||||
]
|
],
|
||||||
|
excludedGroundSnowModels: [
|
||||||
|
false,
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
],
|
||||||
|
pickupModels: [
|
||||||
|
{},
|
||||||
|
|
||||||
|
{ // GTA 3
|
||||||
|
policeStation: 1361,
|
||||||
|
fireStation: 1361,
|
||||||
|
hospital: 1361,
|
||||||
|
ammunation: 1361,
|
||||||
|
payAndSpray: 1361,
|
||||||
|
vehicleDealership: 1361,
|
||||||
|
restaurant: 1361,
|
||||||
|
fastFood: 1361,
|
||||||
|
bank: 1323,
|
||||||
|
fuelStation: 1361,
|
||||||
|
business: 1361,
|
||||||
|
house: 1361,
|
||||||
|
clothes: 1361,
|
||||||
|
misc: 1361,
|
||||||
|
exit: 1361
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // GTA Vice City
|
||||||
|
policeStation: 375,
|
||||||
|
fireStation: 406,
|
||||||
|
hospital: 366,
|
||||||
|
ammunation: 406,
|
||||||
|
payAndSpray: 406,
|
||||||
|
vehicleDealership: 406,
|
||||||
|
restaurant: 406,
|
||||||
|
fastFood: 406,
|
||||||
|
bank: 408,
|
||||||
|
fuelStation: 406,
|
||||||
|
business: 406,
|
||||||
|
house: 407,
|
||||||
|
clothes: 409,
|
||||||
|
misc: 406,
|
||||||
|
exit: 406,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // GTA San Andreas
|
||||||
|
policeStation: 1247,
|
||||||
|
fireStation: 1318,
|
||||||
|
hospital: 1240,
|
||||||
|
ammunation: 1239,
|
||||||
|
payAndSpray: 1239,
|
||||||
|
vehicleDealership: 1239,
|
||||||
|
restaurant: 1239,
|
||||||
|
fastFood: 1239,
|
||||||
|
bank: 1274,
|
||||||
|
fuelStation: 1239,
|
||||||
|
business: 1272,
|
||||||
|
house: 1273,
|
||||||
|
clothes: 1275,
|
||||||
|
misc: 1239,
|
||||||
|
exit: 1318,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
pickupTypes: [
|
||||||
|
{},
|
||||||
|
|
||||||
|
{ // GTA 3
|
||||||
|
business: 255,
|
||||||
|
house: 255,
|
||||||
|
bank: 255,
|
||||||
|
clothes: 255,
|
||||||
|
info: 255,
|
||||||
|
job: 255,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // GTA Vice City
|
||||||
|
business: 2,
|
||||||
|
house: 2,
|
||||||
|
bank: 2,
|
||||||
|
clothes: 2,
|
||||||
|
info: 2,
|
||||||
|
job: 2,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // GTA San Andreas
|
||||||
|
business: 1,
|
||||||
|
house: 1,
|
||||||
|
bank: 1,
|
||||||
|
clothes: 1,
|
||||||
|
info: 1,
|
||||||
|
job: 1,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
// THIS IS SCREEN HEIGHT, NOT ACTUAL DOOR POSITION IN THE WORLD
|
||||||
|
propertyLabelHeight: [
|
||||||
|
false,
|
||||||
|
85,
|
||||||
|
85,
|
||||||
|
85,
|
||||||
|
85,
|
||||||
|
85,
|
||||||
|
85,
|
||||||
|
],
|
||||||
|
|
||||||
|
removedWorldObjects: [
|
||||||
|
false,
|
||||||
|
|
||||||
|
[ // Mafia 1
|
||||||
|
//new serverClasses.removedWorldObjectData("fraightback04", toVector3(1229.88, -84.8012, 13.4004), 50.0), // Truck trailer in Easy Credit Autos dealership parking lot
|
||||||
|
],
|
||||||
|
|
||||||
|
[ // Mafia 2
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
[ // Mafia 3
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
[ // Mafia Definitive Edition
|
||||||
|
|
||||||
|
],
|
||||||
|
],
|
||||||
|
defaultBusinessItems:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
clothingStore: [
|
||||||
|
["Outfit", 500, 2]
|
||||||
|
],
|
||||||
|
legalGunStore: [
|
||||||
|
["Colt 45", 500, 2],
|
||||||
|
["Shotgun", 500, 2],
|
||||||
|
["Baseball Bat", 500, 2]
|
||||||
|
],
|
||||||
|
illegalGunStore: [
|
||||||
|
["Uzi", 500, 2],
|
||||||
|
["AK-47", 500, 2],
|
||||||
|
["M16", 500, 2],
|
||||||
|
["Sniper Rifle", 500, 2]
|
||||||
|
],
|
||||||
|
gasStation: [
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
["Can of Soda", 500, 2],
|
||||||
|
["Slice of Pizza", 500, 2],
|
||||||
|
["Bottle of Water", 500, 2],
|
||||||
|
["Can of Beer", 500, 2],
|
||||||
|
],
|
||||||
|
electronicsStore: [
|
||||||
|
["Phone", 500, 2],
|
||||||
|
["Walkie Talkie", 500, 2],
|
||||||
|
["Megaphone", 500, 2],
|
||||||
|
["Tazer", 500, 2],
|
||||||
|
["Camera", 500, 2],
|
||||||
|
],
|
||||||
|
bar: [
|
||||||
|
["Bottle of Vodka", 500, 2],
|
||||||
|
["Bottle of Whiskey", 500, 2],
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
["Bottle of Wine", 500, 2],
|
||||||
|
["Bottle of Bourbon", 500, 2],
|
||||||
|
["Shot of Bourbon", 500, 2],
|
||||||
|
["Shot of Vodka", 500, 2],
|
||||||
|
["Shot of Whiskey", 500, 2],
|
||||||
|
["Glass of Wine", 500, 2],
|
||||||
|
],
|
||||||
|
club: [
|
||||||
|
["Bottle of Vodka", 500, 2],
|
||||||
|
["Bottle of Whiskey", 500, 2],
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
["Bottle of Wine", 500, 2],
|
||||||
|
["Bottle of Bourbon", 500, 2],
|
||||||
|
["Shot of Bourbon", 500, 2],
|
||||||
|
["Shot of Vodka", 500, 2],
|
||||||
|
["Shot of Whiskey", 500, 2],
|
||||||
|
["Glass of Wine", 500, 2],
|
||||||
|
],
|
||||||
|
chicken: [
|
||||||
|
["Bucket of Chicken", 500, 2],
|
||||||
|
["Chicken Tenders Meal", 500, 2],
|
||||||
|
["Large Fries", 500, 2],
|
||||||
|
["Small Fries", 500, 2],
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
],
|
||||||
|
burger: [
|
||||||
|
["Bacon Cheeseburger", 500, 2],
|
||||||
|
["Double Cheeseburger", 500, 2],
|
||||||
|
["Big Boy Burger", 500, 2],
|
||||||
|
["Large Fries", 500, 2],
|
||||||
|
["Small Fries", 500, 2],
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
],
|
||||||
|
chinese: [
|
||||||
|
["Egg Roll", 500, 2],
|
||||||
|
["Lo Mein", 500, 2],
|
||||||
|
["Fried Rice", 500, 2],
|
||||||
|
["Crab Rangoon", 500, 2],
|
||||||
|
["Egg Drop Soup", 500, 2],
|
||||||
|
["Moo Shu Pork", 500, 2],
|
||||||
|
["Egg Foo Young", 500, 2],
|
||||||
|
["Sesame Chicken", 500, 2],
|
||||||
|
],
|
||||||
|
italian: [
|
||||||
|
["Bottle of Wine", 500, 2],
|
||||||
|
["Glass of Wine", 500, 2],
|
||||||
|
["Arancini", 500, 2],
|
||||||
|
["Lasagne", 500, 2],
|
||||||
|
["Chicken Alfredo", 500, 2],
|
||||||
|
["Fettucine Alfredo", 500, 2],
|
||||||
|
["Chicken Parmigiana", 500, 2],
|
||||||
|
["Chicken Carbonara", 500, 2],
|
||||||
|
["Sausage Rigatoni", 500, 2],
|
||||||
|
["Chicken Salad", 500, 2],
|
||||||
|
["Caesar Salad", 500, 2],
|
||||||
|
],
|
||||||
|
mexican: [
|
||||||
|
["Crunchy Taco", 500, 2],
|
||||||
|
["Beaf and Bean Burrito", 500, 2],
|
||||||
|
["Burrito Supreme", 500, 2],
|
||||||
|
["Cheesy Nachos", 500, 2],
|
||||||
|
["Nacho Supreme", 500, 2],
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
],
|
||||||
|
pizza: [
|
||||||
|
["Large Pizza", 500, 2],
|
||||||
|
["Medium Pizza", 500, 2],
|
||||||
|
["Small Pizza", 500, 2],
|
||||||
|
["Buffalo Wings", 500, 2],
|
||||||
|
["Hot Wings", 500, 2],
|
||||||
|
["Bottle of Soda", 500, 2],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1176,7 +1416,7 @@ function getPlayerLastVehicle(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isVehicleObject(vehicle) {
|
function isVehicleObject(vehicle) {
|
||||||
return (vehicle instanceof Vehicle);
|
return (vehicle.type == ELEMENT_VEHICLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -89,77 +89,81 @@ function saveSubAccountToDatabase(subAccountData) {
|
|||||||
let safeLastName = escapeDatabaseString(dbConnection, subAccountData.lastName);
|
let safeLastName = escapeDatabaseString(dbConnection, subAccountData.lastName);
|
||||||
let safeMiddleName = escapeDatabaseString(dbConnection, subAccountData.middleName);
|
let safeMiddleName = escapeDatabaseString(dbConnection, subAccountData.middleName);
|
||||||
|
|
||||||
let dbQueryString = `
|
let data = [
|
||||||
UPDATE sacct_main SET
|
//["sacct_svr", getServerId()],
|
||||||
sacct_name_first='${safeFirstName}',
|
["sacct_acct", subAccountData.account],
|
||||||
sacct_name_last='${safeLastName}',
|
["sacct_name_first", safeFirstName],
|
||||||
sacct_name_middle='${safeMiddleName}',
|
["sacct_name_last", safeLastName],
|
||||||
sacct_cash=${subAccountData.cash},
|
["sacct_name_middle", safeMiddleName],
|
||||||
sacct_when_lastlogin=${subAccountData.lastLogin},
|
["sacct_cash", subAccountData.cash],
|
||||||
sacct_pos_x=${subAccountData.spawnPosition.x},
|
["sacct_when_lastlogin", subAccountData.lastLogin],
|
||||||
sacct_pos_y=${subAccountData.spawnPosition.y},
|
["sacct_pos_x", subAccountData.spawnPosition.x],
|
||||||
sacct_pos_z=${subAccountData.spawnPosition.z},
|
["sacct_pos_y", subAccountData.spawnPosition.x],
|
||||||
sacct_angle=${subAccountData.spawnHeading},
|
["sacct_pos_z", subAccountData.spawnPosition.z],
|
||||||
sacct_int=${subAccountData.interior},
|
["sacct_rot_z", subAccountData.spawnHeading],
|
||||||
sacct_vw=${subAccountData.dimension},
|
["sacct_int", subAccountData.interior],
|
||||||
sacct_inhouse=${(subAccountData.inHouse != 0) ? getHouseData(subAccountData.inHouse).databaseId : 0},
|
["sacct_vw", subAccountData.dimension],
|
||||||
sacct_inbusiness=${(subAccountData.inBusiness != 0) ? getBusinessData(subAccountData.inBusiness).databaseId : 0},
|
["sacct_inhouse", (subAccountData.inHouse != 0) ? getHouseData(subAccountData.inHouse).databaseId : 0],
|
||||||
sacct_health=${subAccountData.health},
|
["sacct_inbusiness", (subAccountData.inBusiness != 0) ? getBusinessData(subAccountData.inBusiness).databaseId : 0],
|
||||||
sacct_armour=${subAccountData.armour}
|
["sacct_health", subAccountData.health],
|
||||||
WHERE sacct_id=${subAccountData.databaseId}`;
|
["sacct_armour", subAccountData.armour],
|
||||||
|
];
|
||||||
|
|
||||||
//dbQueryString = dbQueryString.trim();
|
let dbQuery = null;
|
||||||
dbQueryString = dbQueryString.replace(/(?:\r\n|\r|\n|\t)/g, "");
|
let queryString = createDatabaseUpdateQuery("sacct_main", data, `sacct_id=${subAccountData.databaseId}`);
|
||||||
let dbQuery = queryDatabase(dbConnection, dbQueryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
|
|
||||||
|
let data2 = [
|
||||||
|
//["sacct_svr_svr", getServerId()],
|
||||||
|
["sacct_svr_sacct", subAccountData.databaseId],
|
||||||
|
["sacct_svr_job", subAccountData.job],
|
||||||
|
//["sacct_svr_job_rank", getServerId()],
|
||||||
|
["sacct_svr_clan", subAccountData.clan],
|
||||||
|
["sacct_svr_clan_rank", subAccountData.clanRank],
|
||||||
|
["sacct_svr_clan_tag", safeClanTag],
|
||||||
|
["sacct_svr_clan_title", safeClanTitle],
|
||||||
|
["sacct_svr_clan_flags", subAccountData.clanFlags],
|
||||||
|
["sacct_svr_scale_x", subAccountData.pedScale.x],
|
||||||
|
["sacct_svr_scale_y", subAccountData.pedScale.y],
|
||||||
|
["sacct_svr_scale_z", subAccountData.pedScale.z],
|
||||||
|
["sacct_svr_skin", subAccountData.skin],
|
||||||
|
["sacct_svr_fightstyle", subAccountData.fightStyle],
|
||||||
|
["sacct_svr_walkstyle", subAccountData.walkStyle],
|
||||||
|
["sacct_svr_hd_part_hair_model", subAccountData.bodyParts.hair[0]],
|
||||||
|
["sacct_svr_hd_part_hair_texture", subAccountData.bodyParts.hair[1]],
|
||||||
|
["sacct_svr_hd_part_head_model", subAccountData.bodyParts.head[0]],
|
||||||
|
["sacct_svr_hd_part_head_texture", subAccountData.bodyParts.head[1]],
|
||||||
|
["sacct_svr_hd_part_upper_model", subAccountData.bodyParts.upper[0]],
|
||||||
|
["sacct_svr_hd_part_upper_texture", subAccountData.bodyParts.upper[1]],
|
||||||
|
["sacct_svr_hd_part_lower_model", subAccountData.bodyParts.lower[0]],
|
||||||
|
["sacct_svr_hd_part_lower_texture", subAccountData.bodyParts.lower[1]],
|
||||||
|
["sacct_svr_hd_prop_hair_model", subAccountData.bodyProps.hair[0]],
|
||||||
|
["sacct_svr_hd_prop_hair_texture", subAccountData.bodyProps.hair[1]],
|
||||||
|
["sacct_svr_hd_prop_eyes_model", subAccountData.bodyProps.eyes[0]],
|
||||||
|
["sacct_svr_hd_prop_eyes_texture", subAccountData.bodyProps.eyes[1]],
|
||||||
|
["sacct_svr_hd_prop_head_model", subAccountData.bodyProps.head[0]],
|
||||||
|
["sacct_svr_hd_prop_head_texture", subAccountData.bodyProps.head[1]],
|
||||||
|
["sacct_svr_hd_prop_lefthand_model", subAccountData.bodyProps.leftHand[0]],
|
||||||
|
["sacct_svr_hd_prop_lefthand_texture", subAccountData.bodyProps.leftHand[1]],
|
||||||
|
["sacct_svr_hd_prop_righthand_model", subAccountData.bodyProps.rightHand[0]],
|
||||||
|
["sacct_svr_hd_prop_righthand_texture", subAccountData.bodyProps.rightHand[1]],
|
||||||
|
["sacct_svr_hd_prop_leftwrist_model", subAccountData.bodyProps.leftWrist[0]],
|
||||||
|
["sacct_svr_hd_prop_leftwrist_texture", subAccountData.bodyProps.leftWrist[1]],
|
||||||
|
["sacct_svr_hd_prop_rightwrist_model", subAccountData.bodyProps.rightWrist[0]],
|
||||||
|
["sacct_svr_hd_prop_rightwrist_texture", subAccountData.bodyProps.rightWrist[1]],
|
||||||
|
["sacct_svr_hd_prop_hip_model", subAccountData.bodyProps.hip[0]],
|
||||||
|
["sacct_svr_hd_prop_hip_texture",subAccountData.bodyProps.hip[1]],
|
||||||
|
["sacct_svr_hd_prop_leftfoot_model", subAccountData.bodyProps.leftFoot[0]],
|
||||||
|
["sacct_svr_hd_prop_leftfoot_texture", subAccountData.bodyProps.leftFoot[1]],
|
||||||
|
["sacct_svr_hd_prop_rightfoot_model", subAccountData.bodyProps.rightFoot[0]],
|
||||||
|
["sacct_svr_hd_prop_rightfoot_texture", subAccountData.bodyProps.rightFoot[1]],
|
||||||
|
];
|
||||||
|
|
||||||
dbQuery = null;
|
dbQuery = null;
|
||||||
|
queryString = "";
|
||||||
dbQueryString = `
|
queryString = createDatabaseUpdateQuery("sacct_svr", data2, `sacct_svr_sacct=${subAccountData.databaseId} AND sacct_svr_server = ${getServerId()}`);
|
||||||
UPDATE sacct_svr SET
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
sacct_svr_job=${subAccountData.job},
|
|
||||||
sacct_svr_clan=${subAccountData.clan},
|
|
||||||
sacct_svr_clan_rank=${subAccountData.clanRank},
|
|
||||||
sacct_svr_clan_tag='${safeClanTag}',
|
|
||||||
sacct_svr_clan_title='${safeClanTitle}',
|
|
||||||
sacct_svr_clan_flags=${subAccountData.clanFlags},
|
|
||||||
sacct_svr_scale_x=${subAccountData.pedScale.x},
|
|
||||||
sacct_svr_scale_y=${subAccountData.pedScale.y},
|
|
||||||
sacct_svr_scale_z=${subAccountData.pedScale.z},
|
|
||||||
sacct_svr_skin=${subAccountData.skin},
|
|
||||||
sacct_svr_fightstyle=${subAccountData.fightStyle},
|
|
||||||
sacct_svr_walkstyle=${subAccountData.walkStyle},
|
|
||||||
sacct_svr_hd_part_hair_model=${subAccountData.bodyParts.hair[0]},
|
|
||||||
sacct_svr_hd_part_hair_texture=${subAccountData.bodyParts.hair[1]},
|
|
||||||
sacct_svr_hd_part_head_model=${subAccountData.bodyParts.head[0]},
|
|
||||||
sacct_svr_hd_part_head_texture=${subAccountData.bodyParts.head[1]},
|
|
||||||
sacct_svr_hd_part_upper_model=${subAccountData.bodyParts.upper[0]},
|
|
||||||
sacct_svr_hd_part_upper_texture=${subAccountData.bodyParts.upper[1]},
|
|
||||||
sacct_svr_hd_part_lower_model=${subAccountData.bodyParts.lower[0]},
|
|
||||||
sacct_svr_hd_part_lower_texture=${subAccountData.bodyParts.lower[1]},
|
|
||||||
sacct_svr_hd_prop_hair_model=${subAccountData.bodyProps.hair[0]},
|
|
||||||
sacct_svr_hd_prop_hair_texture=${subAccountData.bodyProps.hair[1]},
|
|
||||||
sacct_svr_hd_prop_eyes_model=${subAccountData.bodyProps.eyes[0]},
|
|
||||||
sacct_svr_hd_prop_eyes_texture=${subAccountData.bodyProps.eyes[1]},
|
|
||||||
sacct_svr_hd_prop_head_model=${subAccountData.bodyProps.head[0]},
|
|
||||||
sacct_svr_hd_prop_head_texture=${subAccountData.bodyProps.head[1]},
|
|
||||||
sacct_svr_hd_prop_lefthand_model=${subAccountData.bodyProps.leftHand[0]},
|
|
||||||
sacct_svr_hd_prop_lefthand_texture=${subAccountData.bodyProps.leftHand[1]},
|
|
||||||
sacct_svr_hd_prop_righthand_model=${subAccountData.bodyProps.rightHand[0]},
|
|
||||||
sacct_svr_hd_prop_righthand_texture=${subAccountData.bodyProps.rightHand[1]},
|
|
||||||
sacct_svr_hd_prop_leftwrist_model=${subAccountData.bodyProps.leftWrist[0]},
|
|
||||||
sacct_svr_hd_prop_leftwrist_texture=${subAccountData.bodyProps.leftWrist[1]},
|
|
||||||
sacct_svr_hd_prop_rightwrist_model=${subAccountData.bodyProps.rightWrist[0]},
|
|
||||||
sacct_svr_hd_prop_rightwrist_texture=${subAccountData.bodyProps.rightWrist[1]},
|
|
||||||
sacct_svr_hd_prop_hip_model=${subAccountData.bodyProps.hip[0]},
|
|
||||||
sacct_svr_hd_prop_hip_texture=${subAccountData.bodyProps.hip[1]},
|
|
||||||
sacct_svr_hd_prop_leftfoot_model=${subAccountData.bodyProps.leftFoot[0]},
|
|
||||||
sacct_svr_hd_prop_leftfoot_texture=${subAccountData.bodyProps.leftFoot[1]},
|
|
||||||
sacct_svr_hd_prop_rightfoot_model=${subAccountData.bodyProps.rightFoot[0]},
|
|
||||||
sacct_svr_hd_prop_rightfoot_texture=${subAccountData.bodyProps.rightFoot[1]}
|
|
||||||
WHERE sacct_svr_sacct=${subAccountData.databaseId} AND sacct_svr_server = ${getServerId()}`;
|
|
||||||
|
|
||||||
dbQueryString = dbQueryString.replace(/(?:\r\n|\r|\n|\t)/g, "");
|
|
||||||
dbQuery = queryDatabase(dbConnection, dbQueryString);
|
|
||||||
freeDatabaseQuery(dbQuery);
|
freeDatabaseQuery(dbQuery);
|
||||||
|
|
||||||
disconnectFromDatabase(dbConnection);
|
disconnectFromDatabase(dbConnection);
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ let serverTimers = {};
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function updateTimeRule() {
|
function updateTimeRule() {
|
||||||
server.setRule("Time", makeReadableTime(gta.time.hour, gta.time.minute));
|
if(isTimeSupported()) {
|
||||||
|
server.setRule("Time", makeReadableTime(gta.time.hour, gta.time.minute));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -918,7 +918,7 @@ function getSkinIdFromName(params, gameId = getServerGame()) {
|
|||||||
function getClosestHospital(position) {
|
function getClosestHospital(position) {
|
||||||
let closest = 0;
|
let closest = 0;
|
||||||
for(let i in getGameData().hospitals[getServerGame()]) {
|
for(let i in getGameData().hospitals[getServerGame()]) {
|
||||||
if(getDistance(getGameData().hospitals[getServerGame()][i], position) < getDistance(getGameData().hospitals[getServerGame()][closest], position)) {
|
if(getDistance(getGameData().hospitals[getServerGame()][i].position, position) < getDistance(getGameData().hospitals[getServerGame()][closest].position, position)) {
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -931,7 +931,7 @@ function getClosestHospital(position) {
|
|||||||
function getClosestPoliceStation(position) {
|
function getClosestPoliceStation(position) {
|
||||||
let closest = 0;
|
let closest = 0;
|
||||||
for(let i in getGameData().policeStations[getServerGame()]) {
|
for(let i in getGameData().policeStations[getServerGame()]) {
|
||||||
if(getGameData().policeStations[getServerGame()][i].distance(position) < getGameData().policeStations[getServerGame()][closest]) {
|
if(getDistance(getGameData().policeStations[getServerGame()][i].position, position) < getDistance(getGameData().policeStations[getServerGame()][closest].position, position)) {
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1119,8 +1119,13 @@ function checkPlayerPedStates() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showConnectCameraToPlayer(client) {
|
function showConnectCameraToPlayer(client) {
|
||||||
fadeCamera(client, true, 1);
|
if(isFadeCameraSupported()) {
|
||||||
setPlayerCameraLookAt(client, getServerConfig().connectCameraPosition, getServerConfig().connectCameraLookAt);
|
fadeCamera(client, true, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isCustomCameraSupported()) {
|
||||||
|
setPlayerCameraLookAt(client, getServerConfig().connectCameraPosition, getServerConfig().connectCameraLookAt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1515,19 +1520,19 @@ function splitArrayIntoChunks(originalArray, perChunk) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllVehiclesOwnedByPlayer(client) {
|
function getAllVehiclesOwnedByPlayer(client) {
|
||||||
return getServerData().vehicles.filter(v => v.ownerType == VRR_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client));
|
return getServerData().vehicles.filter((v) => v.ownerType == VRR_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllBusinessesOwnedByPlayer(client) {
|
function getAllBusinessesOwnedByPlayer(client) {
|
||||||
return getServerData().businesses.filter(v => v.ownerType == VRR_BIZOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client));
|
return getServerData().businesses.filter((b) => b.ownerType == VRR_BIZOWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getAllHousesOwnedByPlayer(client) {
|
function getAllHousesOwnedByPlayer(client) {
|
||||||
return getServerData().houses.filter(v => v.ownerType == VRR_HOUSEOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client));
|
return getServerData().houses.filter((h) => h.ownerType == VRR_HOUSEOWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -11,6 +11,7 @@ function initVehicleScript() {
|
|||||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Initializing vehicle script ...");
|
logToConsole(LOG_INFO, "[VRR.Vehicle]: Initializing vehicle script ...");
|
||||||
getServerData().vehicles = loadVehiclesFromDatabase();
|
getServerData().vehicles = loadVehiclesFromDatabase();
|
||||||
spawnAllVehicles();
|
spawnAllVehicles();
|
||||||
|
setAllVehicleIndexes();
|
||||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Vehicle script initialized successfully!");
|
logToConsole(LOG_INFO, "[VRR.Vehicle]: Vehicle script initialized successfully!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -46,7 +47,7 @@ function saveAllVehiclesToDatabase() {
|
|||||||
let vehicles = getServerData().vehicles;
|
let vehicles = getServerData().vehicles;
|
||||||
for(let i in vehicles) {
|
for(let i in vehicles) {
|
||||||
if(vehicles[i].needsSaved) {
|
if(vehicles[i].needsSaved) {
|
||||||
saveVehicleToDatabase(vehicles[i]);
|
saveVehicleToDatabase(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Saved all vehicles to database!");
|
logToConsole(LOG_INFO, "[VRR.Vehicle]: Saved all vehicles to database!");
|
||||||
@@ -87,10 +88,10 @@ function saveVehicleToDatabase(vehicleDataId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let colour1RGBA = rgbaArrayFromToColour(vehicleData.colour1RGBA);
|
let colour1RGBA = rgbaArrayFromToColour(tempVehicleData.colour1RGBA);
|
||||||
let colour2RGBA = rgbaArrayFromToColour(vehicleData.colour2RGBA);
|
let colour2RGBA = rgbaArrayFromToColour(tempVehicleData.colour2RGBA);
|
||||||
let colour3RGBA = rgbaArrayFromToColour(vehicleData.colour3RGBA);
|
let colour3RGBA = rgbaArrayFromToColour(tempVehicleData.colour3RGBA);
|
||||||
let colour4RGBA = rgbaArrayFromToColour(vehicleData.colour4RGBA);
|
let colour4RGBA = rgbaArrayFromToColour(tempVehicleData.colour4RGBA);
|
||||||
|
|
||||||
let data = [
|
let data = [
|
||||||
["veh_server", getServerId()],
|
["veh_server", getServerId()],
|
||||||
@@ -102,17 +103,17 @@ function saveVehicleToDatabase(vehicleDataId) {
|
|||||||
["veh_buy_price", boolToInt(tempVehicleData.buyPrice)],
|
["veh_buy_price", boolToInt(tempVehicleData.buyPrice)],
|
||||||
["veh_rent_price", boolToInt(tempVehicleData.rentPrice)],
|
["veh_rent_price", boolToInt(tempVehicleData.rentPrice)],
|
||||||
["veh_pos_x", tempVehicleData.spawnPosition.x],
|
["veh_pos_x", tempVehicleData.spawnPosition.x],
|
||||||
["veh_pos_y", tempVehicleData.spawnPosition.x],
|
["veh_pos_y", tempVehicleData.spawnPosition.y],
|
||||||
["veh_pos_z", tempVehicleData.spawnPosition.z],
|
["veh_pos_z", tempVehicleData.spawnPosition.z],
|
||||||
["veh_rot_z", tempVehicleData.spawnRotation],
|
["veh_rot_z", tempVehicleData.spawnRotation],
|
||||||
["veh_col1", tempVehicleData.spawnRotation],
|
["veh_col1", tempVehicleData.spawnRotation],
|
||||||
["veh_col2", tempVehicleData.spawnRotation],
|
["veh_col2", tempVehicleData.spawnRotation],
|
||||||
["veh_col3", tempVehicleData.spawnRotation],
|
["veh_col3", tempVehicleData.spawnRotation],
|
||||||
["veh_col4", tempVehicleData.spawnRotation],
|
["veh_col4", tempVehicleData.spawnRotation],
|
||||||
["veh_col1_isrgba", tempVehicleData.colour1IsRGBA],
|
["veh_col1_isrgb", tempVehicleData.colour1IsRGBA],
|
||||||
["veh_col2_isrgba", tempVehicleData.colour1IsRGBA],
|
["veh_col2_isrgb", tempVehicleData.colour1IsRGBA],
|
||||||
["veh_col3_isrgba", tempVehicleData.colour1IsRGBA],
|
["veh_col3_isrgb", tempVehicleData.colour1IsRGBA],
|
||||||
["veh_col4_isrgba", tempVehicleData.colour1IsRGBA],
|
["veh_col4_isrgb", tempVehicleData.colour1IsRGBA],
|
||||||
["veh_col1_r", colour1RGBA[0]],
|
["veh_col1_r", colour1RGBA[0]],
|
||||||
["veh_col1_g", colour1RGBA[1]],
|
["veh_col1_g", colour1RGBA[1]],
|
||||||
["veh_col1_b", colour1RGBA[2]],
|
["veh_col1_b", colour1RGBA[2]],
|
||||||
@@ -158,7 +159,7 @@ function saveVehicleToDatabase(vehicleDataId) {
|
|||||||
getServerData().vehicles[vehicleDataId].databaseId = getDatabaseInsertId(dbConnection);
|
getServerData().vehicles[vehicleDataId].databaseId = getDatabaseInsertId(dbConnection);
|
||||||
getServerData().vehicles[vehicleDataId].needsSaved = false;
|
getServerData().vehicles[vehicleDataId].needsSaved = false;
|
||||||
} else {
|
} else {
|
||||||
let queryString = createDatabaseUpdateQuery("veh_main", data, `WHERE veh_id=${tempVehicleData.databaseId}`);
|
let queryString = createDatabaseUpdateQuery("veh_main", data, `veh_id=${tempVehicleData.databaseId}`);
|
||||||
dbQuery = queryDatabase(dbConnection, queryString);
|
dbQuery = queryDatabase(dbConnection, queryString);
|
||||||
getServerData().vehicles[vehicleDataId].needsSaved = false;
|
getServerData().vehicles[vehicleDataId].needsSaved = false;
|
||||||
}
|
}
|
||||||
@@ -1284,4 +1285,12 @@ function resetVehiclePosition(vehicle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setAllVehicleIndexes() {
|
||||||
|
for(let i in getServerData().vehicles) {
|
||||||
|
getServerData().vehicles[i].index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1057,4 +1057,22 @@ function areBlipsSupported() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isFadeCameraSupported() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isCustomCameraSupported() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function areWorldLabelsSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -367,4 +367,22 @@ function areBlipsSupported() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isFadeCameraSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isCustomCameraSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function areWorldLabelsSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
112
third-party/mexui/Core/Utility.js
vendored
112
third-party/mexui/Core/Utility.js
vendored
@@ -15,7 +15,7 @@ mexui.util.isPointInRectangle = function(point, position, size)
|
|||||||
{
|
{
|
||||||
if(!point)
|
if(!point)
|
||||||
return false; // temp bug fix
|
return false; // temp bug fix
|
||||||
|
|
||||||
return point.x >= position.x && point.y >= position.y && point.x <= (position.x + size.x) && point.y <= (position.y + size.y);
|
return point.x >= position.x && point.y >= position.y && point.x <= (position.x + size.x) && point.y <= (position.y + size.y);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ mexui.util.linkBaseControlStyles = function(controlName, derivedStyles)
|
|||||||
mexui.util.linkStyles = function(baseStyles, derivedStyles)
|
mexui.util.linkStyles = function(baseStyles, derivedStyles)
|
||||||
{
|
{
|
||||||
derivedStyles = derivedStyles || {};
|
derivedStyles = derivedStyles || {};
|
||||||
|
|
||||||
for(var k in baseStyles)
|
for(var k in baseStyles)
|
||||||
{
|
{
|
||||||
switch(k)
|
switch(k)
|
||||||
@@ -62,12 +62,12 @@ mexui.util.linkStyles = function(baseStyles, derivedStyles)
|
|||||||
case 'hover':
|
case 'hover':
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!derivedStyles[k])
|
if(!derivedStyles[k])
|
||||||
derivedStyles[k] = {};
|
derivedStyles[k] = {};
|
||||||
if(!(derivedStyles[k].__proto__ instanceof Object))
|
if(!(derivedStyles[k].__proto__ instanceof Object))
|
||||||
derivedStyles[k].__proto__ = baseStyles[k];
|
derivedStyles[k].__proto__ = baseStyles[k];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var hoverBaseStyles = JSON.parse(JSON.stringify(baseStyles[k]));
|
var hoverBaseStyles = JSON.parse(JSON.stringify(baseStyles[k]));
|
||||||
if(!derivedStyles[k].hover)
|
if(!derivedStyles[k].hover)
|
||||||
@@ -76,7 +76,7 @@ mexui.util.linkStyles = function(baseStyles, derivedStyles)
|
|||||||
derivedStyles[k].hover.__proto__ = hoverBaseStyles;
|
derivedStyles[k].hover.__proto__ = hoverBaseStyles;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return mexui.util.linkGlobalStyles(mexui.Entity.StyleableEntity.globalDefaultStyles, derivedStyles);
|
return mexui.util.linkGlobalStyles(mexui.Entity.StyleableEntity.globalDefaultStyles, derivedStyles);
|
||||||
//return derivedStyles;
|
//return derivedStyles;
|
||||||
};
|
};
|
||||||
@@ -84,7 +84,7 @@ mexui.util.linkStyles = function(baseStyles, derivedStyles)
|
|||||||
mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
||||||
{
|
{
|
||||||
derivedStyles = derivedStyles || {};
|
derivedStyles = derivedStyles || {};
|
||||||
|
|
||||||
for(var k in derivedStyles)
|
for(var k in derivedStyles)
|
||||||
{
|
{
|
||||||
switch(k)
|
switch(k)
|
||||||
@@ -93,13 +93,13 @@ mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
|||||||
case 'hover':
|
case 'hover':
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(derivedStyles[k].__proto__ instanceof Object))
|
if(!(derivedStyles[k].__proto__ instanceof Object))
|
||||||
{
|
{
|
||||||
derivedStyles[k].__proto__ = baseStyles.all;
|
derivedStyles[k].__proto__ = baseStyles.all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var k in derivedStyles)
|
for(var k in derivedStyles)
|
||||||
{
|
{
|
||||||
switch(k)
|
switch(k)
|
||||||
@@ -108,7 +108,7 @@ mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
|||||||
case 'hover':
|
case 'hover':
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(!derivedStyles[k].hasOwnProperty('hover'))
|
if(!derivedStyles[k].hasOwnProperty('hover'))
|
||||||
{
|
{
|
||||||
@@ -116,14 +116,14 @@ mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
|||||||
derivedStyles[k].hover.__proto__ = derivedStyles[k];
|
derivedStyles[k].hover.__proto__ = derivedStyles[k];
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(derivedStyles[k].focus)
|
if(derivedStyles[k].focus)
|
||||||
{
|
{
|
||||||
if(!(derivedStyles[k].focus.__proto__ instanceof Object))
|
if(!(derivedStyles[k].focus.__proto__ instanceof Object))
|
||||||
{
|
{
|
||||||
derivedStyles[k].focus.__proto__ = baseStyles.all;
|
derivedStyles[k].focus.__proto__ = baseStyles.all;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(derivedStyles[k].focus.hover)
|
if(derivedStyles[k].focus.hover)
|
||||||
{
|
{
|
||||||
if(!(derivedStyles[k].focus.hover.__proto__ instanceof Object))
|
if(!(derivedStyles[k].focus.hover.__proto__ instanceof Object))
|
||||||
@@ -132,7 +132,7 @@ mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(derivedStyles[k].hover)
|
if(derivedStyles[k].hover)
|
||||||
{
|
{
|
||||||
if(!(derivedStyles[k].hover.__proto__ instanceof Object))
|
if(!(derivedStyles[k].hover.__proto__ instanceof Object))
|
||||||
@@ -141,7 +141,7 @@ mexui.util.linkGlobalStyles = function(baseStyles, derivedStyles)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return derivedStyles;
|
return derivedStyles;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -236,13 +236,13 @@ mexui.util.getCenterPosition = function(largerSize, smallerSize)
|
|||||||
|
|
||||||
mexui.util.getWindowSize = function()
|
mexui.util.getWindowSize = function()
|
||||||
{
|
{
|
||||||
return new Vec2(gta.width, gta.height);
|
return new Vec2(game.width, game.height);
|
||||||
};
|
};
|
||||||
|
|
||||||
mexui.util.isRectangleInsideRectangle = function(pos1, size1, pos2, size2)
|
mexui.util.isRectangleInsideRectangle = function(pos1, size1, pos2, size2)
|
||||||
{
|
{
|
||||||
return !(pos2.x > (pos1.x + size1.x) ||
|
return !(pos2.x > (pos1.x + size1.x) ||
|
||||||
(pos2.x + size2.x) < pos1.x ||
|
(pos2.x + size2.x) < pos1.x ||
|
||||||
pos2.y > (pos1.y + size1.y) ||
|
pos2.y > (pos1.y + size1.y) ||
|
||||||
(pos2.y + size2.y) < pos1.y);
|
(pos2.y + size2.y) < pos1.y);
|
||||||
};
|
};
|
||||||
@@ -257,38 +257,38 @@ mexui.util.mergeStyles = function(styles, pseudoPartNames)
|
|||||||
for(var i in pseudoPartNames)
|
for(var i in pseudoPartNames)
|
||||||
{
|
{
|
||||||
var pseudoPartName = pseudoPartNames[i];
|
var pseudoPartName = pseudoPartNames[i];
|
||||||
|
|
||||||
if(styles2[0] && styles2[0].hasOwnProperty(pseudoPartName))
|
if(styles2[0] && styles2[0].hasOwnProperty(pseudoPartName))
|
||||||
styles2.push(styles2[0][pseudoPartName]);
|
styles2.push(styles2[0][pseudoPartName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i=styles2.length-1; i>=0; i--)
|
for(var i=styles2.length-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
if(styles2[i] == null)
|
if(styles2[i] == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for(var k in styles2[i])
|
for(var k in styles2[i])
|
||||||
{
|
{
|
||||||
switch(k)
|
switch(k)
|
||||||
{
|
{
|
||||||
case 'focus':
|
case 'focus':
|
||||||
case 'hover':
|
case 'hover':
|
||||||
|
|
||||||
case 'transitionTime':
|
case 'transitionTime':
|
||||||
case 'transitionDelay':
|
case 'transitionDelay':
|
||||||
|
|
||||||
case 'transitionDelayStartTime':
|
case 'transitionDelayStartTime':
|
||||||
case 'transitionStartTime':
|
case 'transitionStartTime':
|
||||||
case 'transitionStarted':
|
case 'transitionStarted':
|
||||||
case 'transitionEnded':
|
case 'transitionEnded':
|
||||||
case 'transitionReverting':
|
case 'transitionReverting':
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(styles2[i].hasOwnProperty(k) && styles3[k] == null)
|
if(styles2[i].hasOwnProperty(k) && styles3[k] == null)
|
||||||
{
|
{
|
||||||
var styleValue = styles2[i][k];
|
var styleValue = styles2[i][k];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(i > 0 && (styles2[i].transitionTime != null || styles2[i].transitionDelay != null))
|
if(i > 0 && (styles2[i].transitionTime != null || styles2[i].transitionDelay != null))
|
||||||
{
|
{
|
||||||
@@ -301,7 +301,7 @@ mexui.util.mergeStyles = function(styles, pseudoPartNames)
|
|||||||
{
|
{
|
||||||
styles2[i].transitionEnded = true;
|
styles2[i].transitionEnded = true;
|
||||||
styleValue = styles2[0][k];
|
styleValue = styles2[0][k];
|
||||||
|
|
||||||
delete styles2[i].transitionDelayStartTime;
|
delete styles2[i].transitionDelayStartTime;
|
||||||
delete styles2[i].transitionStartTime;
|
delete styles2[i].transitionStartTime;
|
||||||
delete styles2[i].transitionStarted;
|
delete styles2[i].transitionStarted;
|
||||||
@@ -348,19 +348,19 @@ mexui.util.mergeStyles = function(styles, pseudoPartNames)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
styles3[k] = styleValue;
|
styles3[k] = styleValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i in styles2)
|
for(var i in styles2)
|
||||||
{
|
{
|
||||||
if(styles2[i])
|
if(styles2[i])
|
||||||
styles2[i] = styles2[i].__proto__;
|
styles2[i] = styles2[i].__proto__;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return styles3;
|
return styles3;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -374,54 +374,54 @@ mexui.util.getTransitionStyles = function(styles, pseudoPartNames, progress)
|
|||||||
for(var i in pseudoPartNames)
|
for(var i in pseudoPartNames)
|
||||||
{
|
{
|
||||||
var pseudoPartName = pseudoPartNames[i];
|
var pseudoPartName = pseudoPartNames[i];
|
||||||
|
|
||||||
if(styles2[0] && styles2[0].hasOwnProperty(pseudoPartName))
|
if(styles2[0] && styles2[0].hasOwnProperty(pseudoPartName))
|
||||||
styles2.push(styles2[0][pseudoPartName]);
|
styles2.push(styles2[0][pseudoPartName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i=styles2.length-1; i>=0; i--)
|
for(var i=styles2.length-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
if(styles2[i] == null)
|
if(styles2[i] == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for(var k in styles2[i])
|
for(var k in styles2[i])
|
||||||
{
|
{
|
||||||
switch(k)
|
switch(k)
|
||||||
{
|
{
|
||||||
case 'focus':
|
case 'focus':
|
||||||
case 'hover':
|
case 'hover':
|
||||||
|
|
||||||
case 'transitionTime':
|
case 'transitionTime':
|
||||||
case 'transitionDelay':
|
case 'transitionDelay':
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(styles2[i].hasOwnProperty(k) && styles3[k] == null)
|
if(styles2[i].hasOwnProperty(k) && styles3[k] == null)
|
||||||
{
|
{
|
||||||
var styleValue = styles2[i][k];
|
var styleValue = styles2[i][k];
|
||||||
|
|
||||||
if(i > 0)
|
if(i > 0)
|
||||||
{
|
{
|
||||||
var mainStyleValue = styles2[0][k];
|
var mainStyleValue = styles2[0][k];
|
||||||
var pseudoStyleValue = styles2[i][k];
|
var pseudoStyleValue = styles2[i][k];
|
||||||
|
|
||||||
//console.log(mainStyleValue+' '+pseudoStyleValue);
|
//console.log(mainStyleValue+' '+pseudoStyleValue);
|
||||||
|
|
||||||
styleValue = mexui.util.interpolateStyle(k, progress, mainStyleValue, pseudoStyleValue);
|
styleValue = mexui.util.interpolateStyle(k, progress, mainStyleValue, pseudoStyleValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
styles3[k] = styleValue;
|
styles3[k] = styleValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i in styles2)
|
for(var i in styles2)
|
||||||
{
|
{
|
||||||
if(styles2[i])
|
if(styles2[i])
|
||||||
styles2[i] = styles2[i].__proto__;
|
styles2[i] = styles2[i].__proto__;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return styles3;
|
return styles3;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -476,7 +476,7 @@ mexui.util.fromColour = function(colour)
|
|||||||
|
|
||||||
mexui.util.time = function()
|
mexui.util.time = function()
|
||||||
{
|
{
|
||||||
return gta.tickCount;
|
return sdl.tickCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
mexui.util.isIntChar = function(character)
|
mexui.util.isIntChar = function(character)
|
||||||
@@ -570,14 +570,14 @@ mexui.util.isDayId = function(text)
|
|||||||
{
|
{
|
||||||
if(text.length == 2 && text.substr(0, 1) == '0')
|
if(text.length == 2 && text.substr(0, 1) == '0')
|
||||||
text = text.substr(1);
|
text = text.substr(1);
|
||||||
|
|
||||||
if(mexui.util.isPositiveInt(text))
|
if(mexui.util.isPositiveInt(text))
|
||||||
{
|
{
|
||||||
var _int = parseInt(text);
|
var _int = parseInt(text);
|
||||||
if(_int >= 1 && _int <= 31)
|
if(_int >= 1 && _int <= 31)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -585,7 +585,7 @@ mexui.util.isDayIdWithOptionalSuffix = function(text)
|
|||||||
{
|
{
|
||||||
if(mexui.util.isDayId(text))
|
if(mexui.util.isDayId(text))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(text.length > 2)
|
if(text.length > 2)
|
||||||
{
|
{
|
||||||
var last2Chars = text.substr(text.length - 2, 2);
|
var last2Chars = text.substr(text.length - 2, 2);
|
||||||
@@ -598,14 +598,14 @@ mexui.util.isDayIdWithOptionalSuffix = function(text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
mexui.util.inArrayOrStartsWithInArray = function(text, arr, startsWithCharCount)
|
mexui.util.inArrayOrStartsWithInArray = function(text, arr, startsWithCharCount)
|
||||||
{
|
{
|
||||||
text = text.toLowerCase();
|
text = text.toLowerCase();
|
||||||
|
|
||||||
for(var i in arr)
|
for(var i in arr)
|
||||||
{
|
{
|
||||||
if(text === arr[i])
|
if(text === arr[i])
|
||||||
@@ -613,7 +613,7 @@ mexui.util.inArrayOrStartsWithInArray = function(text, arr, startsWithCharCount)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(text.length == startsWithCharCount)
|
if(text.length == startsWithCharCount)
|
||||||
{
|
{
|
||||||
for(var i in arr)
|
for(var i in arr)
|
||||||
@@ -624,7 +624,7 @@ mexui.util.inArrayOrStartsWithInArray = function(text, arr, startsWithCharCount)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -633,14 +633,14 @@ mexui.util.isMonthIdOrName = function(text)
|
|||||||
var text2 = text;
|
var text2 = text;
|
||||||
if(text2.length == 2 && text2.substr(0, 1) == '0')
|
if(text2.length == 2 && text2.substr(0, 1) == '0')
|
||||||
text2 = text2.substr(1);
|
text2 = text2.substr(1);
|
||||||
|
|
||||||
if(mexui.util.isPositiveInt(text2))
|
if(mexui.util.isPositiveInt(text2))
|
||||||
{
|
{
|
||||||
var _int = parseInt(text2);
|
var _int = parseInt(text2);
|
||||||
if(_int >= 1 && _int <= 12)
|
if(_int >= 1 && _int <= 12)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mexui.util.isMonthName(text);
|
return mexui.util.isMonthName(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -649,14 +649,14 @@ mexui.util.isWeekDayId = function(text)
|
|||||||
var text2 = text;
|
var text2 = text;
|
||||||
if(text2.length == 2 && text2.substr(0, 1) == '0')
|
if(text2.length == 2 && text2.substr(0, 1) == '0')
|
||||||
text2 = text2.substr(1);
|
text2 = text2.substr(1);
|
||||||
|
|
||||||
if(mexui.util.isPositiveInt(text2))
|
if(mexui.util.isPositiveInt(text2))
|
||||||
{
|
{
|
||||||
var _int = parseInt(text2);
|
var _int = parseInt(text2);
|
||||||
if(_int >= 1 && _int <= 7)
|
if(_int >= 1 && _int <= 7)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -665,14 +665,14 @@ mexui.util.isWeekDayIdOrName = function(text)
|
|||||||
var text2 = text;
|
var text2 = text;
|
||||||
if(text2.length == 2 && text2.substr(0, 1) == '0')
|
if(text2.length == 2 && text2.substr(0, 1) == '0')
|
||||||
text2 = text2.substr(1);
|
text2 = text2.substr(1);
|
||||||
|
|
||||||
if(mexui.util.isPositiveInt(text2))
|
if(mexui.util.isPositiveInt(text2))
|
||||||
{
|
{
|
||||||
var _int = parseInt(text2);
|
var _int = parseInt(text2);
|
||||||
if(_int >= 1 && _int <= 7)
|
if(_int >= 1 && _int <= 7)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mexui.util.isWeekDayName(text);
|
return mexui.util.isWeekDayName(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -690,15 +690,15 @@ mexui.util.expand2DigitYear = function(year, twoDigitYearCapOffset)
|
|||||||
mexui.util.isYear = function(text, minYear, maxYear, twoDigitYearCapOffset)
|
mexui.util.isYear = function(text, minYear, maxYear, twoDigitYearCapOffset)
|
||||||
{
|
{
|
||||||
var _int = parseInt(text);
|
var _int = parseInt(text);
|
||||||
|
|
||||||
if(isNaN(_int))
|
if(isNaN(_int))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(_int >= 0 && _int <= 99)
|
if(_int >= 0 && _int <= 99)
|
||||||
_int = mexui.util.expand2DigitYear(_int, twoDigitYearCapOffset);
|
_int = mexui.util.expand2DigitYear(_int, twoDigitYearCapOffset);
|
||||||
|
|
||||||
if(_int < minYear || _int > maxYear)
|
if(_int < minYear || _int > maxYear)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user