Supported by CRC
Use events to ban an account, unban an account, or automatically kick users who are banned after login.
- CRC DB
- Login Plugin (Choose 1)
-
Create a folder in your
src
folder calledcrc-ban-handler
. -
Add the
TypeScript
files from this resource, to that folder. -
Modify
server.toml
and ensure it loads whatever you named the folder.
In the case of the example above it should be crc-ban-handler
.
resources = [
'crc-db',
'crc-native-menu',
'crc-instructional-buttons',
'crc-ban-handler',
'crc-discord-login',
'crc-select-character'
'watch-resources'
]
Your resource structure may vary
Modify server.toml
and ensure it loads whatever you named the folder.
In the case of the example above it should be crc-db
.
resources = [
'mods-before-db',
'crc-db',
'resources-after-db',
'dbg_reconnect'
]
You can modify the ban status of an account through MongoDB.
However, if you wish to do it programatically there are three events.
Listen for ban status updates after calling other events.
alt.on('crc-ban-handler-on-update', (_id: string, isBanned: boolean) => {
alt.log(`Ban Status Update: ${_id} is ${isBanned ? 'Banned' : 'Unbanned'}`);
});
Set a player
or _id
from an Account
as banned.
alt.emit('crc-ban-handler-set-banned', somePlayerOrAccountID)
Set an _id
from an Account
as banned.
alt.emit('crc-ban-handler-set-unbanned', accountID)