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

cs 1.6 flag selection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GGC Theos
Junior Member
Join Date: Sep 2022
Old 09-14-2022 , 22:08   cs 1.6 flag selection
Reply With Quote #1

Hello guys, someone know how to select who will have access in a plugin? and change the flag to me only (creator). Thank you

I gave u the sma file too.
Attached Files
File Type: sma Get Plugin or Get Source (trainingmenu.sma - 45 views - 28.5 KB)
GGC Theos is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-15-2022 , 00:20   Re: cs 1.6 flag selection
Reply With Quote #2

Add a check for access at the beginning of each of the functions to which you want to restrict access:

PHP Code:
    if( !access(idADMIN_LEVEL_A) )
    {
        return 
PLUGIN_HANDLED;
    } 
You'll need to include amxmisc.inc.
__________________

Last edited by fysiks; 09-21-2022 at 00:48. Reason: Added semicolon due to the code requiring it via pragma
fysiks is offline
GGC Theos
Junior Member
Join Date: Sep 2022
Old 09-15-2022 , 00:23   Re: cs 1.6 flag selection
Reply With Quote #3

Thank you. i need to define ADMIN_LEVEL_A too right?
GGC Theos is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-15-2022 , 00:41   Re: cs 1.6 flag selection
Reply With Quote #4

Quote:
Originally Posted by GGC Theos View Post
Thank you. i need to define ADMIN_LEVEL_A too right?
No, all of the admin flags are defined in amxconst.inc.
__________________
fysiks is offline
GGC Theos
Junior Member
Join Date: Sep 2022
Old 09-15-2022 , 00:45   Re: cs 1.6 flag selection
Reply With Quote #5

Thanks a lot my man!
GGC Theos is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-15-2022 , 00:46   Re: cs 1.6 flag selection
Reply With Quote #6

FYI, I forgot to add the "not" (!) for the access check. I've fixed that above.
__________________
fysiks is offline
GGC Theos
Junior Member
Join Date: Sep 2022
Old 09-20-2022 , 06:37   Re: cs 1.6 flag selection
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
FYI, I forgot to add the "not" (!) for the access check. I've fixed that above.

Okay okay thank you mate. i will restrict access for players and admins (only creators will have it)
GGC Theos is offline
GGC Theos
Junior Member
Join Date: Sep 2022
Old 09-20-2022 , 07:08   Re: cs 1.6 flag selection
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
FYI, I forgot to add the "not" (!) for the access check. I've fixed that above.
It has errors and i cant compile it. i also put the semicolon in return_handled;
but something went wrong
GGC Theos is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-21-2022 , 00:50   Re: cs 1.6 flag selection
Reply With Quote #9

Please attach your edited version so that we can see what your modifications look like. Adding the semicolon after the "return PLUGIN_HANDLED" is required due to the "#pragma semicolon 1;" (I've updated my example above accordingly).
__________________
fysiks 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:39.


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