Raised This Month: $ Target: $400
 0% 

Error: Expected token: "]", but found "-identifier-"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
orglee
Member
Join Date: Dec 2005
Old 07-27-2009 , 12:25   Error: Expected token: "]", but found "-identifier-"
Reply With Quote #1

I'm trying to remake mapsmenu plugin using new style menus but I've got an error... one every few minutes. Currently one below

PHP Code:
public MenuVoteMapHandle(iPlayerMenuItem)
{
    new 
sData[24], sName[64];
    new 
accesscallback;    
    
menu_item_getinfo(MenuItemaccesssData23sName63callback);
    
menu_destroy(Menu);
    
    if(
equali(sData"vote"))
    {
        if(
sizeof(gMapsSelected[iPlayer]) == 0)
        {
            
MenuVoteMap(iPlayer0);
        } else
        if(
sizeof(gMapsSelected[iPlayer]) == 1)
        {
            
MenuVoteMapSingle(iPlayersMapName
        
}
    } else
    if(
Item != MENU_BACK && Item != MENU_MORE && Item != MENU_EXIT)
    {
        if(
sizeof(gMapsSelected[iPlayer]) >= MAPS_VOTE_MAX)
        {
            
ArrayClear(gMapsSelected[iPlayer]);
        }
        
ArrayPushCell(gMapsSelected[iPlayer], str_to_num(sData));
    } else {
        
client_cmd(iPlayer"say test");
    }

There seems to be something wrong with line:
Quote:
if(sizeof(gMapsSelected[iPlayer]) == 0)
The definition of this global variable is as fallows:
Quote:
new gMapsSelected[33][4];
orglee is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-27-2009 , 12:30   Re: Error: Expected token: "]", but found "-identifier-"
Reply With Quote #2

MenuVoteMapSingle(iPlayer, sMapName

you forget );
__________________
xPaw is offline
orglee
Member
Join Date: Dec 2005
Old 07-27-2009 , 12:37   Re: Error: Expected token: "]", but found "-identifier-"
Reply With Quote #3

Thanks, I haven't noticed but the problem still remains.
orglee is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-27-2009 , 12:39   Re: Error: Expected token: "]", but found "-identifier-"
Reply With Quote #4

You can do
if(sizeof(gMapsSelected[iPlayer]) == 0)
->
if( !gMapsSelected[iPlayer][0] )
__________________
xPaw is offline
Reply


Thread Tools
Display Modes

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 18:22.


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