SquadJS/plugins/auto-tk-warn/index.js

27 lines
732 B
JavaScript
Raw Normal View History

2020-09-09 03:31:48 -05:00
import { TEAMKILL } from 'squad-server/events';
2020-05-18 13:40:47 -05:00
export default {
name: 'auto-tk-warn',
2020-08-22 08:32:39 -05:00
description:
2020-09-10 08:17:27 -05:00
'The <code>auto-tk-warn</code> plugin will automatically warn players in game to apologise for teamkills when ' +
'they teamkill another player.',
2020-05-18 13:40:47 -05:00
defaultEnabled: true,
optionsSpec: {
message: {
required: false,
2020-09-10 08:17:27 -05:00
description: 'The message to warn players with.',
default: 'Please apologise for ALL TKs in ALL chat!',
2020-09-10 08:17:27 -05:00
example: 'Test'
}
},
2020-09-02 07:20:44 -05:00
init: async (server, options) => {
2020-09-09 03:31:48 -05:00
server.on(TEAMKILL, (info) => {
// ignore suicides
if (info.attacker.steamID === info.victim.steamID) return;
2020-09-02 07:20:44 -05:00
server.rcon.warn(info.attacker.steamID, options.message);
});
}
};