From b0e587fba9838d5679db7aa01d990f5d60f517ee Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 13 Apr 2021 01:29:42 -0500 Subject: [PATCH] Move wep slot IDs to CS utils, use gta namespace --- scripts/client/utilities.js | 122 +++++++++++++++++++++++++++++++++++- 1 file changed, 119 insertions(+), 3 deletions(-) diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index db89a897..f33583dd 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -8,6 +8,115 @@ // TYPE: Client (JavaScript) // =========================================================================== +let weaponSlots = [ + false, + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 4, + 4, + 4, + 5, + 5, + 5, + 5, + 6, + 6, + 8, + 8, + 7, + 7, + 7, + 7, + 9, + -1, + 9, + ], + [ + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 8, + 8, + 8, + -1, + -1, + -1, + 2, + 2, + 2, + 3, + 3, + 3, + 4, + 4, + 5, + 5, + 4, + 6, + 6, + 7, + 7, + 7, + 7, + 8, + 12, + 9, + 9, + 9, + 9, + 9, + 11, + 9, + 9, + 9, + ], +]; + function openAllGarages() { switch(gta.game) { case GAME_GTA_III: @@ -207,7 +316,7 @@ function setLocalPlayerHeading(position) { function setLocalPlayerInterior(interior) { logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting interior to ${interior}`); localPlayer.interior = interior; - cameraInterior = interior; + gta.cameraInterior = interior; } // =========================================================================== @@ -215,7 +324,7 @@ function setLocalPlayerInterior(interior) { function setLocalPlayerInterior(interior) { logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting interior to ${interior}`); localPlayer.interior = interior; - cameraInterior = interior; + gta.cameraInterior = interior; } // =========================================================================== @@ -257,7 +366,7 @@ function clearLocalPedState() { // =========================================================================== function getWeaponSlot(weaponId) { - return getGameData().weaponSlots[gta.game][weaponId]; + return weaponSlots[gta.game][weaponId]; } // =========================================================================== @@ -489,4 +598,11 @@ function processLocalPlayerVehicleEntryExitHandling() { } } +// =========================================================================== + +function getVehicleForNetworkEvent(vehicleArg) { + // Soon this will also be used to get the IV vehicle via it's ID + return vehicleArg; +} + // =========================================================================== \ No newline at end of file