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

Person with flag join and make command server side


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrullSin
Senior Member
Join Date: Jun 2018
Old 11-03-2018 , 16:22   Person with flag join and make command server side
Reply With Quote #1

Is there a plugin that when someone have any flag and join the server, it will make a command, server side?
TrullSin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-04-2018 , 02:55   Re: Person with flag join and make command server side
Reply With Quote #2

Quote:
Originally Posted by TrullSin
Could you tell me out here,

Im trying to every time someone with any flag join the server it will make a command, my code is this:

PHP Code:
public OnClientPostAdminCheck(client

    if(
IsFakeClient(client)) 
    { 
        return; 
    } 

    if(
CheckCommandAccess(client"ipanel"ADMFLAG_GENERIC)) 
    { 
            
ServerCommand("sm_reloadtags");
            
ServerCommand("sm_reloadccc");
            
ServerCommand("sm_rechecktags");
    } 

But that will only check for GENERIC, and I was wondering if I could do this:
PHP Code:
public OnClientPostAdminCheck(client

    if(
IsFakeClient(client)) 
    { 
        return; 
    } 

    
    
int flags ReadFlagString(myflags);
    if (
GetUserFlagBits(client) & flags == flags)
    { 
            
ServerCommand("sm_reloadtags");
            
ServerCommand("sm_reloadccc");
            
ServerCommand("sm_rechecktags");
    } 

(Do I need to put anything else in the code?)

It is stupid do make this, but sometimes is like if the plugin that I use to make the tags in the server doesent work and I need to recheck the tags, and this is a way to "prevent", everytime a player with any flag joins the server the server will reload the tags and he will get them, maybe there is an easy to way to make that. I was also thinking about an alternative to ServerCommand and like make the command client side even if they dont have perms.
CheckCommandAccess works fine.
And with this, you can override admin flags to else later without touching plugin code.
https://sm.alliedmods.net/new-api/co...kCommandAccess

Also, to get admin 'hierarchy' work nicely, don't give adminflag "Z" (root) to anyone. This bypass all things.


Here example, with multiple admin flags.
And this would be 'default' admin flags in plugin code when compile.
PHP Code:

// Admin who have access to all admin flags "abc" or word "ipanel".
if(CheckCommandAccess(client"ipanel"ADMFLAG_RESERVATION|ADMFLAG_GENERIC|ADMFLAG_KICK)) 

Ok, you have compiled plugin but you are not satisfied with these admin flags ?
Go admin_overrides.cfg and override "ipanel"
admin_overrides.cfg

Now this "ipanel" have turn admin flags "abc" to -> "ap"



*edit
There is also possibility to restrict access to 'commands' in admin groups. So admin flags are not only thing in SourceMod.
__________________
Do not Private Message @me

Last edited by Bacardi; 11-04-2018 at 02:58.
Bacardi is offline
Reply



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 13:01.


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