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(iMsgid, dest, id)
{
static szTeamSelect[] = "#Team_Select";
static szMenuTextCode[32];
get_msg_arg_string(4, szMenuTextCode, sizeof szMenuTextCode - 1);
if(contain(szMenuTextCode, szTeamSelect) > -1)
{
menu_display(id, g_menu_equipo)
return PLUGIN_HANDLED;
}
g_iMsgId[id] = iMsgid;
return PLUGIN_CONTINUE;
}
public TeamMenuVGUI_Hook(iMsgid, dest, id)
{
if(get_msg_arg_int(1) == 2)
{
menu_display(id, g_menu_equipo)
return PLUGIN_HANDLED;
}
else if(get_msg_arg_int(1) == 26)
{
team_join(id, 0);
return PLUGIN_HANDLED;
}
else if(get_msg_arg_int(1) == 27)
{
team_join(id, 1);
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
stock team_join(id, iTeam)
{
if(is_user_bot(id)) return
new szTeam[2];
new iMenuMsgid = g_iMsgId[id];
new iMsgBlock = get_msg_block(iMenuMsgid)
num_to_str(iTeam+1, szTeam, 1);
set_msg_block(iMenuMsgid, BLOCK_SET);
engclient_cmd(id, "jointeam", szTeam);
set_msg_block(iMenuMsgid, iMsgBlock);
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 :/
__________________