Raised This Month: $ Target: $400
 0% 

register_clcmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
olari9
Senior Member
Join Date: May 2009
Old 07-26-2013 , 07:32   Re: register_clcmd
Reply With Quote #1

Okey thanks
__________________
olari9 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-26-2013 , 08:40   Re: register_clcmd
Reply With Quote #2

It's not exactly like this, cmdSSmenu is called for every player who type command in his console.
You have to check admin access then.

You have to check with cmd_access :

PHP Code:
public plugin_init()
{
    
register_clcmd("amx_banmenu""cmdSSmenu"ADMIN_BAN"- displays ban menu");
}

// here, accessLevel is ADMIN_BAN because it has been registered like this, and as long as you don't change it in configs/cmdaccess.ini
public cmdSSmenu(idaccessLevelcommandIndex)
{
    if( 
cmd_access(idaccessLevelcommandIndex0) )
    {
        
// execute code here
    
}
    return 
PLUGIN_HANDLED;

4th arg of cmd_access is the number of arguments required in order to the command can work correctly, command included, so in your case it's 1, but you can pass 0 as well, cmd_access will take in account that number as minimum, so if 1 arg is required, you can pass 0 or 1.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 07-26-2013 , 08:45   Re: register_clcmd
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
4th arg of cmd_access is the number of arguments required in order to the command can work correctly, command included, so in your case it's 1, but you can pass 0 as well, cmd_access will take in account that number as minimum, so if 1 arg is required, you can pass 0 or 1.
Now I get it, thank you for your explanation
TheDS1337 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 20:13.


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