-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
31 lines (25 loc) · 889 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
27
28
29
30
31
import { ModType } from './ModTypes';
import { TunningModel } from './TuneModel';
export class Tunning {
constructor() {
mp.events.addCommand({
'newVeh': this.createVehicle.bind(this),
'tunning': this.tunning.bind(this)
});
}
private createVehicle(player: PlayerMp, vehName: string): void {
mp.vehicles.new(mp.joaat(vehName), player.position, {
engine: true,
numberPlate: `${player.name}`,
color: [[0, 255, 0], [0, 255, 0]],
dimension: player.dimension,
});
}
private tunning(player: PlayerMp, fulltext: string): void {
if (!player.vehicle)
return;
const [modType, modIndex] = fulltext.split(', ');
new TunningModel(Number(modType) as ModType, Number(modIndex)).apply(player.vehicle);
}
}
const tunning = new Tunning();