-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.ts
26 lines (22 loc) · 773 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import * as alt from 'alt-server';
import * as Athena from '@AthenaServer/api';
import { VEHICLE_TYPE } from '@AthenaShared/enums/vehicleTypeFlags';
const PLUGIN_NAME = 'Delayed-Heli-Takeoff';
const STARTUP_TIME = 30; // Time to freeze the heli in seconds
function init() {
Athena.vehicle.events.on('engine-started', engineStartCallback);
}
function engineStartCallback(vehicle: alt.Vehicle, player: alt.Player) {
const data = Athena.utility.hashLookup.vehicle.hash(vehicle.model);
if (!data) {
return;
}
if (data.type !== VEHICLE_TYPE.HELI) {
return;
}
vehicle.frozen = true;
alt.setTimeout(() => {
vehicle.frozen = false;
}, STARTUP_TIME * 1000);
}
Athena.systems.plugins.registerPlugin(PLUGIN_NAME, init);