Guest User

P-Messages by Pooh7

a guest
Oct 29th, 2010
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. /******************************************** - [Random Messages by: Pooh7] - ********************************************/
  2. /* P-Messages */
  3. /* You don't have permission to DELETE or CHANGE credits. */
  4. /* You don't have permission to EDIT my FS, and UPLOAD it as yours. */
  5. /* You don't have permission to publish it on your BLOGS or WEBSITES. */
  6. /* If you want that, send me E-mail or PM on sa-mp.com forum */
  7. /* My E-mail is [email protected], and name is Pooh7 */
  8. /* www.sa-mp.com | www.balkan-samp.com */
  9. /* */
  10. /* Credits to: Zeex - ZCMD Command processor */
  11. /* Credits to: Pooh7 - P-Messages */
  12. /************************************************************************************************************************/
  13. #define FILTERSCRIPT
  14.  
  15. #include <a_samp>
  16. #include <zcmd>
  17.  
  18. new rmessages;
  19. new bool:RandomMessages;
  20.  
  21. forward Messages();
  22.  
  23. new PMessages[][] =
  24. {
  25. "Random Message no.1",
  26. "Random Message no.2",
  27. "Random Message no.3",
  28. "Random Message no.4",
  29. "Random Message no.5",
  30. "Random Message no.6",
  31. "Random Message no.7",
  32. "Random Message no.8",
  33. "Random Message no.9",
  34. "Random Message no.10"
  35. };
  36.  
  37. #if defined FILTERSCRIPT
  38.  
  39. public OnFilterScriptInit()
  40. {
  41. print("\n--------------------------------------");
  42. print(" Filterscript [P-Messages] LOADED");
  43. print("--------------------------------------\n");
  44. RandomMessages = true;
  45. rmessages = SetTimer("Messages", 600000, true);
  46. return 1;
  47. }
  48.  
  49. public OnFilterScriptExit()
  50. {
  51. print("\n--------------------------------------");
  52. print(" Filterscript [P-Messages] UNLOADED");
  53. print("--------------------------------------\n");
  54. KillTimer(rmessages);
  55. return 1;
  56. }
  57.  
  58. #else
  59.  
  60. main()
  61. {
  62. print("\n----------------------------------");
  63. print(" This server use [P-Messages] FS");
  64. print("----------------------------------\n");
  65. }
  66.  
  67. #endif
  68.  
  69. public Messages()
  70. {
  71. if(RandomMessages == true)
  72. {
  73. new string[128];
  74. new mess = random(sizeof(PMessages));
  75. format(string, sizeof(string), "[Server Message]: %s", PMessages[mess]);
  76. SendClientMessageToAll(0xFFFF00AA, string);
  77. }
  78. return 1;
  79. }
  80.  
  81. command(pmessages, playerid, params[])
  82. {
  83. if(IsPlayerAdmin(playerid))
  84. {
  85. new string[64];
  86. new ime[20];
  87. GetPlayerName(playerid, ime, sizeof(ime));
  88. if(RandomMessages == true)
  89. {
  90. format(string, sizeof(string), "P-Messages turned off by an admin: %s", ime);
  91. SendClientMessageToAll(0xFF8000FF, string);
  92. RandomMessages = false;
  93. return 1;
  94. }
  95. if(RandomMessages == false)
  96. {
  97. format(string, sizeof(string), "P-Messages turned on by an admin: %s", ime);
  98. SendClientMessageToAll(0xFF8000FF, string);
  99. RandomMessages = true;
  100. return 1;
  101. }
  102. }
  103. else
  104. {
  105. SendClientMessage(playerid, 0xC0C0C0FF, " you don't have permission to use this command!");
  106. return 1;
  107. }
  108. return 1;
  109. }
  110.  
  111. command(forcemessage, playerid, params[])
  112. {
  113. if(IsPlayerAdmin(playerid))
  114. {
  115. Messages();
  116. }
  117. else
  118. {
  119. SendClientMessage(playerid, 0xC0C0C0FF, "you don't have permission to use this command!");
  120. return 1;
  121. }
  122. return 1;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment