Module control.reports
Gets a list of all reports that a player has against them
Get functions
Functions used to get information from reports
-
Reports.get_reports (player)
-
Gets a list of all reports that a player has against them
Parameters:
- player
LuaPlayer
the player to get the report for
Returns:
table
a list of all reports, key is by player name, value is reason
-
Reports.get_report (player[, by_player_name='server'])
-
Gets a single report against a player given the name of the player who made the report
Parameters:
- player
LuaPlayer
the player to get the report for
- by_player_name
string
the name of the player who made the report
(default 'server')
Returns:
string or nil
string is the reason that the player was reported, if the player is not reported
-
Reports.is_reported (player[, by_player_name])
-
Checks if a player is reported, option to get if reported by a certain player
Parameters:
- player
LuaPlayer
the player to check if reported
- by_player_name
string
when given will check if reported by this player
(optional)
Returns:
boolean
if the player has been reported
-
Reports.count (player[, custom_count])
-
Counts the number of reports that a player has aganist them
Parameters:
- player
LuaPlayer
the player to count the reports for
- custom_count
function
when given this function will be used to count the reports
(optional)
Returns:
number
the number of reports that the user has
Set functions
Functions used to get information from reports
-
Reports.report_player (player[, by_player_name='server'[, reason='Non Given.']])
-
Adds a report to a player, each player can only report another player once
Parameters:
- player
LuaPlayer
the player to add the report to
- by_player_name
string
the name of the player that is making the report
(default 'server')
- reason
string
the reason that the player is being reported
(default 'Non Given.')
Returns:
boolean
whether the report was added successfully
-
Reports.remove_report (player[, by_player_name='server'])
-
Removes a report from a player
Parameters:
- player
LuaPlayer
the player to remove the report from
- by_player_name
string
the name of the player that made the report
(default 'server')
Returns:
boolean
whether the report was removed successfully
-
Reports.remove_all (player)
-
Removes all reports from a player
Parameters:
- player
LuaPlayer
the player to remove the reports from
Returns:
boolean
whether the reports were removed successfully