update action on report to use level enum string

This commit is contained in:
RaidMax 2022-03-07 20:00:05 -06:00
parent 9f4d06c265
commit 42313b7816

View File

@ -1,13 +1,12 @@
let plugin = { let plugin = {
author: 'RaidMax', author: 'RaidMax',
version: 1.0, version: 1.1,
name: 'Action on Report', name: 'Action on Report',
enabled: false, // indicates if the plugin is enabled enabled: false, // indicates if the plugin is enabled
reportAction: 'TempBan', // can be TempBan or Ban reportAction: 'TempBan', // can be TempBan or Ban
maxReportCount: 5, // how many reports before action is taken maxReportCount: 5, // how many reports before action is taken
tempBanDurationMinutes: 60, // how long to temporarily ban the player tempBanDurationMinutes: 60, // how long to temporarily ban the player
eventTypes: { 'report': 103 }, eventTypes: { 'report': 103 },
permissionTypes: { 'trusted': 2 },
onEventAsync: function (gameEvent, server) { onEventAsync: function (gameEvent, server) {
if (!this.enabled) { if (!this.enabled) {
@ -15,7 +14,7 @@ let plugin = {
} }
if (gameEvent.Type === this.eventTypes['report']) { if (gameEvent.Type === this.eventTypes['report']) {
if (!gameEvent.Target.IsIngame || gameEvent.Target.Level >= this.permissionTypes['trusted']) { if (!gameEvent.Target.IsIngame || gameEvent.Target.Level !== 'User') {
server.Logger.WriteInfo(`Ignoring report for client (id) ${gameEvent.Target.ClientId} because they are privileged or not ingame`); server.Logger.WriteInfo(`Ignoring report for client (id) ${gameEvent.Target.ClientId} because they are privileged or not ingame`);
return; return;
} }