View Single Post
Author Message
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-16-2013 , 10:26   Why menu doesn't work?
Reply With Quote #1

meta_api:

PHP Code:
int MSGID_ShowMenu 0;

void MessageBegin(int msg_destint msg_type, const float *pOriginedict_t *ed)
{
    static 
bool LoadedMSGS false;

    if(!
LoadedMSGS)
    {
        
MSGID_ShowMenu GET_USER_MSG_ID(PLID"ShowMenu"NULL);

        
LoadedMSGS true;
    }

    
RETURN_META(MRES_IGNORED);
}

void ClientCommand(edict_t *pEntity)
{
    const 
char *szArg;

    
szArg CMD_ARGV(0);

    if (
FStrEq(szArg"jointeam") || FStrEq(szArg"chooseteam"))
    {
        
fw_JoinTeampEntity );
        
RETURN_META(MRES_SUPERCEDE);
    }
    
    
RETURN_META(MRES_IGNORED);

main_menu.cpp:
PHP Code:
#define KEY_1        (1<<0)

extern void fw_JoinTeamedict_t *pEntity );
extern int MSGID_ShowMenu;

void UTIL_ShowMenu(edict_tpEdictint slotsint timechar *menuint mlen);

void fw_JoinTeamedict_t *pPlayer )
{
    
int keys KEY_1;

    
char menu[512];    

    
int len  sprintf(menu"\\yMain Menu\n\n\
                 \\r1.\\w Menu"
);

    
UTIL_ShowMenupPlayerkeys, -1menulen);
}

void UTIL_ShowMenu(edict_tpEdictint slotsint timechar *menuint mlen)
{
    
char *menu;
    
char c 0;
    
int a;

    if (!
MSGID_ShowMenu)
        return;            
// some games don't support ShowMenu (Firearms)

    
while (*n)
    {
        
mlen;
        if (
175175;
        
mlen -= a;
        
= *(n+=a);
        *
0;
        
        
MESSAGE_BEGIN(MSG_ONEMSGID_ShowMenuNULLpEdict);
        
WRITE_SHORT(slots);
        
WRITE_CHAR(time);
        
WRITE_BYTE(TRUE FALSE);
        
WRITE_STRING(menu);
        
MESSAGE_END();
        *
c;
        
menu n;
    }

All functions are called,but menu,doesn't show.
__________________

Last edited by Bos93; 01-16-2013 at 13:29.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93