DoesPlayerHaveAccessToCommand

From RAGE Multiplayer Wiki
Revision as of 09:13, 27 November 2019 by Xabi (talk | contribs) (Created page with "Checks whether a player has access to the given command based on the ACL. ==Syntax== {{#tag:pre|{{Template:CSharp_Serverside_namespace}}ACL.DoesPlayerHaveAccessToCommand(Clie...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Syntax

NAPI.ACL.DoesPlayerHaveAccessToCommand(Client player);

Required Arguments

  • player: parameter input should be in Client type

Example

C# Syntax

Parameters

  • player: parameter input should be in Client type

Example

[Command("logout", ACLRequired = true)]
public void LogoutCommand(Client sender)
{
    if (!NAPI.ACL.IsPlayerLoggedIn(sender)) 
    {
        sender.SendChatMessage("~r~You are not logged in.");
        return;
    }
  
    NAPI.ACL.LogoutPlayer(sender);
    sender.SendChatMessage("~g~You have been logged out.");
}