Check pickup is supported

This commit is contained in:
Vortrex
2023-02-12 13:11:06 -06:00
parent afce71dd19
commit 0934a86023

View File

@@ -3192,17 +3192,19 @@ function createJobLocationPickup(jobId, locationId) {
} }
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
let pickup = createGamePickup(pickupModelId, tempJobData.locations[locationId].position, getGameConfig().pickupTypes[getGame()].job); if (isGameFeatureSupported("pickup")) {
if (pickup != false) { let pickup = createGamePickup(pickupModelId, tempJobData.locations[locationId].position, getGameConfig().pickupTypes[getGame()].job);
tempJobData.locations[locationId].pickup = pickup; if (pickup != false) {
setElementDimension(pickup, tempJobData.locations[locationId].dimension); tempJobData.locations[locationId].pickup = pickup;
setElementOnAllDimensions(pickup, false); setElementDimension(pickup, tempJobData.locations[locationId].dimension);
setEntityData(pickup, "v.rp.owner.type", V_PICKUP_JOB, false); setElementOnAllDimensions(pickup, false);
setEntityData(pickup, "v.rp.owner.id", locationId, false); setEntityData(pickup, "v.rp.owner.type", V_PICKUP_JOB, false);
setEntityData(pickup, "v.rp.label.type", V_LABEL_JOB, true); setEntityData(pickup, "v.rp.owner.id", locationId, false);
setEntityData(pickup, "v.rp.label.name", tempJobData.name, true); setEntityData(pickup, "v.rp.label.type", V_LABEL_JOB, true);
setEntityData(pickup, "v.rp.label.jobType", tempJobData.databaseId, true); setEntityData(pickup, "v.rp.label.name", tempJobData.name, true);
addToWorld(pickup); setEntityData(pickup, "v.rp.label.jobType", tempJobData.databaseId, true);
addToWorld(pickup);
}
} }
} else { } else {
let blipModelId = -1; let blipModelId = -1;
@@ -3573,7 +3575,7 @@ function createJobUniformCommand(command, params, client) {
} }
createJobUniform(jobId, skinIndex); createJobUniform(jobId, skinIndex);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created uniform with skin {ALTCOLOUR}${getGameConfig().skins[skinIndex][1]} (${getGameConfig().skins[skinIndex][0]}){MAINCOLOUR} for job {jobYellow}${getJobData(jobId).name}`); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created uniform with skin {ALTCOLOUR}${getGameConfig().skins[getGame()][skinIndex][1]} (${getGameConfig().skins[skinIndex][0]}){MAINCOLOUR} for job {jobYellow}${getJobData(jobId).name}`);
return true; return true;
} }