SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/06/2012, 02:03 AM   #1
Crazyboobs
Huge Clucker
 
Join Date: Mar 2012
Posts: 303
Reputation: 38
Default Bots keep disconnecting

Hello!
I have a irc script, when i restart the server the bots will connect to irc but after sometimes it will keep spam like this

Quote:
[02:14:00] *** IRC_OnDisconnect: Bot ID 310 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 310 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 579 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 579 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 93 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 93 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 515 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 515 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 45 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 45 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 493 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 493 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 296 attempting to reconnect...
Spamming like this is very annoying and makes the server log big (going to more than 500 MB).And at that time server lagging. Can anyone tell me a solution? no problem if the bots disconnect but i need to stop this spamming, thats all :S

Here is the code of that

pawn Code:
public IRC_OnDisconnect(botid) {
    printf("*** IRC_OnDisconnect: Bot ID %d disconnected!", botid);
    if (botid == gBotID[0]) {
        // Reset the bot ID
        gBotID[0] = 0;
        // Wait 20 seconds for the first bot
        SetTimerEx("IRC_ConnectDelay", 50000, 0, "d", 1);}
    else if (botid == gBotID[1]) {
        // Reset the bot ID
        gBotID[1] = 0;
        // Wait 25 seconds for the second bot
        SetTimerEx("IRC_ConnectDelay", 55000, 0, "d", 2);}
    else if (botid == gBotID[2]) {
        // Reset the bot ID
        gBotID[2] = 0;
        // Wait 30 seconds for the third bot
        SetTimerEx("IRC_ConnectDelay", 50000, 0, "d", 3);}
    printf("*** IRC_OnDisconnect: Bot ID %d attempting to reconnect...", botid);
    // Remove the bot from the group
    IRC_RemoveFromGroup(gGroupID, botid);
    return 1;}

public IRC_OnJoinChannel(botid, channel[]) {
    printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s!", botid, channel);
    return 1;}
Crazyboobs is offline   Reply With Quote
Old 22/06/2012, 02:09 AM   #2
Littlehelper
Gangsta
 
Littlehelper's Avatar
 
Join Date: Nov 2011
Location: 420
Posts: 946
Reputation: 178
Default Re: Bots keep disconnecting

do you have maxnpc set to 1/amount of bots in your server.cfg?
Littlehelper is offline   Reply With Quote
Old 22/06/2012, 02:11 AM   #3
Crazyboobs
Huge Clucker
 
Join Date: Mar 2012
Posts: 303
Reputation: 38
Default Re: Bots keep disconnecting

Quote:
Originally Posted by Littlehelper[MDZ] View Post
do you have maxnpc set to 1/amount of bots in your server.cfg?
maxnpc 0
Crazyboobs is offline   Reply With Quote
Old 22/06/2012, 02:15 AM   #4
Littlehelper
Gangsta
 
Littlehelper's Avatar
 
Join Date: Nov 2011
Location: 420
Posts: 946
Reputation: 178
Default Re: Bots keep disconnecting

maxnpc number_of_bots_goes_here.
Littlehelper is offline   Reply With Quote
Old 22/06/2012, 02:17 AM   #5
Crazyboobs
Huge Clucker
 
Join Date: Mar 2012
Posts: 303
Reputation: 38
Default Re: Bots keep disconnecting

Quote:
Originally Posted by Littlehelper[MDZ] View Post
maxnpc number_of_bots_goes_here.
Ok and for a safety can i delete these 2 line?

pawn Code:
printf("*** IRC_OnDisconnect: Bot ID %d disconnected!", botid);

printf("*** IRC_OnDisconnect: Bot ID %d attempting to reconnect...", botid);
Crazyboobs is offline   Reply With Quote
Old 22/06/2012, 02:24 AM   #6
Littlehelper
Gangsta
 
Littlehelper's Avatar
 
Join Date: Nov 2011
Location: 420
Posts: 946
Reputation: 178
Default Re: Bots keep disconnecting

You can if you want.
Littlehelper is offline   Reply With Quote
Old 22/06/2012, 02:26 AM   #7
Crazyboobs
Huge Clucker
 
Join Date: Mar 2012
Posts: 303
Reputation: 38
Default Re: Bots keep disconnecting

Quote:
Originally Posted by Littlehelper[MDZ] View Post
You can if you want.
If i do that, then any problem?
Crazyboobs is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
After Disconnecting.. dorperez Scripting Help 1 26/02/2012 07:50 AM
Disconnecting Dabbs Client Support 2 20/02/2011 07:59 PM
Connecting and Disconnecting msg ivanorezac Server Support 2 27/03/2010 09:33 AM
Connecting and Disconnecting msg ivanorezac Help Archive 1 27/03/2010 09:05 AM
If I use BOTS in a Godfather server I must create an account to all bots? CTCCoco Help Archive 9 02/09/2009 07:53 PM


All times are GMT. The time now is 11:10 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.