Advertisement
Johurt

[FS] jText

Jan 21st, 2012
805
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.92 KB | None | 0 0
  1. /*
  2.           Filterscripta sukure Johurt(Edgaras) specialiai Gta-Online.lt
  3.           Viskas daryta pagal wiki.sa-mp.com:
  4.        
  5.           http://wiki.sa-mp.com/wiki/SetTimer
  6.           http://wiki.sa-mp.com/wiki/Random_Messages
  7.           http://wiki.sa-mp.com/wiki/TextDrawCreate
  8. */
  9. #define FILTERSCRIPT
  10. #include <a_samp>
  11.  
  12. #define KEITIMO_LAIKAS  5 // Laikas sekundese.
  13. #define TEXT_COLOR      0xFFFFFFFF // TextDraw'o spalva.
  14.  
  15. forward SendMSG();
  16. new Text:Text;
  17. new timer;
  18. new RandomMSG[][] =
  19. {
  20.      "Musu serverio svetaine: Gta-Online.lt",
  21.      "Gta-Online.lt 2011 rinkimu rezultatai",
  22.      "Draudziama registruotis daugiau, nei viena karta, be administracijos leidimo"
  23. };
  24.  
  25. public OnFilterScriptInit()
  26. {
  27.      print("\n--------------------------------------------");
  28.      print("[FS]jText by Johurt loaded.");
  29.      print("--------------------------------------------\n");
  30.      new randMSG = random(sizeof(RandomMSG));
  31.      Text = TextDrawCreate(19.000000, 427.000000, RandomMSG[randMSG]);
  32.      TextDrawBackgroundColor(Text, 255);
  33.      TextDrawFont(Text, 2);
  34.      TextDrawLetterSize(Text, 0.25, 0.70);
  35.      TextDrawSetShadow(Text, 1);
  36.      TextDrawColor(Text, TEXT_COLOR);
  37.      TextDrawShowForAll(Text);
  38.      timer = SetTimer("SendMSG", KEITIMO_LAIKAS * 1000, true);
  39.      return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.      print("\n----------------------------------------------");
  45.      print("[FS]jText by Johurt unloaded.");
  46.      print("----------------------------------------------\n");
  47.      TextDrawDestroy(Text);
  48.      KillTimer(timer);
  49.      return 1;
  50. }
  51.  
  52. public OnPlayerConnect(playerid)
  53. {
  54.      TextDrawShowForPlayer(playerid, Text);
  55.      return 1;
  56. }
  57.  
  58. public OnPlayerDisconnect(playerid, reason)
  59. {
  60.      TextDrawHideForPlayer(playerid, Text);
  61.      return 1;
  62. }
  63.  
  64. public SendMSG()
  65. {
  66.      new randMSG = random(sizeof(RandomMSG));
  67.      TextDrawSetString(Text, RandomMSG[randMSG]);
  68.      TextDrawShowForAll(Text);
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement