Raised This Month: $12 Target: $400
 3% 

How to use CheckCommandAcces


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sukodaime
Junior Member
Join Date: May 2021
Old 06-07-2021 , 02:39   How to use CheckCommandAcces
Reply With Quote #1

bool CheckCommandAccess(int client, const char[] command, int flags, bool override_only)
i couldnt really understand what this mean

CheckCommandAccess(client,"sm_ban", ADMFLAG_RESERVATION,false)
does this mean return true if he has !ban acces or he is slot (has flag reservation)?

and if they have flag d do they automatically have flag a or the owner should do it?
sukodaime is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 06-07-2021 , 04:47   Re: How to use CheckCommandAcces
Reply With Quote #2

Quote:
Originally Posted by sukodaime View Post
bool CheckCommandAccess(int client, const char[] command, int flags, bool override_only)
i couldnt really understand what this mean

CheckCommandAccess(client,"sm_ban", ADMFLAG_RESERVATION,false)
does this mean return true if he has !ban acces or he is slot (has flag reservation)?

and if they have flag d do they automatically have flag a or the owner should do it?
https://sourcemod.dev/#/console/func...kCommandAccess everything is explained here.
ESK0 is offline
sukodaime
Junior Member
Join Date: May 2021
Old 06-07-2021 , 12:33   Re: How to use CheckCommandAcces
Reply With Quote #3

Quote:
Originally Posted by ESK0 View Post
i know i always check https://sm.alliedmods.net/new-api/ before writing here but i couldn't understand "The string can be any override string, as overrides can be independent of commands" because i dont know what is the override string.
and i cant test the plugin because i cant open my local server, i can see my server in lan but i cant connect it. it redirects me to lobby

Last edited by sukodaime; 06-07-2021 at 12:34.
sukodaime is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 06-07-2021 , 16:55   Re: How to use CheckCommandAcces
Reply With Quote #4

Yeah the documents are kinda confusing sometimes (even people refusing that it is not clear for everybody)

I usually use this command like this:

PHP Code:
    if (!CheckCommandAccess(client"sm_somecommandhere"0))
        return; 
To exit the function if the user don't have "access",
You can use "CheckCommandAccess" for other things aswell,
But I usually use to check if someone has access to a command and if it has, then I allow something.

Maybe is not right what I thought it does but this is some background that I have.
__________________

Last edited by Marttt; 06-07-2021 at 16:56.
Marttt is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 06-08-2021 , 04:29   Re: How to use CheckCommandAcces
Reply With Quote #5

I did a write up to explain CheckCommandAccess here. The "command name" is intended to describe some sort of access - it could be associated with an existing command (at which point you should set override_only to false so it determines access based on that command), or you can make up a name.

Server operators can then modify admin_overrides.cfg or use some other plugin that restricts which players have access to that thing.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode