VerbalVandalism

Random Server Messages with Textdraw

May 11th, 2012
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.74 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MESSAGE_TIME 3600000
  4.  
  5. new Text:RMText;
  6. new ServerMessage[3][] = {
  7.     "Our first server message.",
  8.     "Party Rock is in the house tonight!",
  9.     "Awwwwwwwwwwwwwww Yeah!"
  10. };
  11.  
  12. forward ShowMessage();
  13. forward HideMessage();
  14.  
  15. public OnFilterScriptInit() {
  16.     SetTimer("ShowMessage", MESSAGE_TIME, true);
  17.     return 1;
  18. }
  19.  
  20. public ShowMessage() {
  21.     new RandomMessage = random(sizeof(ServerMessage));
  22.     RMText = TextDrawCreate(10.0, 100.0, ServerMessage[RandomMessage]);
  23.     TextDrawFont(RMText, 2);
  24.     TextDrawColor(RMText, 0x85D0FFAA);
  25.     TextDrawSetOutline(RMText, 1);
  26.     TextDrawAlignment(RMText, 1);
  27.     TextDrawShowForAll(RMText);
  28.     SetTimer("HideMessage", 3000, false);
  29. }
  30.  
  31. public HideMessage() {
  32.     TextDrawHideForAll(RMText);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment