Fixed self reporting

This commit is contained in:
Cooldude2606
2021-04-05 22:55:25 +01:00
parent 3c718fa081
commit 93a446747b
3 changed files with 4 additions and 0 deletions

View File

@@ -173,6 +173,7 @@ return {
},
['command/report'] = {
auth=function(player,selected_player)
if player == selected_player then return false end
if not Roles.player_allowed(player,'command/give-warning') then
return not Roles.player_has_flag(selected_player,'report-immune')
end

View File

@@ -29,6 +29,7 @@ not-jailed=__1__ is not currently in jail.
[expcom-report]
player-immune=This player can not be reported.
self-report=You can not report your self.
non-admin=__1__ was reported for __2__.
admin=__1__ was reported by __2__ for __3__.
already-reported=You can only report a player once, you can ask a moderator to clear this report.

View File

@@ -28,6 +28,8 @@ Commands.new_command('report', 'Reports a player and notifies moderators')
if not input then return end
if Roles.player_has_flag(input, 'report-immune') then
return reject{'expcom-report.player-immune'}
elseif player == input then
return reject{'expcom-report.self-report'}
else
return input
end