Adding Athena Events
Learn how to use Athena built-in events.
An Athena Event is a baked in event that gets called when specific Athena based scripting functionality is met. An example would be when a player is respawned by the gamemode through the death event.

How to use an Athena Event?

Inside of your plugins folder you can define them like this on server-side.
1
import * as alt from 'alt-server';
2
import { ATHENA_EVENTS_PLAYER, ATHENA_EVENTS_VEHICLE } from '../../server/enums/athena';
3
import { EventController } from '../../server/systems/athenaEvent';
4
5
EventController.onPlayer(ATHENA_EVENTS_PLAYER.DIED, (player: alt.Player) => {
6
alt.log(`${player.data.name} has died.`);
7
});
8
9
EventController.onVehicle(ATHENA_EVENTS_VEHICLE.SPAWNED, (vehicle: alt.Vehicle) => {
10
console.log(`A player owned vehicle was spawned.`);
11
});
Copied!
Auto-completion in VSCode will assist you with the rest.
Last modified 8mo ago