Raised This Month: $ Target: $400
 0% 

Unknown command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shouldercannon
BANNED
Join Date: Sep 2009
Location: Russia, Penza
Old 12-13-2010 , 01:23   Unknown command
Reply With Quote #1

I opened the menu via AntiSpam (public Action:AntiSpam(client, args)). After entering command the menu opens, but the console says Unknown command: utrcm. Where is error?
PHP Code:
...
new 
Handle:mainmenu INVALID_HANDLE;
new 
LastRadioCommandUse[65];
new 
Note[65];
...
public 
OnPluginStart()
{    
    for (new 
064i++)
    {
        
LastRadioCommandUse[i] = -1;
    }
    
    
mainmenu CreateMenu(MainMenuHandler);
    
SetMenuTitle(mainmenu"Simple Menu");
    
AddMenuItem(mainmenu"_""Menu");
    
SetMenuExitButton(mainmenutrue);
    
    
RegConsoleCmd("utrcm"AntiSpam);
}

public 
Action:AntiSpam(clientargs)
{        
    if (
LastRadioCommandUse[client] == -1)
    {
        
LastRadioCommandUse[client] = GetTime();
        
ShowMenu(clientargs);
        return 
Plugin_Continue;
    }
    
    new 
Time GetTime() - LastRadioCommandUse[client];
    new 
BlockTime 5;
    if (
Time >= BlockTime)
    {
        
LastRadioCommandUse[client] = GetTime();
        
ShowMenu(clientargs);
        return 
Plugin_Continue;
    }
    
    new 
WaitTime BlockTime Time;
        
    if ((
Note[client] != WaitTime))
    {
        if (
WaitTime <= 1)
        {
            
PrintToChat(client"\x04Wait 1 second");
        }
        else
        {
            
PrintToChat(client"\x04Wait %d seconds"WaitTime);
        }
    }
    
    
Note[client] = WaitTime;
    return 
Plugin_Handled;
}

public 
Action:ShowMenu(clientargs)
{
    
DisplayMenu(mainmenuclient20);
    return 
Plugin_Handled;

Shouldercannon is offline
Send a message via ICQ to Shouldercannon
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 12-13-2010 , 02:26   Re: Unknown command
Reply With Quote #2

return Plugin_Coninue makes it say "Unknown Command". return Plugin_Handled stops that.
__________________
Silvers is offline
Shouldercannon
BANNED
Join Date: Sep 2009
Location: Russia, Penza
Old 12-13-2010 , 03:43   Re: Unknown command
Reply With Quote #3

Thanks.
Shouldercannon is offline
Send a message via ICQ to Shouldercannon
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 01:50.


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