About This File
This resource lets you control the blackout feature of GTA V.
Installing
- Put the files you downloaded in their respective places
- Add require('blackout') to client_packages/index.js
- All done
API
// Serverside (synced to every player) mp.world.blackout.enabled // get mp.world.blackout.enabled = true/false // set // Clientside (only for a client) mp.game.blackout.enabled // get mp.game.blackout.enabled = true/false // set
You can also trigger SetBlackoutState event with the first argument being the new state of blackout.
Example
// Toggle blackout mode with /toggleblackout (Serverside) mp.events.addCommand("toggleblackout", (player) => { mp.world.blackout.enabled = !mp.world.blackout.enabled; player.outputChatBox(`Blackout ${mp.world.blackout.enabled ? `enabled` : `disabled`}.`); });
// Toggle blackout mode with F8 key (Clientside) mp.keys.bind(0x77, false, () => { mp.game.blackout.enabled = !mp.game.blackout.enabled; mp.gui.chat.push(`Blackout ${mp.game.blackout.enabled ? `enabled` : `disabled`}.`); });
What's New in Version 1.0.1 See changelog
Released
Version 1.0.1:
- Switched to light state API from native blackout, which means the script should be working again