DoesPlayerHaveAccessToCommand
Checks whether a player has access to the given command based on the ACL.
- player: parameter input should be in Client type
- cmd: parameter input should be in string type
{{#tag:syntaxhighlight| [Command("logout", ACLRequired = true)] public void LogoutCommand(Client sender) {
if (!``ACL.DoesPlayerHaveAccessToCommand(sender, "logout"))
\{
sender.SendChatMessage("~r~You can't use that command.");
return;
\}
``ACL.LogoutPlayer(sender);
sender.SendChatMessage("~g~You have been logged out.");
} |lang=csharp}} }}