DoesPlayerHaveAccessToCommand

From RAGE Multiplayer Wiki
Revision as of 20:41, 27 November 2019 by Xabi (talk | contribs)

Checks whether a player has access to the given command based on the ACL.


C# Syntax

bool NAPI.ACL.DoesPlayerHaveAccessToCommand(Client player);

Parameters

  • player: parameter input should be in Client type


Example

[Command("logout", ACLRequired = true)]
public void LogoutCommand(Client sender)
{
    if (!NAPI.ACL.DoesPlayerHaveAccessToCommand(sender, "logout")) 
    {
        sender.SendChatMessage("~r~You can't use that command.");
        return;
    }
  
    NAPI.ACL.LogoutPlayer(sender);
    sender.SendChatMessage("~g~You have been logged out.");
}