#include <a_samp>
#define MAX_MESSAGES 100
#define BOTTIMER 50000 // This will set the Timer Length (Miliseconds) For the Random Messages
#define COLOR_BOT 0xFF00FFFF // This will set the Bot's Color (Pink by Default)
new BotName[24] = "Lookinbot"; // This will set the Bot's Name
new RandomMessages = 1; // 1 = On - 0 = Off ( 0 = only SendBotMessage() without RandomMessage - 1 = Everything will work)
new Max_Msg;
new BotMsg[MAX_PLAYERS][128];
forward Random(playerid);
new RandomMsg[][] =
{
"Hey,",
"Sup, ",
"Hiya, ",
"Wasssup, "
};
public OnFilterScriptInit()
{
if(RandomMessages == 1)
{
SetTimer("SendRandomMessage",BOTTIMER,1);
}
AddRandomMessage("Hey");
AddRandomMessage("the pcrp forums are good looking!");
AddRandomMessage("I'm a chatbot");
AddRandomMessage("Lookin Updates the server once a week");
AddRandomMessage("OMG ITS AN INFERNUS!");
AddRandomMessage("I'm in love with this server");
AddRandomMessage("Stop Using Hacks you noob");
AddRandomMessage("Don't Make me Ban you");
AddRandomMessage("Try /help people");
AddRandomMessage("Go to the forums to check out our VIP privlages");
AddRandomMessage("I wouldnt if I were you!");
print("LookinBot Loaded");
return 1;
}
public OnPlayerConnect(playerid)
{
SendBotMessage("Welcome to 'My Server' Please Read the /rules or ill rape you.");
return 1;
}
forward SendRandomMessage();
public SendRandomMessage()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
{
new pName[18];
format(pName,sizeof(pName),"%s",PlayerName(playerid));
new ColorSave = GetPlayerColor(playerid);
SetPlayerColor(playerid,COLOR_BOT);
SetPlayerName(playerid,BotName);
SendPlayerMessageToAll(playerid,BotMsg[random(Max_Msg)]);
SetPlayerColor(playerid,ColorSave);
SetPlayerName(playerid,pName);
return 1;
}
}
return 1;
}
forward SendBotMessage(msg[]);
public SendBotMessage(msg[])
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
{
new pName[18];
format(pName,sizeof(pName),"%s",PlayerName(playerid));
new ColorSave = GetPlayerColor(playerid);
SetPlayerColor(playerid,COLOR_BOT);
SetPlayerName(playerid,BotName);
SendPlayerMessageToAll(playerid,msg);
SetPlayerColor(playerid,ColorSave);
SetPlayerName(playerid,pName);
return 1;
}
}
return 1;
}
stock AddRandomMessage(msg[])
{
format(BotMsg[Max_Msg],128,"%s",msg);
Max_Msg++;
return 1;
}
stock PlayerName(playerid)
{
new pName2[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName2, MAX_PLAYER_NAME);
return pName2;
}
public OnPlayerText(playerid, text[])
{
if(!strcmp(text, "Ha", true) || !strcmp(text, "lol", true) || !strcmp(text, "rofl", true) || !strcmp(text, "lmao", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("ROFL!");
return 0;
}
if(!strcmp(text, "Hi", true) || !strcmp(text, "Sup", true) || !strcmp(text, "Lookinbot", true) || !strcmp(text, "Hiya", true))
{
SendPlayerMessageToAll(playerid, text);
Random(playerid);
return 0;
}
if(!strcmp(text, "me?", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("Yes you");
return 0;
}
if(!strcmp(text, "fuck", true) || !strcmp(text, "bitch", true) || !strcmp(text, "dick", true) || !strcmp(text, "slut", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("Watch the Mouth! :)");
return 0;
}
return 1;
}
public Random(playerid)
{
new str[128];
new randMSG = random(sizeof(RandomMsg));
format(str, sizeof(str), "%s %s", RandomMsg[randMSG], PlayerName(playerid));
SendBotMessage(str);
return 1;
}
You are 100% positive the filterscript is completely loaded? Show me the server log text when you start the server.
You could also try removing all other filterscripts but that one, and see if it works (If there are any others). This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds. |
SA-MP Dedicated Server ---------------------- v0.3b R2, ©2005-2010 SA-MP Team [20:22:03] [20:22:03] Server Plugins [20:22:03] -------------- [20:22:03] Loaded 0 plugins. [20:22:03] [20:22:03] Filter Scripts [20:22:03] --------------- [20:22:03] Loading filter script 'LookinBot.amx'... [20:22:03] LookinBot Loaded [20:22:03] Loaded 1 filter scripts. [20:22:03] Total vehicles from files: 0 [20:22:03] --------------------------------------- [20:22:03] Running Grand Larceny - by the SA-MP team [20:22:03] --------------------------------------- [20:22:03] Number of vehicle models: 0
if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
Okay, I've found the problem, as I suspected. Here is the line that is causing the problems, for both messages:
pawn Code:
And the only reason I'm up so late is that I have a party planned for me at 5 AM at a friends. Happy birthday to me ! |
if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
new im_a_bot = -1;
public OnPlayerConnect(playerid) { if(strcmp("Rac3r(Bot)", PlayerName(playerid), true)==0)im_a_bot = playerid; return 1; // end of code, obviously }
public SendBotMessage(msg[]) { if(im_a_bot != -1) { new pName[18]; format(pName,sizeof(pName),"%s",PlayerName(im_a_bot)); .....// and so on;