-
Notifications
You must be signed in to change notification settings - Fork 13
/
client.js
33 lines (29 loc) · 976 Bytes
/
client.js
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
32
33
////////////////////////////////////////////////
/// Discord Vehicle Whitelist, Made by FAXES ///
////////////////////////////////////////////////
let restricted = [];
Delay = (ms) => new Promise(res => setTimeout(res, ms));
onNet("DiscordVehicleWhitelist:SendEm", cars => {
cars.forEach(e => {
restricted.push({c: e.split(":")[1], d: e.split(":")[0]});
});
});
setTick(async () => {
await Delay(400);
let ped = GetPlayerPed(PlayerId())
let veh = GetVehiclePedIsIn(ped);
if(veh && DoesEntityExist(veh)) {
let model = GetEntityModel(veh);
let driver = GetPedInVehicleSeat(veh, -1);
if(driver == ped) {
const found = restricted.find(e => e.c == model);
if(found) {
if(found.d) {
DeleteEntity(veh);
} else {
TaskLeaveVehicle(ped, veh, 16);
}
}
}
}
});