Raised This Month: $ Target: $400
 0% 

PodBots getting killed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-06-2018 , 09:17   PodBots getting killed
Reply With Quote #1

I'm using this code to automatically choose a team and class for players, it works just fine for me but I see PodBots get killed as soon as they spawn, what is the reason?

PHP Code:
// Old Style Menus
stock const FIRST_JOIN_MSG[ ]       =   "#Team_Select";
stock const FIRST_JOIN_MSG_SPEC[ ]  =    "#Team_Select_Spect";
stock const INGAME_JOIN_MSG[ ]      =    "#IG_Team_Select";
stock const INGAME_JOIN_MSG_SPEC[ ] =    "#IG_Team_Select_Spect";
const 
iMaxLen sizeofINGAME_JOIN_MSG_SPEC );

// New VGUI Menus
stock const VGUI_JOIN_TEAM_NUM =    2;

public 
plugin_init( )
{
    
register_messageget_user_msgid"ShowMenu" ), "MsgShowMenu" );
    
register_messageget_user_msgid"VGUIMenu" ), "MsgVGUIMenu" );
}

public 
MsgVGUIMenuiMsgIdiDestid )
{
    if( 
get_msg_arg_int) != VGUI_JOIN_TEAM_NUM )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    if( 
<= get_user_teamid ) <= )
    return 
PLUGIN_HANDLED;
    
    new 
szParameters];
    
szParameters] = id;
    
szParameters] = iMsgId;
    
    
set_task0.1"OnAutoJoin"_szParameterssizeofszParameters ) );
    
    return 
PLUGIN_HANDLED;
}

public 
MsgShowMenuiMsgIdiDestid )
{
    if( 
<= get_user_teamid ) <= )
    return 
PLUGIN_HANDLED;

    static 
szMenuCodeiMaxLen ];
    
get_msg_arg_string4szMenuCodecharsmaxszMenuCode ) );
    
    if( 
equalszMenuCodeFIRST_JOIN_MSG ) || equalszMenuCodeFIRST_JOIN_MSG_SPEC ) )
    {
        new 
szParameters];
        
szParameters] = id;
        
szParameters] = iMsgId;
        
        
set_task0.1"OnAutoJoin"_szParameterssizeofszParameters ) );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED;
}

public 
OnAutoJoin( const szParameters[ ] )
{
    new 
id szParameters];
    new 
iMsgId szParameters];
    
    new 
iMsgBlock get_msg_blockiMsgId );
    
set_msg_blockiMsgIdBLOCK_SET );
    
    new 
iTeam random_num1);
    new 
iClass random_num1);
    
    new 
szClass], szTeam];
    
num_to_striTeamszTeamcharsmaxszTeam ) );
    
num_to_striClassszClasscharsmaxszClass ) );
    
    
log_to_file"TeamDebug.txt""%d %d %s %s"iTeamiClassszTeamszClass );
    
    
engclient_cmdid"jointeam"szTeam );
    
engclient_cmdid"joinclass"szClass );
    
    
set_msg_blockiMsgIdiMsgBlock );

__________________

Last edited by edon1337; 08-06-2018 at 09:19.
edon1337 is offline
 



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 12:49.


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