LucasViniciusLV

[FilterScript] Noticias Dinamicas 2.0 @ThunderGamesBR

Jul 13th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.25 KB | None | 0 0
  1. #include <a_samp>
  2. #include < zcmd >
  3. #include < DOF2 >
  4.  
  5. #define MSG 54
  6.  
  7. new Text:Principal;
  8. new gi@cou;
  9.  
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.  
  14.     print("* System News 2.0 por @LucasVinicius carregado com sucesso!");
  15.     Principal = TextDrawCreate(6.000000, 425.000000, "Loading...");
  16.     TextDrawBackgroundColor(Principal, 255);
  17.     TextDrawFont(Principal, 1);
  18.     TextDrawLetterSize(Principal, 0.200000, 1.500000);
  19.     TextDrawColor(Principal, -1);
  20.     TextDrawSetOutline(Principal, 1);
  21.     TextDrawSetProportional(Principal, 1);
  22.     RandomNoticias();
  23.     SetTimer("RandomNoticias", 3*60000, true);
  24.     return 1;
  25. }
  26.  
  27. public OnFilterScriptExit()
  28. {
  29.     DOF2_Exit();
  30.     return 1;
  31. }
  32.  
  33. forward RandomNoticias();
  34. public RandomNoticias()
  35. {
  36.     new s@Msg[128];
  37.     new ls@an[32], ls@fan[64], lb@isc;
  38.     if(lb@isc == 0) lb@isc += 1;
  39.     if(lb@isc == 3) return 1;
  40.     format(ls@an, sizeof(ls@an), "Anuncio%d", gi@cou);
  41.     DOF2_GetString("Anuncio.ini", ls@an, ls@fan);
  42.     if(!strcmp("", ls@fan, true, 10))
  43.     {
  44.         gi@cou = 0;
  45.         return RandomNoticias();
  46.     }
  47.     format(s@Msg, 128, "~w~ %s", ls@fan);
  48.     TextDrawSetString(Principal, s@Mensg);
  49.     return 1;
  50. }
  51.  
  52. public OnPlayerConnect(playerid)
  53. {
  54.     TextDrawShowForPlayer(playerid,Principal);
  55.     return 1;
  56. }
  57.  
  58.  
  59. CMD:mensagens(playerid) {
  60.     new ls@buf[1200];
  61.     for(new i; i < 20; i++)
  62.     {
  63.         new ls@an[32];
  64.         new ls@fan[64];
  65.         format(ls@an, 32, "Anuncio: %d", i);
  66.         DOF2_GetString("Anuncio.ini", ls@an, ls@fan);
  67.         if(!strcmp("", ls@fan, true, 10)) break;
  68.         format(ls@buf, 1200, "%s\n > %d - %s", ls@buf, i, ls@fan);
  69.     }
  70.     ShowPlayerDialog(playerid, MSG, DIALOG_STYLE_MSGBOX, "MensagemTD In-Game", ls@buf, "Fechar", "");
  71.     return 1;
  72. }
  73.  
  74. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  75.     if(dialogid == MSG) {
  76.         if(!response)
  77.         {
  78.             new buff;
  79.             for(new i; i < 20; i++)
  80.             {
  81.                 new ls@an[32];
  82.                 new ls@fan[64];
  83.                 format(ls@an, 32, "Anuncio: %d", i);
  84.  
  85.                 DOF2_GetString("Anuncio.ini", ls@an, ls@fan);
  86.                 if(!strcmp("", ls@fan, true, 10))
  87.                 {
  88.                     buff = i;
  89.                     break;
  90.                 }
  91.             }
  92.             new ls@an[32];
  93.             format(ls@an, 32, "Anuncio: %d", buff);
  94.             DOF2_SetString("Anuncio.ini", ls@an, inputtext);
  95.         }
  96.     }
  97.     return 1;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment