Add job pickup/blip utils, check svr enabled

This commit is contained in:
Vortrex
2021-12-11 20:19:31 -06:00
parent 13380bed5a
commit 8d5912b6bc

View File

@@ -11,13 +11,8 @@ function initJobScript() {
logToConsole(LOG_INFO, "[VRR.Job]: Initializing job script ...");
getServerData().jobs = loadJobsFromDatabase();
if(getServerConfig().createJobPickups) {
createAllJobPickups();
}
if(getServerConfig().createJobBlips) {
createAllJobBlips();
}
createAllJobPickups();
createAllJobBlips();
setAllJobDataIndexes();
logToConsole(LOG_INFO, "[VRR.Job]: Job script initialized successfully!");
@@ -200,6 +195,10 @@ function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
// ===========================================================================
function createAllJobBlips() {
if(!getServerConfig().createJobBlips) {
return false;
}
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location blips ...`);
for(let i in getServerData().jobs) {
for(let j in getServerData().jobs[i].locations) {
@@ -214,6 +213,10 @@ function createAllJobBlips() {
// ===========================================================================
function createAllJobPickups() {
if(!getServerConfig().createJobPickups) {
return false;
}
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location pickups ...`);
let pickupCount = 0;
for(let i in getServerData().jobs) {
@@ -1730,4 +1733,50 @@ function respawnPlayerLastJobVehicle(client) {
respawnVehicle(getPlayerCurrentSubAccount(client).lastJobVehicle);
}
// ===========================================================================
function resetAllJobBlips() {
deleteAllJobBlips();
createAllJobBlips();
}
// ===========================================================================
function resetAllJobPickups() {
deleteAllJobPickups();
createAllJobPickups();
}
// ===========================================================================
function deleteAllJobBlips() {
for(let i in getServerData().jobs) {
deleteJobBlips(i);
}
}
// ===========================================================================
function deleteAllJobPickups() {
for(let i in getServerData().jobs) {
deleteJobPickups(i);
}
}
// ===========================================================================
function deleteJobBlips(jobId) {
for(let j in getServerData().jobs[jobId].locations) {
deleteJobLocationBlip(jobId, j);
}
}
// ===========================================================================
function deleteJobPickups(jobId) {
for(let j in getServerData().jobs[jobId].locations) {
deleteJobLocationPickup(jobId, j);
}
}
// ===========================================================================