Add job pickup/blip utils, check svr enabled
This commit is contained in:
@@ -11,13 +11,8 @@ function initJobScript() {
|
|||||||
logToConsole(LOG_INFO, "[VRR.Job]: Initializing job script ...");
|
logToConsole(LOG_INFO, "[VRR.Job]: Initializing job script ...");
|
||||||
getServerData().jobs = loadJobsFromDatabase();
|
getServerData().jobs = loadJobsFromDatabase();
|
||||||
|
|
||||||
if(getServerConfig().createJobPickups) {
|
createAllJobPickups();
|
||||||
createAllJobPickups();
|
createAllJobBlips();
|
||||||
}
|
|
||||||
|
|
||||||
if(getServerConfig().createJobBlips) {
|
|
||||||
createAllJobBlips();
|
|
||||||
}
|
|
||||||
|
|
||||||
setAllJobDataIndexes();
|
setAllJobDataIndexes();
|
||||||
logToConsole(LOG_INFO, "[VRR.Job]: Job script initialized successfully!");
|
logToConsole(LOG_INFO, "[VRR.Job]: Job script initialized successfully!");
|
||||||
@@ -200,6 +195,10 @@ function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createAllJobBlips() {
|
function createAllJobBlips() {
|
||||||
|
if(!getServerConfig().createJobBlips) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location blips ...`);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location blips ...`);
|
||||||
for(let i in getServerData().jobs) {
|
for(let i in getServerData().jobs) {
|
||||||
for(let j in getServerData().jobs[i].locations) {
|
for(let j in getServerData().jobs[i].locations) {
|
||||||
@@ -214,6 +213,10 @@ function createAllJobBlips() {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createAllJobPickups() {
|
function createAllJobPickups() {
|
||||||
|
if(!getServerConfig().createJobPickups) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location pickups ...`);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Spawning all job location pickups ...`);
|
||||||
let pickupCount = 0;
|
let pickupCount = 0;
|
||||||
for(let i in getServerData().jobs) {
|
for(let i in getServerData().jobs) {
|
||||||
@@ -1730,4 +1733,50 @@ function respawnPlayerLastJobVehicle(client) {
|
|||||||
respawnVehicle(getPlayerCurrentSubAccount(client).lastJobVehicle);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user