Reorganize some utils, change dividing lines
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: garbage.js
|
||||
// DESC: Provides garbage collector job functions and usage
|
||||
// TYPE: Job (JavaScript)
|
||||
@@ -72,7 +72,7 @@ let garbageRoutes = [
|
||||
],
|
||||
];
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getRandomGarbageRoute(island) {
|
||||
if(garbageRoutes[getServerGame()][island].length == 1) {
|
||||
@@ -81,7 +81,7 @@ function getRandomGarbageRoute(island) {
|
||||
return getRandom(0, garbageRoutes[getServerGame()][island].length-1);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getNextStopOnGarbageRoute(island, garbageRoute, garbageRouteStop) {
|
||||
if(!isLastStopOnGarbageRoute(island, garbageRoute, garbageRouteStop)) {
|
||||
@@ -91,7 +91,7 @@ function getNextStopOnGarbageRoute(island, garbageRoute, garbageRouteStop) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function isLastStopOnGarbageRoute(island, garbageRoute, garbageRouteStop) {
|
||||
if(garbageRouteStop == garbageRoutes[getServerGame()][island][garbageRoute].positions.length-1) {
|
||||
@@ -100,20 +100,20 @@ function isLastStopOnGarbageRoute(island, garbageRoute, garbageRouteStop) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function showNextGarbageStop(client) {
|
||||
getPlayerData(client).jobRouteStop = getNextStopOnGarbageRoute(getPlayerData(client).jobRouteStop, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop);
|
||||
showCurrentGarbageStop(client);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function showCurrentGarbageStop(client) {
|
||||
triggerNetworkEvent("ag.showGarbageStop", client, getGarbageRouteStopPosition(getPlayerIsland(client), getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop), getColourByName("garbageDriverGreen"));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function playerArrivedAtGarbageStop(client) {
|
||||
if(isLastStopOnGarbageRoute(getPlayerData(client).jobRouteIsland, getPlayerData(client).jobRoute, getPlayerData(client).jobRouteStop)) {
|
||||
@@ -137,16 +137,16 @@ function playerArrivedAtGarbageStop(client) {
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getGarbageRouteStopPosition(island, garbageRoute, garbageRouteStop) {
|
||||
return garbageRoutes[getServerGame()][island][garbageRoute].positions[garbageRouteStop];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getGarbageRouteData(island, garbageRoute) {
|
||||
return garbageRoutes[getServerGame()][island][garbageRoute];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user