Plugin API
This document outlines the methods and hooks available in the plugin API for managing player actions and server events.
Methods
RA_BanPlayer
Bans a player from the server.
csharp
void RA_BanPlayer(string steam_id, string reason, string duration, bool global, bool ban_ip, string comment = "")Parameters:
steam_id: The player's Steam ID.reason: The reason for the ban.duration: The duration of the ban (e.g., "1h", "1d", "permanent").global: Whether the ban applies globally across servers.ban_ip: Whether to ban the player's IP address.comment: Optional comment for the ban (default: empty string).
RustApp_PlayerMuteCreate
Mutes a player in chat.
csharp
void RustApp_PlayerMuteCreate(string targetSteamId, string reason, string duration, string comment, string referenceMessageText, bool broadcast)- Parameters:
targetSteamId: The Steam ID of the player to mute.reason: The reason for the mute.duration: The duration of the mute (e.g., "1h", "1d").comment: Additional comment for the mute.referenceMessageText: Reference text for the muted message.broadcast: Whether to broadcast the mute to other players.
RA_DirectMessageHandler
Saves a player's direct message.
csharp
void RA_DirectMessageHandler(string from, string to, string message)- Parameters:
from: The Steam ID of the sender.to: The Steam ID of the recipient.message: The content of the message.
RA_ReportSend
Submits a report against a player.
csharp
void RA_ReportSend(string initiator_steam_id, string target_steam_id, string reason, string message = "")- Parameters:
initiator_steam_id: The Steam ID of the player submitting the report.target_steam_id: The Steam ID of the reported player.reason: The reason for the report.message: Optional additional details (default: empty string).
Hooks
RustApp_CanIgnoreBan
Called before checking for bans. If non-null is returned, ban checks are skipped.
csharp
object RustApp_CanIgnoreBan(string steam_id)
{
// Example: Allow a specific player to bypass ban checks
if (steam_id == "YourSteamID64")
{
return false; // Skips ban checks
}
return null; // Performs ban checks
}- Parameters:
steam_id: The Steam ID of the player.
- Returns: Non-
nullto skip ban checks,nullto perform them.
RustApp_OnCheckNoticeShowed
Triggered when a check notification is displayed.
csharp
void RustApp_OnCheckNoticeShowed(BasePlayer player)
{
Server.Broadcast($"{player.displayName} has been called for a check!");
}- Parameters:
player: The player receiving the check notification.
RustApp_OnCheckNoticeHidden
Triggered when a check notification is hidden.
csharp
void RustApp_OnCheckNoticeHidden(BasePlayer player)
{
Server.Broadcast($"{player.displayName}'s check has been completed!");
}- Parameters:
player: The player whose check notification was hidden.
RustApp_OnPaidAnnounceBan
Triggered when a player is banned. Includes a list of players who reported them.
csharp
void RustApp_OnPaidAnnounceBan(BasePlayer player, string steam_id, List<string> initiators)
{
Server.Broadcast($"Player {player.displayName} has been banned! They had {initiators.Count} reports!");
}- Parameters:
player: The banned player.steam_id: The Steam ID of the banned player.initiators: List of Steam IDs of players who reported the banned player.
RustApp_OnPaidAnnounceClean
Triggered when a player is checked and found clean. Includes a list of players who reported them.
csharp
void RustApp_OnPaidAnnounceClean(BasePlayer player, string steam_id, List<string> initiators)
{
Server.Broadcast($"Player {player.displayName} was checked and found clean! They had {initiators.Count} reports!");
}- Parameters:
player: The checked player.steam_id: The Steam ID of the checked player.initiators: List of Steam IDs of players who reported the checked player.