Raised This Month: $ Target: $400
 0% 

Unknown command for mapchooser plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-02-2010 , 09:50   Unknown command for mapchooser plugin
Reply With Quote #1

I just added this 2 lines in plugin_init, and it gives me an Unknown command message in the console:

PHP Code:
    register_clcmd"startvote" "voteNextmap" ADMIN_RCON);
    
register_clcmd"mapvote" "voteNextmap" ADMIN_RCON); 
And voteNextmap is called like that (didn't change anything) :

PHP Code:
public voteNextmap()
{
    new 
winlimit get_cvar_num("mp_winlimit")
    new 
maxrounds get_cvar_num("mp_maxrounds")
    
    if (
winlimit)
    {
        new 
winlimit 2
        
        
if ((g_teamScore[0]) && (g_teamScore[1]))
        {
            
g_selected false
            
return
        }
    }
    else if (
maxrounds)
    {
        if ((
maxrounds 2) > (g_teamScore[0] + g_teamScore[1]))
        {
            
g_selected false
            
return
        }
    } else {
        new 
timeleft get_timeleft()
        
        if (
timeleft || timeleft 129)
        {
            
g_selected false
            
return
        }
    }

    if (
g_selected)
        return

    
g_selected true
    
    
new menu[512], amkeys = (1<<SELECTMAPS 1)

    new 
pos format(menu511g_coloredMenus "\y%L:\w^n^n" "%L:^n^n"LANG_SERVER"CHOOSE_NEXTM")
    new 
dmax = (g_mapNums SELECTMAPS) ? SELECTMAPS g_mapNums
    
    
for (g_mapVoteNum 0g_mapVoteNum dmax; ++g_mapVoteNum)
    {
        
random_num(0g_mapNums 1)
        
        while (
isInMenu(a))
            if (++
>= g_mapNums0
        
        g_nextName
[g_mapVoteNum] = a
        pos 
+= format(menu[pos], 511"%d. %a^n"g_mapVoteNum 1ArrayGetStringHandle(g_mapNamea));
        
mkeys |= (1<<g_mapVoteNum)
        
g_voteCount[g_mapVoteNum] = 0
    
}
    
    
menu[pos++] = '^n'
    
g_voteCount[SELECTMAPS] = 0
    g_voteCount
[SELECTMAPS 1] = 0
    
    
new mapname[32]
    
get_mapname(mapname31)

    if ((
winlimit maxrounds) == && (get_cvar_float("mp_timelimit") < get_cvar_float("amx_extendmap_max")))
    {
        
pos += format(menu[pos], 511"%d. %L^n"SELECTMAPS 1LANG_SERVER"EXTED_MAP"mapname)
        
mkeys |= (1<<SELECTMAPS)
    }

    
format(menu[pos], 511"%d. %L"SELECTMAPS+2LANG_SERVER"NONE")
    new 
MenuName[64]
    
    
format(MenuName63"%L""en""CHOOSE_NEXTM")
    
show_menu(0mkeysmenu15MenuName)
    
set_task(15.0"checkVotes")
    
client_print(0print_chat"%L"LANG_SERVER"TIME_CHOOSE")
    
client_cmd(0"spk Gman/Gman_Choose%i"random_num(12));
    
//client_cmd(0, "spk Gman/Gman_Choose2")
    
log_amx("[AMXX] Vote: Voting for the nextmap started!")

KadiR is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-02-2010 , 11:12   Re: Unknown command for mapchooser plugin
Reply With Quote #2

Does the function run?

If yes:

PHP Code:
return PLUGIN_HANDLED 
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-02-2010 , 12:48   Re: Unknown command for mapchooser plugin
Reply With Quote #3

If the command is issued through console, you will want to return PLUGIN_HANDLED[_MAIN] to prevent it from saying "Unknown command..." in console.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-02-2010 , 20:30   Re: Unknown command for mapchooser plugin
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
If the command is issued through console, you will want to return PLUGIN_HANDLED[_MAIN] to prevent it from saying "Unknown command..." in console.
Sorry for borrowing your thread, Kadir.
Do i return at the end of the function called by the command? Or where do i do it, because i have this problem.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-02-2010 , 20:55   Re: Unknown command for mapchooser plugin
Reply With Quote #5

Quote:
Originally Posted by drekes View Post
Sorry for borrowing your thread, Kadir.
Do i return at the end of the function called by the command? Or where do i do it, because i have this problem.
Where ever you want the function to stop functioning. If you need the whole function to execute then you put it last.
__________________
fysiks is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-02-2010 , 13:10   Re: Unknown command for mapchooser plugin
Reply With Quote #6

Well, the function doesn't run at all.
KadiR is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-03-2010 , 11:33   Re: Unknown command for mapchooser plugin
Reply With Quote #7

Drekes, stop doing that please.
KadiR is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-03-2010 , 12:22   Re: Unknown command for mapchooser plugin
Reply With Quote #8

Quote:
Originally Posted by KadiR View Post
Drekes, stop doing that please.
sorry, i just don't want to spam threads
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 03:33.


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