Advertisement
Guest User

Nibblet

a guest
Sep 20th, 2008
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.00 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #if defined FILTERSCRIPT
  6.  
  7. forward Nupdate ();
  8. new Ntimer;
  9.  
  10. new Text:Ntick;
  11.  
  12. new news[][] =
  13. {
  14. "News_Line_1", "News_Line_2", "News_Line_3"
  15. };
  16. //Adding a new line:
  17. //You can add a new line by adding a "," behind the Last Line. Then add "Your_text_here".
  18. //WARNING: Use "_" As a Space! otherwise it will Skip everything!!!
  19.  
  20. public OnFilterScriptInit()
  21. {
  22.     Ntimer = SetTimer("Nupdate", 5000, 1);
  23.     print("\n--------------------------------------");
  24.     print(" News Ticker/System by Nysteri ");
  25.     print(" LOADED ");
  26.     print("--------------------------------------\n");
  27.     Ntick = TextDrawCreate(321.000000,435.000000,"Your News here");
  28.     TextDrawUseBox(Ntick,1);
  29.     TextDrawBoxColor(Ntick,0x00000099);
  30.     TextDrawTextSize(Ntick,0.000000,631.000000);
  31.     TextDrawAlignment(Ntick,2);
  32.     TextDrawBackgroundColor(Ntick,0x000000ff);
  33.     TextDrawFont(Ntick,3);
  34.     TextDrawLetterSize(Ntick,0.399999,1.100000);
  35.     TextDrawColor(Ntick,0xffffffff);
  36.     TextDrawSetOutline(Ntick,1);
  37.     TextDrawSetProportional(Ntick,1);
  38.     TextDrawSetShadow(Ntick,1);
  39.     return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.     KillTimer(Ntimer);
  45.     print("\n--------------------------------------");
  46.     print(" News Ticker/System by Nysteri ");
  47.     print(" UNLOADED ");
  48.     print("--------------------------------------\n");
  49.     TextDrawDestroy(Ntick);
  50.     return 1;
  51. }
  52.  
  53. #else
  54.  
  55. main()
  56. {
  57.     print("\n----------------------------------");
  58.     print(" News Ticker/System by Nysteri ");
  59.     print("----------------------------------\n");
  60. }
  61.  
  62. #endif
  63.  
  64. public OnPlayerConnect(playerid)
  65. {
  66.     SendClientMessage(playerid, 0xFFE0C1FF, "This server is running \"News Ticker\" By Nibblet!");
  67.     TextDrawShowForPlayer(playerid, Ntick);
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerDisconnect(playerid, reason)
  72. {
  73.     TextDrawHideForPlayer(playerid, Ntick);
  74.     return 1;
  75. }
  76.  
  77. public Nupdate ()
  78. {
  79. static Number = 0;
  80. TextDrawSetString(Ntick, news[Number++]);
  81. TextDrawShowForAll(Ntick);
  82. if(Number == sizeof(news)) Number = 0;
  83. return 1;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement