Raised This Month: $ Target: $400
 0% 

MESSAGE_END called


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 03-22-2014 , 11:20   MESSAGE_END called
Reply With Quote #1

hi i have a problem, when i select a team from the menu, counter strike crash and show this:

message_end called but message buffer from dll has overflowed

PHP Code:

new g_iMsgId[33]

public 
plugin_init(){
register_clcmd("chooseteam""clcmd_changeteam")
    
register_message(get_user_msgid("ShowMenu"), "TeamMenu_Hook");
    
register_message(get_user_msgid("VGUIMenu"), "TeamMenuVGUI_Hook");
}

public 
TeamMenu_Hook(iMsgiddestid)
{
    static 
szTeamSelect[] = "#Team_Select";
    static 
szMenuTextCode[32];
    
get_msg_arg_string(4szMenuTextCodesizeof szMenuTextCode 1);

    if(
contain(szMenuTextCodeszTeamSelect) > -1)
    {
        
menu_display(idg_menu_equipo)
        return 
PLUGIN_HANDLED;
    }

    
g_iMsgId[id] = iMsgid;

    return 
PLUGIN_CONTINUE;
}

public 
TeamMenuVGUI_Hook(iMsgiddestid)
{
    if(
get_msg_arg_int(1) == 2)
    {
        
menu_display(idg_menu_equipo)
        return 
PLUGIN_HANDLED;
    }
    else if(
get_msg_arg_int(1) == 26)
    {
        
team_join(id0);
        return 
PLUGIN_HANDLED;
    }
    else if(
get_msg_arg_int(1) == 27)
    {
        
team_join(id1);
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}

stock team_join(idiTeam)
{
    if(
is_user_bot(id)) return 
    
    new 
szTeam[2];
    new 
iMenuMsgid g_iMsgId[id];
    new 
iMsgBlock get_msg_block(iMenuMsgid)

    
num_to_str(iTeam+1szTeam1);
    
set_msg_block(iMenuMsgidBLOCK_SET);
    
engclient_cmd(id"jointeam"szTeam);
    
set_msg_block(iMenuMsgidiMsgBlock);
    
    
    
engclient_cmd(id"joinclass""5");

edit: this cause the crash: engclient_cmd(id, "jointeam", szTeam);

i can use jointeam command in console and works fine :/
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"

Last edited by Roccoxx; 03-22-2014 at 14:04.
Roccoxx is offline
Send a message via MSN to Roccoxx
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 03-22-2014 , 21:38   Re: MESSAGE_END called
Reply With Quote #2

set_task...
you cannot create new messages in hook message
__________________
Destro- is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 03-22-2014 , 22:00   Re: MESSAGE_END called
Reply With Quote #3

Quote:
Originally Posted by Destro- View Post
set_task...
you cannot create new messages in hook message
thanks ema e.e

i edit this and works fine for my mod.

PHP Code:
public TeamMenuVGUI_Hook(iMsgiddestid)
{
    if(
get_msg_arg_int(1) == 2)
    {
        
menu_display(idg_menu_equipo)
        return 
PLUGIN_HANDLED;
    }
    else if(
get_msg_arg_int(1) == 26 || get_msg_arg_int(1) == 27)
        return 
PLUGIN_HANDLED;
        
    return 
PLUGIN_CONTINUE;

__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
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 00:23.


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