#Discord Vehicle Whitelist

1 messages · Page 1 of 1 (latest)

tawdry imp
#

Go to the server.js and edit inside the config variable.

gray wyvern
#

So I do this then what?

let restricted = [
"mxtahoe"
];

#

const config = {
vehicles: [
{car: "POLICE", delete: true},
{car: "mxtahoe", delete: true, role: "1049981781375451216"},
{car: "2020explorer", delete: false, role: "1049981781404819490"},

#

I have that setup as well but when I spawn it should not spawn I would think

tawdry imp
#

where are you editing this

#

dont edit the client.js only edit the server.js in the client delete whatever you put in there.

#
////////////////////////////////////////////////
/// 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);
                }
            }
        }
    }
});
#

Thats the client file

#

you shouldnt adjust that

gray wyvern
#

Okay so after I do the Server one it still didnt work cause thats the one I tried first

tawdry imp
#

const config = {
    vehicles: [
        {car: "POLICE", delete: true},
        {car: "POLICE2", delete: true, role: "940489890578178048"},
        {car: "POLICE3"}
    ]
}
#

should look something like that.

gray wyvern
#

Yes

#

Then I added my custom car for the Police2 and it did not work

tawdry imp
#

check the spawn code.

gray wyvern
#

Trying it now give me a sec

#

Nope still don't work