mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-29 09:54:26 -05:00
30 lines
708 B
JavaScript
30 lines
708 B
JavaScript
|
import BasePlugin from './base-plugin.js';
|
||
|
|
||
|
export default class AutoTKWarn extends BasePlugin {
|
||
|
static get description() {
|
||
|
return 'The <code>AutoTkWarn</code> plugin will automatically warn players with a message when they teamkill.';
|
||
|
}
|
||
|
|
||
|
static get defaultEnabled() {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
static get optionsSpecification() {
|
||
|
return {
|
||
|
message: {
|
||
|
required: false,
|
||
|
description: 'The message to warn players with.',
|
||
|
default: 'Please apologise for ALL TKs in ALL chat!'
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
constructor(server, options) {
|
||
|
super();
|
||
|
|
||
|
server.on('TEAMKILL', async (info) => {
|
||
|
await server.rcon.warn(info.attacker.steamID, options.message);
|
||
|
});
|
||
|
}
|
||
|
}
|