AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bug (https://forums.alliedmods.net/showthread.php?t=213832)

risontek22 04-19-2013 11:21

Bug
 
hi everyone,
i need to fix a bug but a dont know where is the problem. I have team join menu from Hornet
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#define PLUGIN "Team Join Menu"
#define VERSION "1.0"
#define AUTHOR "Hornet"

#define m_iJoinedState    121
#define m_iVGUIMenus  510

#define GAMESTATE_PRE      4
#define GAMESTATE_INGAME    5

new const g_iTeams[] = 
{
    
2,
    
1,
    
3
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_messageget_user_msgid"ShowMenu" ), "Message_ShowMenu" );
    
register_messageget_user_msgid"VGUIMenu" ), "Message_VguiMenu" );
    
register_clcmd"chooseteam""ClientCommand_Team" )
    
register_clcmd("jointeam""hack")
}
public 
Message_ShowMenuiMsgiDestid 
{
    static 
szMsg[] = "#Team_Select";
    static 
szArgsizeof szMsg ];
    
    
get_msg_arg_string4szArgsizeof szArg );
    
    if( !
equalszArgszMsg ) )
        return 
PLUGIN_CONTINUE;
    
    
set_pdata_intidm_iVGUIMenus);
    
    static 
szInfo];
    
szInfo] = iMsg;
    
    
set_task0.1"Task_ForceJoin"idszInfosizeof szInfo );
    
    return 
PLUGIN_HANDLED;
}

public 
Message_VguiMenuiMsgiDestid 
{
    static 
szInfo];
    
szInfo] = iMsg;
    
    
set_task0.1"Task_ForceJoin"idszInfosizeof szInfo );
    
    return 
PLUGIN_HANDLED;
}

public 
ClientCommand_Teamid )
{
    
Menu_Teamid );
    
    return 
PLUGIN_HANDLED;
}

public 
Task_ForceJoiniMsg[], id 
{
    new 
Block get_msg_blockiMsg] );
    
    
set_msg_blockiMsg], BLOCK_SET );
    
set_msg_blockiMsg], Block );
    
    
Menu_Teamid );
}

public 
Menu_Teamid )
{
    new 
iMenu menu_create"Vyber si team""MenuHandle_Team" );
    
    
menu_additemiMenu,"Hrat za \yDozorcu" );
    
menu_additemiMenu,"Hrat za \yVazna" );
    
menu_additemiMenu,"Hrat za \yDivaka" );

    if( !
is_user_aliveid ) )
        
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
    
menu_displayidiMenu );
}

public 
MenuHandle_TeamidiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        if( !
is_user_aliveid ) )
            
menu_displayidiMenu );
        else    
menu_destroyiMenu );
        
        return 
PLUGIN_HANDLED;
    }
    
cs_set_user_teamidg_iTeamsiItem ] );
                
    if( 
get_pdata_intidm_iJoinedState ) == GAMESTATE_PRE )
        
set_pdata_intidm_iJoinedStateGAMESTATE_INGAME );
                
    
user_killid );
    
menu_destroyiMenu );
    
    return 
PLUGIN_HANDLED;
}
public 
hack(id)
{
    
client_print(id,print_console,"Nesnaz sa oblafnut tento server lebo na to nemas !")
    return 
PLUGIN_HANDLED


and i have done box
PHP Code:

public box_mod(id)
{
    static 
i
    
if(box_game == 0)
    {
        for(
1<= 32i++)
        {
            if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
            {
                
set_user_health(i100)
                
set_cvar_num("mp_tkpunish"0)
                
set_cvar_num("mp_friendlyfire"1)
                
box_game 1
                teshop
(i)
            }
        }
        
ChatColor(id,"%s Box zapnuty",Prefix)
        
set_hudmessage(85255420.060.8106.04.0)
        
show_hudmessage(0"Box zapnuty")
        
        
emit_sound(0CHAN_AUTObox_generic1.0ATTN_NORM0PITCH_NORM)
        
simon_menu(id)
        return 
PLUGIN_HANDLED
    
}
    else
    {
        if(
box_game == 1)
        {
            for(
1<= 32i++)
            {
                if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
                {
                    
set_user_health(i100)
                    
set_cvar_num("mp_tkpunish"0)
                    
set_cvar_num("mp_friendlyfire"0)
                    
box_game 0
                
}
            }
            
set_hudmessage(85255420.060.8106.04.0)
            
ChatColor(id,"%s Box vypnuty",Prefix)
            
show_hudmessage(0"Box vypnuty")
            
simon_menu(id)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED


and when i have team join menu and box script at once, and then when i turn on the box it show me HUD : You turned box ON and when i try to turn off box then show me the same HUD but when i havent on server Team join menu, then it is normal. PLS HELP MENU ;(


All times are GMT -4. The time now is 10:47.

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