Advertisement
cesar_google

Dynamic System announced

Jul 13th, 2013
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.55 KB | None | 0 0
  1. /*
  2.           13/07/2013 3:49 p.m.
  3.         Dynamic System announced
  4.             By [FADE]Parka
  5.             Version: 0.1a
  6. */
  7. #include <a_samp>
  8. #include <sscanf2>
  9. #include <zcmd>
  10.  
  11. #pragma tabsize 4
  12.  
  13. #define CallBack:%0(%1) forward%0(%1); public%0(%1)
  14.  
  15.  
  16. new
  17.     Float:TD_Position,
  18.     Text:Anuncio,
  19.     Text:Fondo,
  20.     sAnuncio[90],
  21.     Type,
  22.     bool:aProgress,
  23.     TimeTextDraw
  24. ;
  25.  
  26. public OnFilterScriptInit()
  27. {
  28.     print("\n\n   13/07/2013 3:49 p.m.");
  29.     print("Dynamic System announced");
  30.     print("     By [FADE]Parka\n\n");
  31.  
  32.     Anuncio = TextDrawCreate(250.000000, 1.000000, "~y~Dynamic ~b~ System~r~ announced");
  33.     TextDrawBackgroundColor(Anuncio, 51);
  34.     TextDrawFont(Anuncio, 1);
  35.     TextDrawLetterSize(Anuncio, 0.440000, 1.300000);
  36.     TextDrawColor(Anuncio, -1);
  37.     TextDrawSetOutline(Anuncio, 1);
  38.     TextDrawSetProportional(Anuncio, 1);
  39.     TextDrawSetSelectable(Anuncio, 0);
  40.  
  41.     aProgress = false;
  42.     return 1;
  43. }
  44.  
  45. public OnFilterScriptExit()
  46. {
  47.     KillTimer(TimeTextDraw);
  48.     return 1;
  49. }
  50.  
  51. CMD:announce(playerid,params[])
  52. {
  53.     new TD_Text[90], TD_Type;
  54.     if( IsPlayerAdmin( playerid ) )
  55.     {
  56.         if(sscanf( params, "ds[90]", TD_Type, TD_Text ) )
  57.             return SendClientMessage( playerid, 0xFF0000ff, "Use: /Announce <Type> <Text>");
  58.         if( aProgress == true )
  59.             return SendClientMessage( playerid, 0xFF0000ff, "Error: There is already a announce processing");
  60.         Type = TD_Type;
  61.         switch( TD_Type )
  62.         {
  63.         case 1:
  64.         {
  65.         AnuncioBox( 320.0000, 1.0000);
  66.         }
  67.         case 2:
  68.         {
  69.         AnuncioBox( 320.0000, 436.0000);
  70.         }
  71.         default: return SendClientMessage( playerid, 0xFF0000ff, "Error: Type invalid");
  72.         }
  73.         aProgress = true;
  74.         TD_Position = 641.0000;
  75.         format( sAnuncio, sizeof sAnuncio, "%s", TD_Text);
  76.         TextDrawAnuncio();
  77.         SendClientMessage( playerid, 0x00FF00FF, "The announcement was sent successfully");
  78.     }else return SendClientMessage( playerid, 0xFF0000ff, "Error: You are not administrator!");
  79.     return 1;
  80. }
  81.  
  82. CallBack: AnuncioBox( Float: TD_x, Float: TD_y)
  83. {
  84.     Fondo = TextDrawCreate( TD_x, TD_y, "~n~_");
  85.     TextDrawAlignment(Fondo, 2);
  86.     TextDrawBackgroundColor(Fondo, 255);
  87.     TextDrawFont(Fondo, 1);
  88.     TextDrawLetterSize(Fondo, 0.500000, 1.000000);
  89.     TextDrawColor(Fondo, -1);
  90.     TextDrawSetOutline(Fondo, 0);
  91.     TextDrawSetProportional(Fondo, 1);
  92.     TextDrawSetShadow(Fondo, 1);
  93.     TextDrawUseBox(Fondo, 1);
  94.     TextDrawBoxColor(Fondo, 85);
  95.     TextDrawTextSize(Fondo, 0.000000, 658.000000);
  96.     TextDrawSetSelectable(Fondo, 0);
  97.     TextDrawShowForAll(Fondo);
  98. }
  99.  
  100. CallBack: RemoveAnuncio()
  101. {
  102.     aProgress = false;
  103.     TextDrawHideForAll(Anuncio);
  104.     TextDrawDestroy(Fondo);
  105.     KillTimer(TimeTextDraw);
  106.     return 1;
  107. }
  108.  
  109. CallBack: TextDrawAnuncio()
  110. {
  111.     UpDateTextDraw(Anuncio);
  112.     TD_Position -= 1.0;
  113.  
  114.     if(TD_Position == -385.0000)
  115.     {
  116.         RemoveAnuncio();
  117.         TD_Position = 641.0000;
  118.         return 1;
  119.     }
  120.  
  121.     if(TD_Position >= 640.0000)
  122.     {
  123.         TextDrawSetString(Anuncio , sAnuncio);
  124.     }
  125.     SetTimer("TextDrawAnuncio", 50, false);
  126.     return 1;
  127. }
  128.  
  129. CallBack: UpDateTextDraw( Text:TextId )
  130. {
  131.     switch( Type )
  132.     {
  133.     case 1:
  134.     {
  135.     EditAnuncioType(TextId , 1.0000);
  136.     }
  137.     case 2:
  138.     {
  139.     EditAnuncioType(TextId , 435.0000);
  140.     }
  141.     }
  142.     return TextDrawShowForAll(TextId);
  143. }
  144.  
  145. CallBack: EditAnuncioType(Text:TextId, Float:TD_x )
  146. {
  147.     TextDrawDestroy(TextId);
  148.     TextId = TextDrawCreate( TD_Position, TD_x, sAnuncio );
  149.     TextDrawBackgroundColor(TextId, 51);
  150.     TextDrawFont(TextId, 1);
  151.     TextDrawLetterSize(TextId, 0.440000, 1.300000);
  152.     TextDrawColor(TextId, -1);
  153.     TextDrawSetOutline(TextId, 1);
  154.     TextDrawSetProportional(TextId, 1);
  155.     TextDrawSetSelectable(TextId, 0);
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement