Advertisement
Guest User

Random TextDraw Messages by Remba031

a guest
Mar 19th, 2014
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. /*
  2.  
  3. RANDOM TEXTDRAW MESSAGES FILTERSCRIPT BY REMBA031
  4.  
  5. */
  6. #include <a_samp>
  7. #define FILTERSCRIPT
  8. #if defined FILTERSCRIPT
  9.  
  10. #define NEW_RANDOM_MESSAGE 20 // Every 20 seconds new random message will appear
  11. #define SERVER_NAME_COLOR 0xB8860BAA // The color of the server name
  12. #define SERVER_NAME "THE BEST SERVER" // Your server name
  13.  
  14. new Text:RandomMessage;
  15. new messagestring[256];
  16. new RandomMSG[][] =
  17. {
  18. "Random Message 1",
  19. "Random Message 2",
  20. "Random Message 3"
  21. };
  22. forward SendMSG();
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n------------------------------------------------");
  27. print("Random TextDraw messages by Remba031 loaded.");
  28. print("------------------------------------------------\n");
  29. return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34. print("\n------------------------------------------------");
  35. print("Random TextDraw messages by Remba031 unloaded.");
  36. print("------------------------------------------------\n");
  37. return 1;
  38. }
  39. public OnGameModeInit()
  40. {
  41. RandomMessage = TextDrawCreate(20.0,430.0,"[SERVERNAME] Random message");
  42. TextDrawFont(RandomMessage,1);
  43. TextDrawColor(RandomMessage,SERVER_NAME_COLOR);
  44. TextDrawSetShadow(RandomMessage,0);
  45. TextDrawSetOutline(RandomMessage,1);
  46.  
  47. SetTimer("SendMSG",NEW_RANDOM_MESSAGE*1000, true);
  48. return 1;
  49. }
  50. public OnPlayerSpawn(playerid)
  51. {
  52. TextDrawShowForPlayer(playerid,RandomMessage);
  53. return 1;
  54. }
  55. public SendMSG()
  56. {
  57. new randMSG = random(sizeof(RandomMSG));
  58. format(messagestring,sizeof(messagestring),"[%s] ~w~%s",SERVER_NAME,RandomMSG[randMSG]);
  59. TextDrawSetString(RandomMessage,messagestring);
  60. }
  61. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement