2020-10-12 16:12:36 -05:00
|
|
|
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) {
|
2020-10-23 05:18:23 -05:00
|
|
|
super(server, options);
|
2020-10-12 16:12:36 -05:00
|
|
|
|
|
|
|
server.on('TEAMKILL', async (info) => {
|
2020-10-23 05:18:23 -05:00
|
|
|
await server.rcon.warn(info.attacker.steamID, this.options.message);
|
2020-10-12 16:12:36 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|