Add vehicles, util funcs. Fix jobs

This commit is contained in:
VortrexFTW
2020-09-05 02:30:39 -05:00
parent c536fcd6ef
commit 29e273bf60
9 changed files with 155 additions and 81 deletions

View File

@@ -2451,6 +2451,12 @@ function getClosestJobPoint(position) {
// ---------------------------------------------------------------------------
function getJobIndex(jobData) {
return serverData.jobs[server.game].indexOf(jobData);
}
// ---------------------------------------------------------------------------
function getVehiclesInRange(position, distance) {
return getElementsByType(ELEMENT_VEHICLE).filter(x => x.position.distance(position) <= distance);
}
@@ -3213,4 +3219,18 @@ function saveAllServerDataToDatabase() {
saveAllHousesToDatabase();
saveAllBusinessesToDatabase();
saveAllClansToDatabase();
}
}
// ---------------------------------------------------------------------------
function intToBool(intVal) {
return !!intVal;
}
// ---------------------------------------------------------------------------
function boolToInt(boolVal) {
return (boolVal) ? 1 : 0;
}
// ---------------------------------------------------------------------------