Skip to content
On this page

Athena.systems.job.verify

Functions

addCustomCheck

Usage

Athena.systems.job.verify.addCustomCheck(type, callback): any

Adds a custom check type to the global job system.

  • Criteria -> Defined as things like can't have weapons, or can't be on-foot, etc.
  • Type -> Defined as things like a capture point, or jump 5 times here... etc.

CANNOT BE ASYNC

Example

Athena.systems.job.verify.addCustomCheck('criteria', (player: alt.Player, objective: Objective) => {
    // Ignore this objective if the uid does not match.
    // Force it to always pass.
    if (objective.uid !== 'medkit-ambulance-check') {
        return true;
    }

    if (!player || !player.vehicle) {
        return false;
    }

    // Check if they are in a specific vehicle with a specific model
    if (player.vehicle.model !== alt.hash('ambulance')) {
        return false;
    }

    // This item does not exist by default in Athena
    return Athena.player.inventory.has(player, 'medkit', 1);
});

Parameters

NameType
type"type" | "criteria"
callback(player: Player, objective: Objective) => boolean

Returns

any

Defined in

server/systems/job/verify.ts:326


criteria

Usage

Athena.systems.job.verify.criteria(player, objective): boolean

Verifies job criteria such as not being in a vehicle, no weapons, etc.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
objectiveObjective

Returns

boolean

Defined in

server/systems/job/verify.ts:84


objective

Usage

Athena.systems.job.verify.objective(job): Promise<boolean>

Verifies all objective content / functionality.

Parameters

NameType
jobJob

Returns

Promise<boolean>

Defined in

server/systems/job/verify.ts:18


override

Usage

Athena.systems.job.verify.override(functionName, callback): any

Used to override job objective verification functionality

Parameters

NameType
functionName"addCustomCheck"
callback(type: "type" | "criteria", callback: (player: Player, objective: Objective) => boolean) => any

Returns

any

Defined in

server/systems/job/verify.ts:354

Usage

Athena.systems.job.verify.override(functionName, callback): any

Used to override job objective verification functionality

Parameters

NameType
functionName"type"
callback(player: Player, objective: Objective) => boolean

Returns

any

Defined in

server/systems/job/verify.ts:355

Usage

Athena.systems.job.verify.override(functionName, callback): any

Used to override job objective verification functionality

Parameters

NameType
functionName"criteria"
callback(player: Player, objective: Objective) => boolean

Returns

any

Defined in

server/systems/job/verify.ts:356

Usage

Athena.systems.job.verify.override(functionName, callback): any

Used to override job objective verification functionality

Parameters

NameType
functionName"objective"
callback(job: Job) => Promise<boolean>

Returns

any

Defined in

server/systems/job/verify.ts:357


type

Usage

Athena.systems.job.verify.type(player, objective): boolean

Verifies job types such as a waypoint, or capture point.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
objectiveObjective

Returns

boolean

Defined in

server/systems/job/verify.ts:232

Created by Stuyk | Est. 2020