Участник
Пользователь
- Сообщения
- 366
- Реакции
- 5
- Предупреждения
- 5
- Помог
- 1 раз(а)
Неверный раздел форума
Creates error logos 1
L 05/08/2020 - 20:33:49: [AMXX] Run time error 4 (plugin "autospec_and_5v5teamlimit.amxx") - debug not enabled!
L 05/08/2020 - 20:33:49: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
plugins.ini
autospec_and_5v5teamlimit.amxx debug
Creates error logos 2
L 05/10/2020 - 00:34:44: [AMXX] Run time error 4: index out of bounds
L 05/10/2020 - 00:34:44: [AMXX] [0] autospec_and_5v5teamlimit.sma::ClientCommand_Team (line 52)
L 05/08/2020 - 20:33:49: [AMXX] Run time error 4 (plugin "autospec_and_5v5teamlimit.amxx") - debug not enabled!
L 05/08/2020 - 20:33:49: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
plugins.ini
autospec_and_5v5teamlimit.amxx debug
Creates error logos 2
L 05/10/2020 - 00:34:44: [AMXX] Run time error 4: index out of bounds
L 05/10/2020 - 00:34:44: [AMXX] [0] autospec_and_5v5teamlimit.sma::ClientCommand_Team (line 52)
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#define VGUI_SELECT_TEAM 2
#define MENU_JOINTEAM 1
#define GAMESTATE_JOINTEAM 4
#define XO_PLAYER 5
#define m_iPlayerTeam 114
#define m_iJoiningState 121
#define m_bHasChangeTeamThisRound 125
#define m_iMenu 205
new g_pcvarTeamLimit;
public plugin_init()
{
register_plugin( "Auto Spec + Team Limiter", "0.0.1", "hornet" );
register_clcmd( "jointeam", "ClientCommand_Team" );
register_clcmd( "chooseteam", "ClientCommand_Team" );
register_clcmd( "menuselect", "ClientCommand_Team" );
register_message( get_user_msgid( "MOTD" ), "Message_MOTD" );
register_message( get_user_msgid( "ShowMenu" ), "Message_ShowMenu" );
register_message( get_user_msgid( "VGUIMenu" ), "Message_VGUIMenu" );
g_pcvarTeamLimit = register_cvar( "pug_team_limit", "5" );
}
public client_disconnected( id )
{
remove_task( id );
}
public ClientCommand_Team( id )
{
if( ( get_pdata_int( id, m_iMenu ) == MENU_JOINTEAM && get_pdata_int( id, m_iJoiningState ) == GAMESTATE_JOINTEAM ) || get_pdata_int( id, m_iPlayerTeam ) == 3 )
{
new Players[ 32 ], iNum[ 3 ];
get_players( Players, iNum[ 2 ], "e", "CT" );
get_players( Players, iNum[ 1 ], "e", "TERRORIST" );
new szArg[ 4 ];
read_argv( 1, szArg, charsmax( szArg ) );
new iTeam = str_to_num( szArg );
if( iNum[ iTeam ] >= get_pcvar_num( g_pcvarTeamLimit ) )
{
client_print( id, print_center, "The team is full!" );
engclient_cmd( id, "jointeam", "3" );
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public Message_MOTD()
{
return PLUGIN_HANDLED;
}
public Message_ShowMenu( iMsg, iDest, id )
{
if( cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )
return PLUGIN_CONTINUE;
static MESSAGE[] = "#Team_Select", szMsg[ charsmax( MESSAGE ) ];
get_msg_arg_string( 4, szMsg, charsmax( szMsg ) );
if( equal( szMsg, MESSAGE ) )
{
static data[ 2 ];
data[ 0 ] = iMsg;
set_task(0.1, "task_JoinTeam", id, data, sizeof( data ) );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public Message_VGUIMenu( iMsg, iDest, id )
{
if( get_msg_arg_int( 1 ) != VGUI_SELECT_TEAM || cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )
return PLUGIN_CONTINUE;
static data[ 2 ];
data[ 0 ] = iMsg;
set_task(0.1, "task_JoinTeam", id, data, sizeof( data ) );
return PLUGIN_HANDLED;
}
public task_JoinTeam( data[], id )
{
static block;
block = get_msg_block( data[ 0 ] );
set_msg_block( data[0], BLOCK_SET );
engclient_cmd( id, "jointeam", "6" );
set_msg_block( data[0], block );
set_pdata_int( id, m_bHasChangeTeamThisRound, 0, XO_PLAYER )
}
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#define VGUI_SELECT_TEAM 2
#define MENU_JOINTEAM 1
#define GAMESTATE_JOINTEAM 4
#define XO_PLAYER 5
#define m_iPlayerTeam 114
#define m_iJoiningState 121
#define m_bHasChangeTeamThisRound 125
#define m_iMenu 205
new g_pcvarTeamLimit;
public plugin_init()
{
register_plugin( "Auto Spec + Team Limiter", "0.0.1", "hornet" );
register_clcmd( "jointeam", "ClientCommand_Team" );
register_clcmd( "chooseteam", "ClientCommand_Team" );
register_clcmd( "menuselect", "ClientCommand_Team" );
register_message( get_user_msgid( "MOTD" ), "Message_MOTD" );
register_message( get_user_msgid( "ShowMenu" ), "Message_ShowMenu" );
register_message( get_user_msgid( "VGUIMenu" ), "Message_VGUIMenu" );
g_pcvarTeamLimit = register_cvar( "pug_team_limit", "5" );
}
public client_disconnected( id )
{
remove_task( id );
}
public ClientCommand_Team( id )
{
if( ( get_pdata_int( id, m_iMenu ) == MENU_JOINTEAM && get_pdata_int( id, m_iJoiningState ) == GAMESTATE_JOINTEAM ) || get_pdata_int( id, m_iPlayerTeam ) == 3 )
{
new Players[ 32 ], iNum[ 3 ];
get_players( Players, iNum[ 2 ], "e", "CT" );
get_players( Players, iNum[ 1 ], "e", "TERRORIST" );
new szArg[ 4 ];
read_argv( 1, szArg, charsmax( szArg ) );
new iTeam = str_to_num( szArg );
if( iNum[ iTeam ] >= get_pcvar_num( g_pcvarTeamLimit ) )
{
client_print( id, print_center, "The team is full!" );
engclient_cmd( id, "jointeam", "3" );
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public Message_MOTD()
{
return PLUGIN_HANDLED;
}
public Message_ShowMenu( iMsg, iDest, id )
{
if( cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )
return PLUGIN_CONTINUE;
static MESSAGE[] = "#Team_Select", szMsg[ charsmax( MESSAGE ) ];
get_msg_arg_string( 4, szMsg, charsmax( szMsg ) );
if( equal( szMsg, MESSAGE ) )
{
static data[ 2 ];
data[ 0 ] = iMsg;
set_task(0.1, "task_JoinTeam", id, data, sizeof( data ) );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public Message_VGUIMenu( iMsg, iDest, id )
{
if( get_msg_arg_int( 1 ) != VGUI_SELECT_TEAM || cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )
return PLUGIN_CONTINUE;
static data[ 2 ];
data[ 0 ] = iMsg;
set_task(0.1, "task_JoinTeam", id, data, sizeof( data ) );
return PLUGIN_HANDLED;
}
public task_JoinTeam( data[], id )
{
static block;
block = get_msg_block( data[ 0 ] );
set_msg_block( data[0], BLOCK_SET );
engclient_cmd( id, "jointeam", "6" );
set_msg_block( data[0], block );
set_pdata_int( id, m_bHasChangeTeamThisRound, 0, XO_PLAYER )
}