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

Give player access to a command by steamid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 01-09-2016 , 09:57   Give player access to a command by steamid
Reply With Quote #1

I can't find how to give access to a player on a command by STEAMID instead of ADMFLAG...Any way to do that ?
PS(more specific): I don't want a plugin that gives access to an player, I want to use the steamid instead of ADMFLAG_<FLAG>...
PHP Code:
RegAdminCmd("COMMAND"AdminCmd_CommandADMFLAG_<FLAG>, "what does the command do."); 
__________________
valio_skull is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 01-09-2016 , 10:06   Re: Give player access to a command by steamid
Reply With Quote #2

check their steamid in the command or use the overrides system
Miu is offline
Godis
Senior Member
Join Date: Jan 2014
Old 01-09-2016 , 10:10   Re: Give player access to a command by steamid
Reply With Quote #3

Do you want many users to be able to use the command by steamid or just one?
Godis is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 01-09-2016 , 10:22   Re: Give player access to a command by steamid
Reply With Quote #4

Quote:
Originally Posted by Godis View Post
Do you want many users to be able to use the command by steamid or just one?
I want just one user, but I want it to use ADMFLAG too
example:
if client is admin, he has access
if client's steam id is X, he has access
NOT BOTH, if client has one of them (steamid/admflag), he has access to the command
__________________
valio_skull is offline
Godis
Senior Member
Join Date: Jan 2014
Old 01-09-2016 , 11:29   Re: Give player access to a command by steamid
Reply With Quote #5

PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_cmd"Cmd_Command);
}

public 
Action Cmd_Command(int clientint args)
{
    
char auth[32];
    
GetClientAuthId(clientAuthId_Steam2authsizeof(auth));
    
    if(
CheckCommandAccess(client"sm_cmd_override"ADMFLAG_<flag>) || StrEqual(auth"STEAM_ID"))
    {
        if(
args 1)
        {
            
ReplyToCommand(client"[SM] Usage: sm_cmd <#userid|name>");
            return 
Plugin_Handled;
        }
        
        return 
Plugin_Handled;
    }
    
    
ReplyToCommand(client"[SM] You do not have access to this command.");
    return 
Plugin_Handled;

Something like this.
Godis is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-09-2016 , 12:28   Re: Give player access to a command by steamid
Reply With Quote #6

Please use if/else statement as suggested in the above post. Check if the ID matches with the one and print the statement.
__________________

Last edited by Spirit_12; 01-10-2016 at 18:23. Reason: Auto-Corrent struck again!
Spirit_12 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 05:53.


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