Raised This Month: $ Target: $400
 0% 

register_clcmd


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-26-2013 , 08:40   Re: register_clcmd
Reply With Quote #5

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
 



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 06:28.


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