Advertisement
Guest User

random mesage System BIATCHHHH

a guest
Jul 21st, 2012
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. #include <a_samp> //Main include
  2.  
  3. //=============================================================================================|
  4. // |
  5. // |
  6. // ______ |
  7. // | { | | |
  8. // | { (____________ | | |
  9. // | { ( | ___ | |
  10. // | { { } ( __________ | / \ | Server |
  11. // | } ( | | / \ | & |
  12. // | } ( | | / \ | Community |
  13. // | ______} { _________| | / \ | |
  14. // |____________ | / \ | |
  15. // |/ \ | |
  16. //=============================================================================================
  17. //=============================================================================================
  18. #define CURRENT_MESSAGES 9
  19. //This is the number of the messages ^ Make sure its corret AT ALL TIMES!
  20.  
  21. #define MESSAGE_COLOR 0x4169E1FF
  22. //The color of the messages ^ You can change it
  23.  
  24. #define MESSAGE_TIME 70
  25. //These are the seconds in which every message is sent ^
  26.  
  27. new RM[CURRENT_MESSAGES][128];
  28. forward SendRandomMessage();
  29. public OnFilterScriptInit()
  30. {
  31. print("\n------------------------------------------");
  32. print(" Hope you enjoy");
  33. print(" Random Messages In Your server,");
  34. print(" >>| MADE BY CHRONIC, Bitch dont change it|<<.");
  35. print("--------------------------------------------\n");
  36. AddRandomMessage("Your msg here");
  37. AddRandomMessage("Your msg here");
  38. AddRandomMessage("Your msg here");
  39. AddRandomMessage("Your msg here ");
  40. AddRandomMessage("Your msg here ");
  41. AddRandomMessage("Your msg here");
  42. AddRandomMessage("Your msg here");
  43. AddRandomMessage("Your msg here");
  44. AddRandomMessage("Your msg here");
  45. SetTimer("SendRandomMessage", MESSAGE_TIME * 1000, 1);
  46. return 1;
  47. }
  48.  
  49. public SendRandomMessage()
  50. {
  51. static lastmessage = 0;
  52. new rand = random(CURRENT_MESSAGES);
  53. while(rand == lastmessage && CURRENT_MESSAGES != 1) { rand = random(CURRENT_MESSAGES); }
  54. lastmessage = rand;
  55. SendClientMessageToAll(MESSAGE_COLOR, RM[lastmessage]);
  56. }
  57.  
  58. stock AddRandomMessage(text[])
  59. {
  60. for(new m; m < CURRENT_MESSAGES; m++)
  61. {
  62. if(!strlen(RM[m]))
  63. {
  64. strmid(RM[m], text, 0, 127);
  65. return 1;
  66. }
  67. }
  68. return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement