Alright, let's try to solve this then. I am using 1 FS's with a Gamemode.
Gamemode: LuxAdmin 1.6.
PHP код:
#include <a_samp>
#define MAX_MESSAGES 100
#define TIMER 600000 // This will set the Timer Length (Miliseconds) For the Random Messages
#define COLOR_BOT 0x808080FF // This will set the Bot's Color (Pink by Default)
new BotName[24] = "Overkill"; // This will set the Bot's Name
new RANDOMMSG = 1; // 1 = On - 0 = Off ( 0 = only SendBotMessage() without RandomMessage - 1 = Everything will work)
new MAXMESSAGE;
new BOTMESSAGE[MAX_PLAYERS][128];
forward Random(playerid);
new RandomMsg[][] =
{
"Hello,",
"Heya, ",
"Not now, I'm busy. Fuck you ",
"Wazzap, "
};
public OnFilterScriptInit()
{
if(RANDOMMSG == 1)
{
SetTimer("SendRandomMessage",TIMER,1);
}
AddRandomMessage("Did you know, you can talk with me?.");
AddRandomMessage("Do you enjoy this server? Come back Tomorrow!.");
AddRandomMessage("Is someone breaking the rules? Use /Report (ID) (Reason).");
AddRandomMessage("Respect the Staff and the Players around you or leave!.");
print("Chatbot Loaded!");
return 1;
}
public OnPlayerConnect(playerid)
{
SendBotMessage("Welcome to the Server. Please Read the /rules or I'll 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,BOTMESSAGE[random(MAXMESSAGE)]);
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(BOTMESSAGE[MAXMESSAGE],128,"%s",msg);
MAXMESSAGE++;
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, "Fuck you", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("HEY! Behave or get Fucked yourself!.");
return 0;
}
if(!strcmp(text, "How are you today bot?", true) || !strcmp(text, "How are you today bot", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("Fine as a fuck, thnx! :D");
return 0;
}
if(!strcmp(text, "Any Admin here?", true) || !strcmp(text, "Any Admin?", true) ||
!strcmp(text, "Admin here?", true) || !strcmp(text, "Admin online?", true) ||
!strcmp(text, "Admin on?", true) || !strcmp(text, "Any Admin here", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("Type /Admins to see the Online Admins.");
return 0;
}
if(!strcmp(text, "What are you doing bot", true) || !strcmp(text, "What are you doing bot?", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("Oh, you know... 0101001011 Stuff, thnx for asking! :).");
return 0;
}
if(!strcmp(text, "Hacker", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("A Hacker?!? Try to contact an Admin or Use /Report (ID) (Reason) immediately! :@.");
return 0;
}
if(!strcmp(text, "How to be Admin", true) || !strcmp(text, "How to be Admin?", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("You can't!.");
return 0;
}
if(!strcmp(text, "How to be VIP", true) || !strcmp(text, "How to Be VIP?", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("Interested in VIP? Visit the Forum and make an application.");
return 0;
}
if(!strcmp(text, "Hahahahaha", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("HAHAHAHA!!! XDXDXD LOLOLOLOL!");
return 0;
}
if(!strcmp(text, "SERVERINFO", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("==========Bot==========");
SendBotMessage("Created on: ");
SendBotMessage("Created by: ");
SendBotMessage("Admins: , ");
SendBotMessage("VIP: ");
SendBotMessage("Max Players:");
SendBotMessage("==========Bot==========");
return 0;
}
if(!strcmp(text, "Hi bot", true) || !strcmp(text, "Sup bot", true) || !strcmp(text, "Wazza bot", true) || !strcmp(text, "Hey bot", true))
{
SendPlayerMessageToAll(playerid, text);
Random(playerid);
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;
}
WHen i disable this FS everything works fine.