Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==============================================================================
- FS creado por rooT. para la comunidad Bristos-Server
- Espero que sea util!
- Gracias al Chaozman :D
- ==============================================================================*/
- #define FILTERSCRIPT
- #define COLOR_RED 0xFF0000AA
- #define COLOR_LIGHTGREEN 0x38FF06FF
- #define LIGHTBLUE 0x0BBF6AA
- #define COLOR_WHITE 0xFFFFFFAA
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #pragma tabsize 0
- //Chatbot
- new Botname[MAX_PLAYER_NAME] = "Chatbot! - by rooT!";
- new ServerName[128] = "Bristos-Server";
- new ServerURL[128] = "www.Foro-Bristos-Server.com";
- new Spam[MAX_PLAYERS] = 0;
- new BotMsg = 1;
- new BBot[MAX_PLAYERS] = 0;
- new bbid;
- #define BotD 170
- #define BotD1 171
- #define BotD2 172
- #define BotD3 173
- #define BotD4 174
- #define BotD5 175
- #define BotD6 176
- #define BotD7 177
- public OnFilterScriptInit()
- {
- print("---------------------------------------");
- print("----------Chat Bot - by rooT.----------");
- print("---------------------------------------");
- SetTimer("SendRandomMessage", 150000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendConnectMessage(playerid);
- return 0;
- }
- public OnPlayerText(playerid, text[])
- {
- new pname[MAX_PLAYER_NAME], string[128];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "[%d]: %s", playerid, text);
- SendPlayerMessageToAll(playerid, string);
- /*if(!strfind(text, "Hola", true) || !strfind(text, "hola", true))
- {
- if(BotMsg == 0) return 0;
- if(Spam[playerid] == 1) return 0;
- if(BBot[playerid] == 1) return 0;
- new randommsg = random(5);
- switch(randommsg)
- {
- case 0: format(string, sizeof(string), "Hola %s, bienvenido a Bristos-Server", Botname, pname);
- case 1: format(string, sizeof(string), "Hey %s, no olvides visitar nuestro foro! www.Foro-Bristos-Server.com", Botname, pname);
- case 2: format(string, sizeof(string), "MIREN QUIEN ENTRO AL SERVER :D! Que onda %s!", Botname, pname);
- case 3: format(string, sizeof(string), "WAZZAAAAAAAAAAAAA! ", Botname);
- case 4: format(string, sizeof(string), "%s dijo 'hola'... hehehe", Botname, pname);
- }
- Spam[playerid] = 1;
- SetTimerEx("NoSpam", 30000, false, "i", playerid);
- SendBotMessage(string);
- return 0;
- }*/
- if(strfind(text, "!FAIL", true) > -1 || strfind(text, "!fail", true) > -1)
- {
- if(BotMsg == 0) return 0;
- if(Spam[playerid] == 1) return 0;
- if(BBot[playerid] == 1) return 0;
- SendBotMessage("FAAAIL!");
- Spam[playerid] = 1;
- SetTimerEx("NoSpam", 30000, false, "i", playerid);
- return 0;
- }
- if(strfind(text, "!foro", true) > -1 || strfind(text, "!foro", true) > -1)
- {
- if(BotMsg == 0) return 0;
- if(Spam[playerid] == 1) return 0;
- if(BBot[playerid] == 1) return 0;
- GameTextForAll(ServerURL, 4000, 4);
- Spam[playerid] = 1;
- SetTimerEx("NoSpam", 30000, false, "i", playerid);
- return 0;
- }
- if(strfind(text, "lol", true) > -1|| strfind(text, "LOL", true) > -1 || strfind(text, "rofl", true) > -1 || strfind(text, "lmao", true) > -1 || strfind(text, "lmfao", true) > -1)
- {
- if(BotMsg == 0) return 0;
- if(Spam[playerid] == 1) return 0;
- if(BBot[playerid] == 1) return 0;
- SendBotMessage("Lot of Laughts! Fuck yeah.");
- Spam[playerid] = 1;
- SetTimerEx("NoSpam", 30000, false, "i", playerid);
- return 0;
- }
- if(strfind(text, Botname, true) > -1 || strfind(text, Botname, true) > -1)
- {
- if(BotMsg == 0) return 0;
- if(Spam[playerid] == 1) return 0;
- if(BBot[playerid] == 1) return 0;
- SendNameMessage(playerid);
- Spam[playerid] = 1;
- SetTimerEx("NoSpam", 30000, false, "i", playerid);
- return 0;
- }
- return 0;
- }
- /*==============================================================================
- ================================================================================
- =============================Chatbot Commands!==================================
- ================================================================================
- ==============================================================================*/
- CMD:cbot(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))) return SendClientMessage(playerid, LIGHTBLUE, "Necesitas ser administrador para usar este Comando!");
- if(isnull(params))
- {
- ShowPlayerDialog(playerid, BotD, DIALOG_STYLE_LIST, "Chatbot Configs", "Habilitar/Deshabilitar Chatbot\nBloquear Player\nDesbloquear Player\nEnviar mensaje\nCambiar Nombre (Chatbot)\nCambiar Server URL\nCambiar Server Name (Chatbot)", "Aceptar", "Cancelar");
- }
- return 1;
- }
- //==============================================================================
- //==============================================================================
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case BotD:
- if(response){
- switch(listitem){
- case 0: SwitchBot();
- case 1: ShowPlayerDialog(playerid, BotD1, DIALOG_STYLE_INPUT, Botname, "Bloquea un jugador", "Enviar", "Cancelar");
- case 2: ShowPlayerDialog(playerid, BotD2, DIALOG_STYLE_INPUT, Botname, "Desbloquea un jugador", "Enviar", "Cancelar");
- case 3: ShowPlayerDialog(playerid, BotD3, DIALOG_STYLE_INPUT, Botname, "Haz que el Chatbot hable", "Enviar", "Cancelar");
- case 4: ShowPlayerDialog(playerid, BotD4, DIALOG_STYLE_INPUT, Botname, "Cambia el nombre del bot", "Enviar", "Cancelar");
- case 5: ShowPlayerDialog(playerid, BotD7, DIALOG_STYLE_INPUT, Botname, "Cambia el nombre del Servidor", "Enviar", "Cancelar");
- case 6: ShowPlayerDialog(playerid, BotD6, DIALOG_STYLE_INPUT, Botname, "Cambia la URL del servidor", "Enviar", "Cancelar");
- }
- }
- case BotD1:
- if(response){
- new str[128], name[MAX_PLAYER_NAME];
- if(sscanf(inputtext, "d", bbid))return ShowPlayerDialog(playerid, BotD1, DIALOG_STYLE_INPUT, Botname, "Bloquea un jugador", "Enviar", "Cancelar");
- if(!IsPlayerConnected(bbid))return SendClientMessage(playerid, COLOR_RED, "ERROR: El jugador no se encuentra conectado");
- GetPlayerName(bbid, name, MAX_PLAYER_NAME);
- if(BBot[bbid] == 0)
- {
- BBot[bbid] = 1;
- format(str, sizeof(str), "Ya no respondere al jugador %s (%d)", name, bbid);
- SendBotMessage(str);
- }
- else{
- format(str, 128, "El jugador %s(%i) ya esta bloqueado!", name, bbid);
- SendClientMessage(playerid, COLOR_RED, str);
- }
- }
- case BotD2:
- if(response){
- new str[128], name[MAX_PLAYER_NAME];
- if(sscanf(inputtext, "d", bbid)) return ShowPlayerDialog(playerid, BotD2, DIALOG_STYLE_INPUT, Botname, "Desbloquea un jugador", "Enviar", "Cancelar");
- if(!IsPlayerConnected(bbid))return SendClientMessage(playerid, COLOR_RED, "ERROR: El jugador no se encuentra conectado");
- GetPlayerName(bbid, name, MAX_PLAYER_NAME);
- if(BBot[bbid] == 1)
- {
- BBot[bbid] = 0;
- format(str, sizeof(str), "Ahora le respondere al jugador %s (%d)", name, bbid);
- SendBotMessage(str);
- }
- else{
- format(str, 128, "El jugador %s(%i) no esta bloqueado!", name, bbid);
- SendClientMessage(playerid, LIGHTBLUE, str);
- }
- }
- case BotD3:
- if(response){
- if(isnull(inputtext)) return ShowPlayerDialog(playerid, BotD3, DIALOG_STYLE_INPUT, Botname, "Haz que el Chatbot hable", "Enviar", "Cancelar");
- SendBotMessage(inputtext);
- }
- case BotD4:
- if(response){
- if(isnull(inputtext)) return ShowPlayerDialog(playerid, BotD4, DIALOG_STYLE_INPUT, Botname, "Cambia el nombre del bot", "Enviar", "Cancelar");
- ChangeNameD(playerid, inputtext);
- }
- case BotD6:
- if(response){
- if(isnull(inputtext)) return ShowPlayerDialog(playerid, BotD6, DIALOG_STYLE_INPUT, Botname, "Cambia la URL del servidor", "Enviar", "Cancelar");
- ChangeURL(playerid, inputtext);
- }
- case BotD7:
- if(response){
- if(isnull(inputtext)) return ShowPlayerDialog(playerid, BotD7, DIALOG_STYLE_INPUT, Botname, "Cambia el nombre del Servidor", "Enviar", "Cancelar");
- ChangeSVN(playerid, inputtext);
- }
- }
- return 1;
- }
- //======================================================================Chatbot!
- forward NoSpam(playerid);
- public NoSpam(playerid)
- {
- new str[128];
- format(str, sizeof(str), "Ya puedes hablar con %s", Botname);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
- Spam[playerid] = 0;
- return 1;
- }
- stock SwitchBot()
- {
- new string[128];
- if(BotMsg == 1)
- {
- BotMsg = 0;
- format(string, sizeof(string), "No respondere a nadie mas");
- SendBotMessage(string);
- }
- else if(BotMsg == 0)
- {
- BotMsg = 1;
- format(string, sizeof(string), "Si me hablan les contestare :)");
- SendBotMessage(string);
- }
- }
- stock SendBotMessage(txt[])
- {
- new string[128];
- format(string, sizeof(string), "|- %s: %s", Botname, txt);
- SendClientMessageToAll(LIGHTBLUE, string);
- }
- forward SendRandomMessage();
- public SendRandomMessage()
- {
- new string[128];
- new randommsg = random(7);
- switch(randommsg)
- {
- case 0: format(string, sizeof(string), "|- %s: El que usa cheats se va a vivir una semana con el tio Lexotanil.", Botname);
- case 1: format(string, sizeof(string), "|- %s: El que no visita %s se enfrentara a mi furia.", Botname, ServerURL);
- case 2: format(string, sizeof(string), "|- %s: Si haces spam de otros servers, te agarra SlovaK y no nos hacemos cargo de nada.", Botname);
- case 3: format(string, sizeof(string), "|- %s: NeedlesKane me maltrata :(", Botname);
- case 4: format(string, sizeof(string), "|- %s: Dontdontdontdont!", Botname);
- case 5: format(string, sizeof(string), "|- %s: heheeeeeeeeeeeeeeeeeeeeee waiiiiiiiiiiiii", Botname);
- case 6: format(string, sizeof(string), "|- %s: Batimovil? WTF! %smovil rulez.", Botname, Botname);
- case 7: format(string, sizeof(string), "|- %s: MrJacK me quiere cocinar, ayudaaaaa!", Botname);
- }
- SendClientMessageToAll(LIGHTBLUE, string);
- return 1;
- }
- forward SendNameMessage(playerid);
- public SendNameMessage(playerid)
- {
- new string[128];
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- new randommsg = random(7);
- switch(randommsg)
- {
- case 0: format(string, sizeof(string), "|- %s: Quien le dio permiso a %s de decir mi nombre?", Botname, pname);
- case 1: format(string, sizeof(string), "|- %s: Muerte a %s!", Botname, pname);
- case 2: format(string, sizeof(string), "|- %s: Hola %s :D! Te deseo una muerte lenta.", Botname, pname);
- case 3: format(string, sizeof(string), "|- %s: DEJEN DE HABLAR DE MI!", Botname);
- case 4: format(string, sizeof(string), "|- %s: %s, que requieres?", Botname, pname);
- case 5: format(string, sizeof(string), "|- %s: Arruinaste mi baƱo de esponja! Que quieres %s?", Botname, pname);
- case 6: format(string, sizeof(string), "|- %s: Que %s te masajee los pies, es lo mejor.", Botname, pname);
- }
- SendClientMessageToAll(LIGHTBLUE, string);
- return 1;
- }
- stock SendConnectMessage(playerid)
- {
- new string[128];
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- new randommsg = random(4);
- switch(randommsg)
- {
- case 0: format(string, sizeof(string), "|- %s: %s se conecto al servidor", Botname, pname);
- case 1: format(string, sizeof(string), "|- %s: Bienvenido a %s, %s", Botname, ServerName, pname);
- case 2: format(string, sizeof(string), "|- %s: No olviden visitar %s (Va para ti, %s)", Botname, ServerURL, pname);
- case 3: format(string, sizeof(string), "|- %s: Si ven algun cheater, utilizen /report [ID] [Razon]", Botname);
- }
- SendClientMessageToAll(LIGHTBLUE, string);
- }
- stock ChangeNameD(playerid, inputtext[])
- {
- new str[128];
- format(Botname, MAX_PLAYER_NAME, "%s", inputtext);
- format(str, sizeof(str), "El nombre del Chatbot ahora es %s", Botname);
- ShowPlayerDialog(playerid, BotD5, DIALOG_STYLE_MSGBOX, Botname, str, "Aceptar", "");
- }
- stock ChangeURL(playerid, inputtext[])
- {
- new str[128];
- format(ServerURL, sizeof(ServerURL), "%s", inputtext);
- format(str, sizeof(str), "La nueva URL del servidor es %s", ServerURL);
- ShowPlayerDialog(playerid, BotD5, DIALOG_STYLE_MSGBOX, Botname, str, "Aceptar", "");
- format(str, sizeof(str), "No olviden visitar %s!", ServerURL);
- SendBotMessage(str);
- format(str, sizeof(str), "weburl %s", ServerURL);
- SendRconCommand(str);
- }
- stock ChangeSVN(playerid, inputtext[])
- {
- new str[128];
- format(ServerName, sizeof(ServerName), "%s", inputtext);
- format(str, sizeof(str), "El nombre del servidor ahora es %s", ServerName);
- ShowPlayerDialog(playerid, BotD5, DIALOG_STYLE_MSGBOX, Botname, str, "Aceptar", "");
- SendBotMessage(str);
- }
- //==================================================================Fin Chatbot!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement