Raised This Month: $51 Target: $400
 12% 

Error Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lantimilan
Senior Member
Join Date: May 2016
Old 07-23-2017 , 17:27   Error Plugin
Reply With Quote #1

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_cSwears128 ][ 32 ];
new 
g_iSwearsCount;

public 
plugin_init( )
{
    
register_clcmd"say""ClientCommand_Say" );
    
register_clcmd"say_team""ClientCommand_Say" );

    new 
iFilecFile512 ], cLine32 ];
    
get_localinfo"amxx_configsdir"cFile511 );
    
formatcFile511"%s/swears.ini"cFile );

    
iFile fopencFile"rt" );

    while( !
feofiFile ) )
    {
        
fgetsiFilecLine31 );

        
trimcLine );

        if( 
strlencLine ) )
        {
            
copyg_cSwearsg_iSwearsCount ], 31cLine );

            
g_iSwearsCount++;
        }
    }

    
fcloseiFile );
}

public 
ClientCommand_SayiPlayer )
{
    static 
cPhrase192 ], i;
    
read_argscPhrase191 );

    if( 
containicPhrase"csblackdevil.com" ) != -)
        return 
PLUGIN_CONTINUE;

    for( 
0g_iSwearsCounti++ )
    {
        if( 
containicPhraseg_cSwears] ) != -)
        {
            
client_cmdiPlayer"say www.CsBlackDevil.Com" );

            return 
PLUGIN_HANDLED;
        }
    }

    return 
PLUGIN_CONTINUE;
}

public 
client_putinserveriPlayer )
    
set_task1.0"Task_CheckName"iPlayer );

public 
client_infochangediPlayer )
    
set_task1.0"Task_CheckName"iPlayer );

public 
Task_CheckNameiPlayer )
{
    if( 
is_user_connectediPlayer ) )
    {
        static 
cName32 ], i;
        
get_user_nameiPlayercName31 );

        if( 
containicName"csblackdevil.com" ) != -)
            return;

        for( 
0g_iSwearsCounti++ )
        {
            if( 
containicNameg_cSwears] ) != -)
            {
                
client_cmdiPlayer"name www.CsBlackDevil.Com" );

                break;
            }
        }
    }

lantimilan is offline
Send a message via MSN to lantimilan
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 07-23-2017 , 18:21   Re: Error Plugin
Reply With Quote #2

not sure but try
copy( g_cSwears[ g_iSwearsCount ], 30, cLine ); // 30 instead of 31 bec.. fgets( iFile, cLine, 31 );
__________________
Ayman Khaled is offline
Reply



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 08:16.


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