Sign in to follow this  
Captien

Sirens Silencer

Recommended Posts

Captien    29

Hello Guys,

Welcome again to another tutorial. Today i'm going to introduce to you guys the Sirens Silencer.

If you want to be stealth and raid the criminals without they notice you, this will be your solution.

The script is very simple.
 

When player enters a Emergency Vehicle, the script will work by pressing B. The silencer is also saved for future uses if you park yours car and took another one and then came back. The silencer will be waiting you.

Server-side:

Spoiler
mp.events.add('playerEnteredVehicle', (player) => {
    player.call('VehicleEntered', player.seat)
})

 

Client-side:

Spoiler
let vehicle, state, vehSeat = null;
let data = new Map();

mp.events.add('VehicleEntered', (seat) => {

    vehicle = mp.players.local.vehicle;

    if (classchecker()) {
        if (seat == 0) {
            vehSeat = 0;
            if (data.get(vehicle) === undefined) {
                data.set(vehicle, false);
            }
        }
    }
})


mp.keys.bind(0x42, true, _ => {
    if (vehicle && vehSeat == 0) {
        if (data.get(vehicle) == false) {
            data.set(vehicle, true);
            mp.game.graphics.notify(`Slient mode is activated.`);
            vehicle.disableImpactExplosionActivation(true);
        } else if (data.get(vehicle) == true) {
            data.set(vehicle, false);
            mp.game.graphics.notify(`Slient mode is deactivated.`);
            vehicle.disableImpactExplosionActivation(false);
        }
    }
})

function classchecker() {

    let vehClass = vehicle.getClass();

    if (vehClass !== 18) {
        return false;
    }

    return true;

}

 

If you need anything help, don't hesitate to post your problem in this topic.

You're free to use, change, copy this script. (Don't Forget some credits)

Hope you enjoyed the Tutorial.
Have a nice day!

Regards,
Captien.

Edited by Captien
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.