legodude

legodude

Jun 8th, 2010
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 9.48 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #define CHAT_MAX 100//in milliseconds
  3. #include <a_samp>
  4. #include <a_npc>
  5. new string[80];
  6. new ChattedRecently;
  7. new spam[MAX_PLAYERS];
  8. new name[MAX_PLAYER_NAME];
  9. new botname[10] = "Anna";
  10. public OnPlayerConnect(playerid)
  11. {
  12. spam[playerid]=0;
  13. return 1;
  14. }
  15. forward chatted();
  16. public chatted()
  17. {
  18. SendClientMessageToAll(0xFFFFFF00, string);
  19. ChattedRecently = 0;
  20. return 1;
  21. }
  22. forward resetspam(playerid);
  23. public resetspam(playerid)
  24. {
  25. spam[playerid]=0;
  26. return 1;
  27. }
  28. ChatBot(playerid, sentenceid)
  29. {
  30.     GetPlayerName(playerid, name, sizeof(name));
  31.     if(sentenceid == 1 && ChattedRecently == 0)//stupid bot
  32.     {
  33.         format(string, sizeof(string), "%s:Hey %s! Don't say those dumb things! you know bots are cool.",botname, name);
  34.         SetTimer("chatted",CHAT_MAX,false);
  35.         ChattedRecently = 1;
  36.     }
  37.     if(sentenceid == 2 && ChattedRecently == 0)//ONGEBRUIKT!
  38.     {
  39.         //IS ONGEBRUIKT!!!
  40.     }
  41.     if(sentenceid == 3 && ChattedRecently == 0)//love bot
  42.     {
  43.         format(string, sizeof(string), "%s:I love you too %s!",botname, name);
  44.         SetTimer("chatted",CHAT_MAX,false);
  45.         ChattedRecently = 1;
  46.     }
  47.     if(sentenceid == 4 && ChattedRecently == 0)//ONGEBRUIKT!
  48.     {
  49.         //IS ONGEBRUIKT!!!
  50.     }
  51.     if(sentenceid == 5 && ChattedRecently == 0)//yes
  52.     {
  53.         format(string, sizeof(string), "%s:yes.",botname);
  54.         SetTimer("chatted",CHAT_MAX,false);
  55.         ChattedRecently = 1;
  56.     }
  57.     if(sentenceid == 6 && ChattedRecently == 0)//no
  58.     {
  59.         format(string, sizeof(string), "%s:no.",botname);
  60.         SetTimer("chatted",CHAT_MAX,false);
  61.         ChattedRecently = 1;
  62.     }
  63.     if(sentenceid == 7 && ChattedRecently == 0)//maybe
  64.     {
  65.         format(string, sizeof(string), "%s:maybe.",botname);
  66.         SetTimer("chatted",CHAT_MAX,false);
  67.         ChattedRecently = 1;
  68.     }
  69.     if(sentenceid == 8 && ChattedRecently == 0)//never
  70.     {
  71.         format(string, sizeof(string), "%s:never!",botname);
  72.         SetTimer("chatted",CHAT_MAX,false);
  73.         ChattedRecently = 1;
  74.     }
  75.     if(sentenceid == 9 && ChattedRecently == 0)//in the future
  76.     {
  77.         format(string, sizeof(string), "%s:in the future.",botname);
  78.         SetTimer("chatted",CHAT_MAX,false);
  79.         ChattedRecently = 1;
  80.     }
  81.     if(sentenceid == 10 && ChattedRecently == 0)//fuck you bot
  82.     {
  83.         format(string, sizeof(string), "%s:Go fuck yourself, %s",botname , name);
  84.         SetTimer("chatted",CHAT_MAX,false);
  85.         ChattedRecently = 1;
  86.     }
  87.     if(sentenceid == 11 && ChattedRecently == 0)//stupid server
  88.     {
  89.         format(string, sizeof(string), "%s:Hey %s! this server IS cool!",botname, name);
  90.         SetTimer("chatted",CHAT_MAX,false);
  91.         ChattedRecently = 1;
  92.     }
  93.     if(sentenceid == 12 && ChattedRecently == 0)//ONGEBRUIKT
  94.     {
  95.         //ONGEBRUIKT!!!
  96.     }
  97.     if(sentenceid == 13 && ChattedRecently == 0)//love server
  98.     {
  99.         format(string, sizeof(string), "%s:I agree with you %s",botname , name);
  100.         SetTimer("chatted",CHAT_MAX,false);
  101.         ChattedRecently = 1;
  102.     }
  103.     if(sentenceid == 14 && ChattedRecently == 0)//ONGEBRUIKT
  104.     {
  105.         //ONGEBRUIKT!!!
  106.     }
  107.     if(sentenceid == 15 && ChattedRecently == 0)//ONGEBRUIKT
  108.     {
  109.         //ONGEBRUIKT!!!
  110.     }
  111.     if(sentenceid == 16 && ChattedRecently == 0)//insult geso
  112.     {
  113.         format(string, sizeof(string), "%s:dont insult our admins will ya?",botname);
  114.         SetTimer("chatted",CHAT_MAX,false);
  115.         ChattedRecently = 1;
  116.     }
  117.     if(sentenceid == 17 && ChattedRecently == 0)//like geso
  118.     {
  119.         format(string, sizeof(string), "%s:I totally Agree with you %s",botname , name);
  120.         SetTimer("chatted",CHAT_MAX,false);
  121.         ChattedRecently = 1;
  122.     }
  123.     if(sentenceid == 18 && ChattedRecently == 0)//lol
  124.     {
  125.         new randomlol = random(5);
  126.         switch(randomlol)
  127.         {
  128.             case 0:
  129.             {
  130.                 format(string, sizeof(string), "%s:haha...",botname);
  131.             }
  132.             case 1:
  133.             {
  134.                 format(string, sizeof(string), "%s:what you're laughing about?",botname);
  135.             }
  136.             case 2:
  137.             {
  138.                 format(string, sizeof(string), "%s:LOLcano erupting! everyone into the roflcopters! *soisoisoisoi*",botname);
  139.             }
  140.             case 3:
  141.             {
  142.                 format(string, sizeof(string), "%s:omgz0r that's a real fun!",botname);
  143.             }
  144.             case 4:
  145.             {
  146.                 format(string, sizeof(string), "%s:fail!",botname);
  147.             }
  148.         }
  149.         SetTimer("chatted",CHAT_MAX,false);
  150.         ChattedRecently = 1;
  151.     }
  152.     if(sentenceid == 19 && ChattedRecently == 0)//happy smiles
  153.     {
  154.         new randomhappy = random(5);
  155.         switch(randomhappy)
  156.         {
  157.             case 0:
  158.             {
  159.                 format(string, sizeof(string), "%s:happy %s is happy me!",botname, name);
  160.             }
  161.             case 1:
  162.             {
  163.                 format(string, sizeof(string), "%s:what's so happy?",botname);
  164.             }
  165.             case 2:
  166.             {
  167.                 format(string, sizeof(string), "%s:im happy! :D",botname);
  168.             }
  169.             case 3:
  170.             {
  171.                 format(string, sizeof(string), "%s:you make me happy! :)",botname);
  172.             }
  173.             case 4:
  174.             {
  175.                 format(string, sizeof(string), "%s:do your cheeks hurt from the smiling?",botname);
  176.             }
  177.         }
  178.         SetTimer("chatted",CHAT_MAX,false);
  179.         ChattedRecently = 1;
  180.     }
  181.     if(sentenceid == 20 && ChattedRecently == 0)//sad smiles
  182.     {
  183.         new randomsad = random(5);
  184.         switch(randomsad)
  185.         {
  186.             case 0:
  187.             {
  188.                 format(string, sizeof(string), "%s:sad %s is sad me!",botname, name);
  189.             }
  190.             case 1:
  191.             {
  192.                 format(string, sizeof(string), "%s:what's so sad?",botname);
  193.             }
  194.             case 2:
  195.             {
  196.                 format(string, sizeof(string), "%s:just be happy...",botname);
  197.             }
  198.             case 3:
  199.             {
  200.                 format(string, sizeof(string), "%s:you make me sad. :(",botname);
  201.             }
  202.             case 4:
  203.             {
  204.                 format(string, sizeof(string), "%s:don't cry...",botname);
  205.             }
  206.         }
  207.         SetTimer("chatted",CHAT_MAX,false);
  208.         ChattedRecently = 1;
  209.     }
  210. }
  211.  
  212. public OnPlayerText(playerid, text[])
  213. {
  214.     if(spam[playerid] >= 3)
  215.     {
  216.         new kickmessage[50];
  217.         format(kickmessage, sizeof(kickmessage), "%s has been kicked by %s for Spam!",name,botname);
  218.         SendClientMessageToAll(0xff000000,kickmessage);
  219.         Kick(playerid);
  220.     }
  221.     else
  222.     {
  223.         spam[playerid]++;
  224.         SetTimerEx("resetspam", 4000, false, "i", playerid);
  225.     }
  226.    
  227.     if (strfind(text, "bot") != -1)
  228.     {
  229.         if (strfind(text, "stupid") != -1)//id 1
  230.         {
  231.             ChatBot(playerid, 1);
  232.         }
  233.         if (strfind(text, "hate") != -1)//id 1
  234.         {
  235.             ChatBot(playerid, 1);
  236.         }
  237.         if (strfind(text, "love") != -1)//id 3
  238.         {
  239.             ChatBot(playerid, 3);
  240.         }
  241.         if (strfind(text, "like") != -1)//id 3
  242.         {
  243.             ChatBot(playerid, 3);
  244.         }
  245.         if (strfind(text, "fuck") != -1)//id 10
  246.         {
  247.             ChatBot(playerid, 10);
  248.         }
  249.     }
  250.     if (strfind(text, "?") != -1)
  251.     {
  252.         if (strfind(text, "will")||strfind(text, "are") != -1)//id 11
  253.         {
  254.             new eightball = random(5);
  255.             switch(eightball)
  256.             {
  257.                 case 0:
  258.                 {
  259.                 ChatBot(playerid, 5);
  260.                 }
  261.                 case 1:
  262.                 {
  263.                 ChatBot(playerid, 6);
  264.                 }
  265.                 case 2:
  266.                 {
  267.                 ChatBot(playerid, 7);
  268.                 }
  269.                 case 3:
  270.                 {
  271.                 ChatBot(playerid, 8);
  272.                 }
  273.                 case 4:
  274.                 {
  275.                 ChatBot(playerid, 9);
  276.                 }
  277.             }
  278.         }
  279.        
  280.     }
  281.     if (strfind(text, "server") != -1)
  282.     {
  283.         if (strfind(text, "stupid") != -1)//id 11
  284.         {
  285.             ChatBot(playerid, 11);
  286.         }
  287.         if (strfind(text, "hate") != -1)//id 12
  288.         {
  289.             ChatBot(playerid, 11);
  290.         }
  291.         if (strfind(text, "love") != -1)//id 13
  292.         {
  293.             ChatBot(playerid, 13);
  294.         }
  295.         if (strfind(text, "like") != -1)//id 14
  296.         {
  297.             ChatBot(playerid, 13);
  298.         }
  299.         if (strfind(text, "fuck") != -1)//id 15
  300.         {
  301.             ChatBot(playerid, 11);
  302.         }
  303.     }
  304.     if (strfind(text, "geso") != -1)
  305.     {
  306.         if (strfind(text, "stupid") != -1)//id 16
  307.         {
  308.             ChatBot(playerid, 16);
  309.         }
  310.         if (strfind(text, "hate") != -1)//id 16
  311.         {
  312.             ChatBot(playerid, 16);
  313.         }
  314.         if (strfind(text, "fuck") != -1)//id 16
  315.         {
  316.             ChatBot(playerid, 16);
  317.         }
  318.         if (strfind(text, "great") != -1)//id 17
  319.         {
  320.             ChatBot(playerid, 17);
  321.         }
  322.         if (strfind(text, "super") != -1)//id 17
  323.         {
  324.             ChatBot(playerid, 17);
  325.         }
  326.         if (strfind(text, "like") != -1)//id 17
  327.         {
  328.             ChatBot(playerid, 17);
  329.         }
  330.     }
  331.     if (strfind(text, "lol") != -1)//id 18
  332.     {
  333.         ChatBot(playerid, 18);
  334.     }
  335.     if (strfind(text, "hihi") != -1)//id 18
  336.     {
  337.         ChatBot(playerid, 18);
  338.     }
  339.     if (strfind(text, "haha") != -1)//id 18
  340.     {
  341.         ChatBot(playerid, 18);
  342.     }
  343.     if (strfind(text, ":)") != -1)//id 19
  344.     {
  345.         ChatBot(playerid, 19);
  346.     }
  347.     if (strfind(text, ":D") != -1)//id 19
  348.     {
  349.         ChatBot(playerid, 19);
  350.     }
  351.     if (strfind(text, ":-)") != -1)//id 19
  352.     {
  353.         ChatBot(playerid, 19);
  354.     }
  355.     if (strfind(text, "=)") != -1)//id 19
  356.     {
  357.         ChatBot(playerid, 19);
  358.     }
  359.     if (strfind(text, ";)") != -1)//id 19
  360.     {
  361.         ChatBot(playerid, 19);
  362.     }
  363.     if (strfind(text, ":(") != -1)//id 19
  364.     {
  365.         ChatBot(playerid, 20);
  366.     }
  367.     if (strfind(text, ":O") != -1)//id 19
  368.     {
  369.         ChatBot(playerid, 20);
  370.     }
  371.     if (strfind(text, ":-(") != -1)//id 19
  372.     {
  373.         ChatBot(playerid, 20);
  374.     }
  375.     if (strfind(text, "=(") != -1)//id 19
  376.     {
  377.         ChatBot(playerid, 20);
  378.     }
  379.     if (strfind(text, ";(") != -1)//id 19
  380.     {
  381.         ChatBot(playerid, 20);
  382.     }
  383.     return 1;
  384. }
Add Comment
Please, Sign In to add comment