AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   errors compiling: invalid function, should return a value, already declared [solved] (https://forums.alliedmods.net/showthread.php?t=87366)

Owyn 03-10-2009 15:19

errors compiling: invalid function, should return a value, already declared [solved]
 
Code:

public menu_handler3(id, menu, item)
 {
  if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }

    new data[6], iName[64]
    new access, callback

    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)

    new key = str_to_num(data)
 
    switch(key)
    {
        case 1:{
            menu_destroy(menu);
            return PLUGIN_HANDLED;
        }
        case 2:{
            menu_destroy(menu);
            menu1(id);
            return PLUGIN_HANDLED;
        }

        }
    }

    menu_destroy(menu);
    return PLUGIN_HANDLED;
}

function menu_handler3 should return a value
symbol already defined menu_destroy
and it also says that "return PLUGIN_HANDLED" is an invalid function or declaration

YamiKaitou 03-10-2009 15:20

Re: errors compiling: invalid function, should return a value, already declared
 
You have an extra } before the last menu_destroy

Owyn 03-10-2009 15:23

Re: errors compiling: invalid function, should return a value, already declared
 
o lol) indeed


All times are GMT -4. The time now is 09:02.

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