Advertisement
Guest User

Untitled

a guest
Jul 18th, 2014
695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_MESSAGES 9000
  4.  
  5. #define BOTTIMER 120000 // <-Set the timer lengh here (60000 = 1 min)
  6.  
  7. #define COLOR_BOT 0xFF0000AA // <- set the color here
  8.  
  9. new botname[16] = "Penis_Ripper"; //<- set the name here
  10. new RandomMessages = 1; // 1 = on; 0 = off ( 0 = only SendBotMessage() without Randommessages )
  11. new max_msg;
  12. new BotMessages[MAX_MESSAGES][500];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. if(RandomMessages == 1)
  17. {
  18. SetTimer("SendRandomMessage",BOTTIMER,1);
  19. }
  20. //Examples
  21. AddRandomMessage("Hello & How Are You today?, Did You Know i'm a ChatBot? ");
  22. AddRandomMessage("Here is our Backup Forums ");
  23. AddRandomMessage("Please Register @ both Forum sites");
  24. AddRandomMessage("You Can Apply To Join A Faction or Create a Gang");
  25. AddRandomMessage("Remember To Use The Right Format Or Else it Will Get Denied");
  26. AddRandomMessage("The Server Owner Is Steven_Ramos & Server Co-Owner is Brian_Wong");
  27. AddRandomMessage("Don't Vandalize The Server Or Esle You Can Get Demoted - Fired(Staff)");
  28. AddRandomMessage("Don't Ask For A Promotion Or Esle Your Getting Demoted (Staff)");
  29. AddRandomMessage("Don't Ask For Admin , Ca ,Server Mod Or Else You Not Getting It");
  30. AddRandomMessage("Make Sure To Always Follow Server & Forum Rules");
  31. AddRandomMessage("Use /b & /o to Chat To Avoid Meta Gaming");
  32. AddRandomMessage("Donate To The Server To Become A VIP");
  33. AddRandomMessage("Always Respect Community Advisors & Server Moderators & Admins");
  34. AddRandomMessage("We Don't Refund Ca,Server Mod & Admin & VIP");
  35. AddRandomMessage("Add 68.9.134.228:7777 To Your Favorites list");
  36. return 1;
  37. }
  38.  
  39. public OnPlayerConnect(playerid)
  40. {
  41. //Example
  42. SendBotMessage("Welcome to Ultimate-Roleplay. Read the /rules or Else Il Rip Your Penis Off");
  43. return 1;
  44. }
  45.  
  46. forward SendRandomMessage();
  47. public SendRandomMessage()
  48. {
  49. for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
  50. {
  51. if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
  52. {
  53. new name[20];
  54. format(name,sizeof(name),"%s",PlayerName(playerid));
  55. new ColorSave = GetPlayerColor(playerid);
  56. SetPlayerColor(playerid,COLOR_BOT);
  57. SetPlayerName(playerid,botname);
  58. SendPlayerMessageToAll(playerid,BotMessages[random(max_msg)]);
  59. SetPlayerColor(playerid,ColorSave);
  60. SetPlayerName(playerid,name);
  61. return 1;
  62. }
  63. }
  64. return 1;
  65. }
  66.  
  67. forward SendBotMessage(msg[]);
  68. public SendBotMessage(msg[])
  69. {
  70. for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
  71. {
  72. if(IsPlayerConnected(playerid)==1 && GetPlayerColor(playerid) != 0)
  73. {
  74. new name[20];
  75. format(name,sizeof(name),"%s",PlayerName(playerid));
  76. new ColorSave = GetPlayerColor(playerid);
  77. SetPlayerColor(playerid,COLOR_BOT);
  78. SetPlayerName(playerid,botname);
  79. SendPlayerMessageToAll(playerid,msg);
  80. SetPlayerColor(playerid,ColorSave);
  81. SetPlayerName(playerid,name);
  82. return 1;
  83. }
  84. }
  85. return 1;
  86. }
  87.  
  88. stock AddRandomMessage(msg[])
  89. {
  90. format(BotMessages[max_msg],500,"%s",msg);
  91. max_msg++;
  92. return 1;
  93. }
  94.  
  95. stock PlayerName(playerid)
  96. {
  97. new name2[MAX_PLAYER_NAME];
  98. GetPlayerName(playerid, name2, MAX_PLAYER_NAME);
  99. return name2;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement