AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error: Expected token: "]", but found "-identifier-" (https://forums.alliedmods.net/showthread.php?t=98645)

orglee 07-27-2009 12:25

Error: Expected token: "]", but found "-identifier-"
 
I'm trying to remake mapsmenu plugin using new style menus but I've got an error... one every few minutes. :P 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];

xPaw 07-27-2009 12:30

Re: Error: Expected token: "]", but found "-identifier-"
 
MenuVoteMapSingle(iPlayer, sMapName

you forget );

orglee 07-27-2009 12:37

Re: Error: Expected token: "]", but found "-identifier-"
 
Thanks, I haven't noticed but the problem still remains.

xPaw 07-27-2009 12:39

Re: Error: Expected token: "]", but found "-identifier-"
 
You can do
if(sizeof(gMapsSelected[iPlayer]) == 0)
->
if( !gMapsSelected[iPlayer][0] )


All times are GMT -4. The time now is 18:22.

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