-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Thomas-Smyth/beta
SquadJS v1.0.7 Release
- Loading branch information
Showing
11 changed files
with
82 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div align="center"> | ||
|
||
<img src="../../assets/squadjs-logo.png" alt="Logo" width="500"/> | ||
|
||
#### SquadJS - Auto Teamkill Warning | ||
</div> | ||
|
||
## About | ||
Automatically sends a warning to players who teamkill to remind them to apologise in all chat. | ||
|
||
## Installation | ||
```js | ||
// Place the following line at the top of your index.js file. | ||
import { autoTKWarn } from 'plugins'; | ||
|
||
// Place the following lines after all of the above. | ||
await discordAdminCamLogs( | ||
server, | ||
{ // options - the options included below display the defaults and can be removed for simplicity. | ||
message: 'Please apologise for ALL TKs in ALL chat!' // warning to send | ||
} | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { LOG_PARSER_TEAMKILL } from 'squad-server/events/log-parser'; | ||
|
||
export default async function(server, options= {}) { | ||
if (!server) | ||
throw new Error( | ||
'DiscordAdminCamLogs must be provided with a reference to the server.' | ||
); | ||
|
||
server.on(LOG_PARSER_TEAMKILL, info => { | ||
// ignore suicides | ||
if(info.attacker.steamID === info.victim.steamID) return; | ||
server.rcon.execute(`AdminWarn "${info.attacker.steamID}" ${options.message || 'Please apologise for ALL TKs in ALL chat!'}`); | ||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default async function plugin( | ||
export default async function( | ||
server, | ||
discordClient, | ||
channelID, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters