Please Read the /rules or ill rape you. |
Originally Posted by Flake
pictures maybe?
|
Originally Posted by Flake
pictures maybe?
|
/* Shadow- : Chat Bot, Version 1 Credits to - Pandabear for helping me with minor bugs. */ #include <a_samp> #define MAX_MESSAGES 100 #define BOTTIMER 999999 // 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] = "Draugas_Robotas"; // 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[][] = { "nebepasipisesnaxuijaude," }; public OnFilterScriptInit() { if(RandomMessages == 1) { SetTimer("SendRandomMessage",BOTTIMER,1); } AddRandomMessage("x x x xx x "); AddRandomMessage("x x xx x x"); AddRandomMessage("x x x x x x"); print("Shadow's Chatbot Loaded"); return 1; } public OnPlayerConnect(playerid) { 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(playeri d)); 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(playeri d)); 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, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true)) { SendPlayerMessageToAll(playerid, text); return 0; } if(!strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", true) || !strcmp(text, "", 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; } |
Originally Posted by [MWR
Niixie ]
Very basic, but its good. Maybe if you make a toggle command? -Its also not very hard to make |