mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-28 23:24:26 -05:00
27 lines
753 B
JavaScript
27 lines
753 B
JavaScript
import { LOG_PARSER_TEAMKILL } from 'squad-server/events/log-parser';
|
|
|
|
export default {
|
|
name: 'auto-tk-warn',
|
|
description:
|
|
'The `auto-tk-warn` plugin will automatically warn players in game to apologise for teamkills when they ' +
|
|
'teamkill another player.',
|
|
|
|
defaultEnabled: true,
|
|
optionsSpec: {
|
|
message: {
|
|
type: 'String',
|
|
required: false,
|
|
default: 'Please apologise for ALL TKs in ALL chat!',
|
|
description: 'The message to warn players with.'
|
|
}
|
|
},
|
|
|
|
init: async (server, options) => {
|
|
server.on(LOG_PARSER_TEAMKILL, (info) => {
|
|
// ignore suicides
|
|
if (info.attacker.steamID === info.victim.steamID) return;
|
|
server.rcon.warn(info.attacker.steamID, options.message);
|
|
});
|
|
}
|
|
};
|