DoesPlayerHaveAccessToCommand: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 1: Line 1:
==Description==
Checks whether a player has access to the given command based on the ACL.
Checks whether a player has access to the given command based on the ACL.


==Syntax==
 
{{CSharpContainer|
{{#tag:syntaxhighlight|{{Template:CSharp_Serverside_namespace}}ACL.DoesPlayerHaveAccessToCommand(Client player);|lang=csharp}}
{{#tag:syntaxhighlight|{{Template:CSharp_Serverside_namespace}}ACL.DoesPlayerHaveAccessToCommand(Client player);|lang=csharp}}


=== Required Arguments ===
{{Parameters}}
*'''player:''' parameter input should be in '''Client''' type
*'''player:''' parameter input should be in '''Client''' type


==Example==
{{CSharpContainer|
{{Parameters}}
*'''player:''' parameter input should be in '''Client''' type


{{Example}}
{{Example}}

Revision as of 17:36, 27 November 2019

Description

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


C# Syntax

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.IsPlayerLoggedIn(sender)) 
    {
        sender.SendChatMessage("~r~You are not logged in.");
        return;
    }
  
    NAPI.ACL.LogoutPlayer(sender);
    sender.SendChatMessage("~g~You have been logged out.");
}