Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAX_MESSAGES 100 //Change it!
- #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] = "Bot"; // Change it to the Name you want!
- new RandomMessages = 1; // 1 = On - 0 = Off ( 0 = only SendBotMessage() without RandomMessage - 1 = Everything will work)
- new Max_Msg;
- new BotMsg[MAX_PLAYERS][128]; //Change the 128 to the Max Players on your Server!
- forward Random(playerid);
- new RandomMsg[][] =
- {
- "Hey,",
- "Sup, ",
- "Hiya, ",
- "Wasssup, "
- };
- public OnFilterScriptInit()
- {
- if(RandomMessages == 1)
- {
- SetTimer("SendRandomMessage",BOTTIMER,1);
- }
- //Change every Message to the Message you want!
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- AddRandomMessage("");
- print("Chatbot by Daniel Schumacher loaded!");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendBotMessage("Welcome to 'The Servername'! We hope you have fun with Playing on this Server!"); //Change 'The Servername' to your Servername!
- 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[])
- {
- //Change the Text with "" to that you want!
- 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, "Thank you", true) || !strcmp(text, "thankyou", true) || !strcmp(text, "thanks", true) || !strcmp(text, "ty", true))
- {
- SendPlayerMessageToAll(playerid, text);
- SendBotMessage("Your welcome");
- return 0;
- }
- if(!strcmp(text, "Hi", true) || !strcmp(text, "Sup", true) || !strcmp(text, "BigBird", 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("Hey Don't swear, Theres a lady in the server :)");
- return 0;
- }
- if(!strcmp(text, "Sleepy", true) || !strcmp(text, "Bored", true))
- {
- SendPlayerMessageToAll(playerid, text);
- SendBotMessage("Do some stunts then");
- return 0;
- }
- if(!strcmp(text, "Hungry", true) || !strcmp(text, "drink", true) || !strcmp(text, "thirsty", true) || !strcmp(text, "water", true))
- {
- SendPlayerMessageToAll(playerid, text);
- SendBotMessage("I've got nothing in my fridge");
- return 0;
- }
- if(!strcmp(text, "Bot", true))
- {
- SendPlayerMessageToAll(playerid, text);
- SendBotMessage("Seifo's sexy)");
- return 0;
- }
- if(!strcmp(text, "Bot sucks", true))
- {
- SendPlayerMessageToAll(playerid, text);
- SendBotMessage("no you)");
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement