L 07/23/2017 - 12:29:19: Start of error session.
L 07/23/2017 - 12:29:19: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20170723.log")
L 07/23/2017 - 12:29:19: [AMXX] Displaying debug trace (plugin "NoAdvertisements.amxx", version "unknown")
L 07/23/2017 - 12:29:19: [AMXX] Run time error 4: index out of bounds
L 07/23/2017 - 12:29:19: [AMXX] [0] NoAdvertisements.sma::plugin_init (line 25)
Who can help me to fix this plugin to fix this error and to set autor version ?
PHP Code:
#include < amxmodx >
new g_cSwears[ 128 ][ 32 ];
new g_iSwearsCount;
public plugin_init( )
{
register_clcmd( "say", "ClientCommand_Say" );
register_clcmd( "say_team", "ClientCommand_Say" );
new iFile, cFile[ 512 ], cLine[ 32 ];
get_localinfo( "amxx_configsdir", cFile, 511 );
format( cFile, 511, "%s/swears.ini", cFile );
iFile = fopen( cFile, "rt" );
while( !feof( iFile ) )
{
fgets( iFile, cLine, 31 );
trim( cLine );
if( strlen( cLine ) )
{
copy( g_cSwears[ g_iSwearsCount ], 31, cLine );
g_iSwearsCount++;
}
}
fclose( iFile );
}
public ClientCommand_Say( iPlayer )
{
static cPhrase[ 192 ], i;
read_args( cPhrase, 191 );
if( containi( cPhrase, "csblackdevil.com" ) != -1 )
return PLUGIN_CONTINUE;
for( i = 0; i < g_iSwearsCount; i++ )
{
if( containi( cPhrase, g_cSwears[ i ] ) != -1 )
{
client_cmd( iPlayer, "say www.CsBlackDevil.Com" );
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public client_putinserver( iPlayer )
set_task( 1.0, "Task_CheckName", iPlayer );
public client_infochanged( iPlayer )
set_task( 1.0, "Task_CheckName", iPlayer );
public Task_CheckName( iPlayer )
{
if( is_user_connected( iPlayer ) )
{
static cName[ 32 ], i;
get_user_name( iPlayer, cName, 31 );
if( containi( cName, "csblackdevil.com" ) != -1 )
return;
for( i = 0; i < g_iSwearsCount; i++ )
{
if( containi( cName, g_cSwears[ i ] ) != -1 )
{
client_cmd( iPlayer, "name www.CsBlackDevil.Com" );
break;
}
}
}
}