Advertisement
Guest User

Textdraw animations test 2.1

a guest
Apr 4th, 2012
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.43 KB | None | 0 0
  1.     #include <a_samp>
  2.     #include <TextDrawAnimations>
  3.      
  4.     #define TEXTDRAWS_ANIMATION_FINISH 0
  5.     #define TEXTDRAWS_ANIMATION_0   1
  6.     #define TEXTDRAWS_ANIMATION_1   2
  7.      
  8.     main()
  9.     {
  10.                     print("\n----------------------------------");
  11.                     print(" Textdraw animations test");
  12.                     print("----------------------------------\n");
  13.     }
  14.      
  15.     public OnGameModeInit()
  16.     {      
  17.                     SetGameModeText("Textdraw animations example!");
  18.                     CreateDynamicTextdraws( TEXTDRAWS_ANIMATION_0 );
  19.                     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  20.                     return 1;
  21.     }
  22.      
  23.     public OnGameModeExit()
  24.     {
  25.                     return 1;
  26.     }
  27.      
  28.     public OnPlayerRequestClass(playerid, classid)
  29.     {
  30.                     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  31.                     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  32.                     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  33.                     return 1;
  34.     }
  35.      
  36.     public OnPlayerCommandText(playerid, cmdtext[])
  37.     {
  38.                     if (strcmp("/anm", cmdtext, true, 10) == 0)
  39.                     {              
  40.                                     Init_Effects();        
  41.                                     TextDraw_FadeIn( playerid, TEXTDRAWS_ANIMATION_0, 100, 0, 0, 2, 0 );      
  42.                                     TextDraw_Pulsate( playerid,-1,40, 100, 8, 10 );
  43.                                     return 1;
  44.                     }
  45.      
  46.                     return 0;
  47.     }
  48.      
  49.     public OnAnimFinish( playerid, index, timer )
  50.     {
  51.     Init_Effects();
  52.  
  53.                     switch( index )
  54.                     {
  55.                                     case TEXTDRAWS_ANIMATION_0:
  56.                                     {                                                    
  57.                                                     TextDraw_Grow( playerid,TEXTDRAWS_ANIMATION_1,100,1000, 3, 3, 1.1, 3.7);
  58.                                     }
  59.                                     case TEXTDRAWS_ANIMATION_1:
  60.                                     {
  61.                                                     TextDraw_Pulsate( playerid,TEXTDRAWS_ANIMATION_FINISH,10, 150, 4, 8 );
  62.                                     }
  63.                                     case TEXTDRAWS_ANIMATION_FINISH:
  64.                                     {                      
  65.                                                     printf( "timerid: %d", timer );
  66.                                                     TextDraw_Hide( playerid, timer, 0, -1 );
  67.                                     }
  68.                     }
  69.                
  70.                     return 1;
  71.     }
  72.      
  73.     CreateDynamicTextdraws( index )
  74.     {
  75.                     switch( index )
  76.                     {
  77.                                     case TEXTDRAWS_ANIMATION_0:
  78.                                     {
  79.                                                     T_Buffer[0] = TextDrawCreate(320.000000, 160.000000, "This is");
  80.                                                     TextDrawAlignment(T_Buffer[0], 2);
  81.                                                     TextDrawBackgroundColor(T_Buffer[0], 255);
  82.                                                     TextDrawFont(T_Buffer[0], 1);
  83.                                                     TextDrawLetterSize(T_Buffer[0], 0.700000, 2.000000);
  84.                                                     TextDrawColor(T_Buffer[0], -16776961);
  85.                                                     TextDrawSetOutline(T_Buffer[0], 0);
  86.                                                     TextDrawSetProportional(T_Buffer[0], 1);
  87.                                                     TextDrawSetShadow(T_Buffer[0], 1);
  88.      
  89.                                                     T_Buffer[1] = TextDrawCreate(320.000000, 190.000000, "the new version");
  90.                                                     TextDrawAlignment(T_Buffer[1], 2);
  91.                                                     TextDrawBackgroundColor(T_Buffer[1], 255);
  92.                                                     TextDrawFont(T_Buffer[1], 1);
  93.                                                     TextDrawLetterSize(T_Buffer[1], 0.700000, 2.000000);
  94.                                                     TextDrawColor(T_Buffer[1], -16776961);
  95.                                                     TextDrawSetOutline(T_Buffer[1], 0);
  96.                                                     TextDrawSetProportional(T_Buffer[1], 1);
  97.                                                     TextDrawSetShadow(T_Buffer[1], 1);
  98.      
  99.                                                     T_Buffer[2] = TextDrawCreate(320.000000, 220.000000, "of textdraw animations");
  100.                                                     TextDrawAlignment(T_Buffer[2], 2);
  101.                                                     TextDrawBackgroundColor(T_Buffer[2], 255);
  102.                                                     TextDrawFont(T_Buffer[2], 1);
  103.                                                     TextDrawLetterSize(T_Buffer[2], 0.700000, 2.000000);
  104.                                                     TextDrawColor(T_Buffer[2], -16776961);
  105.                                                     TextDrawSetOutline(T_Buffer[2], 0);
  106.                                                     TextDrawSetProportional(T_Buffer[2], 1);
  107.                                                     TextDrawSetShadow(T_Buffer[2], 1);
  108.      
  109.                                                     T_Buffer[3] = TextDrawCreate(320.000000, 250.000000, "with multiple...");
  110.                                                     TextDrawAlignment(T_Buffer[3], 2);
  111.                                                     TextDrawBackgroundColor(T_Buffer[3], 255);
  112.                                                     TextDrawFont(T_Buffer[3], 1);
  113.                                                     TextDrawLetterSize(T_Buffer[3], 0.700000, 2.000000);
  114.                                                     TextDrawColor(T_Buffer[3], -16776961);
  115.                                                     TextDrawSetOutline(T_Buffer[3], 0);
  116.                                                     TextDrawSetProportional(T_Buffer[3], 1);
  117.                                                     TextDrawSetShadow(T_Buffer[3], 1);
  118.      
  119.                                                     T_Buffer[4] = TextDrawCreate(110.000000, 230.000000, "Effects!");
  120.                                                     TextDrawAlignment(T_Buffer[4], 2);
  121.                                                     TextDrawBackgroundColor(T_Buffer[4], 255);
  122.                                                     TextDrawFont(T_Buffer[4], 1);
  123.                                                     TextDrawLetterSize(T_Buffer[4], 0.700000, 2.000000);
  124.                                                     TextDrawColor(T_Buffer[4], -65281);
  125.                                                     TextDrawSetOutline(T_Buffer[4], 0);
  126.                                                     TextDrawSetProportional(T_Buffer[4], 1);
  127.                                                     TextDrawSetShadow(T_Buffer[4], 1);
  128.      
  129.                                                     T_Buffer[5] = TextDrawCreate(200.000000, 320.000000, "Effects!");
  130.                                                     TextDrawAlignment(T_Buffer[5], 2);
  131.                                                     TextDrawBackgroundColor(T_Buffer[5], 255);
  132.                                                     TextDrawFont(T_Buffer[5], 1);
  133.                                                     TextDrawLetterSize(T_Buffer[5], 0.700000, 2.000000);
  134.                                                     TextDrawColor(T_Buffer[5], -65281);
  135.                                                     TextDrawSetOutline(T_Buffer[5], 0);
  136.                                                     TextDrawSetProportional(T_Buffer[5], 1);
  137.                                                     TextDrawSetShadow(T_Buffer[5], 1);
  138.      
  139.                                                     T_Buffer[6] = TextDrawCreate(430.000000, 320.000000, "Effects!");
  140.                                                     TextDrawAlignment(T_Buffer[6], 2);
  141.                                                     TextDrawBackgroundColor(T_Buffer[6], 255);
  142.                                                     TextDrawFont(T_Buffer[6], 1);
  143.                                                     TextDrawLetterSize(T_Buffer[6], 0.700000, 2.000000);
  144.                                                     TextDrawColor(T_Buffer[6], -65281);
  145.                                                     TextDrawSetOutline(T_Buffer[6], 0);
  146.                                                     TextDrawSetProportional(T_Buffer[6], 1);
  147.                                                     TextDrawSetShadow(T_Buffer[6], 1);
  148.      
  149.                                                     T_Buffer[7] = TextDrawCreate(530.000000, 240.000000, "Effects!");
  150.                                                     TextDrawAlignment(T_Buffer[7], 2);
  151.                                                     TextDrawBackgroundColor(T_Buffer[7], 255);
  152.                                                     TextDrawFont(T_Buffer[7], 1);
  153.                                                     TextDrawLetterSize(T_Buffer[7], 0.700000, 2.000000);
  154.                                                     TextDrawColor(T_Buffer[7], -65281);
  155.                                                     TextDrawSetOutline(T_Buffer[7], 0);
  156.                                                     TextDrawSetProportional(T_Buffer[7], 1);
  157.                                                     TextDrawSetShadow(T_Buffer[7], 1);
  158.                                                
  159.                                                     T_Buffer[8] = TextDrawCreate(50.000000, 120.000000, "New version!");
  160.                                                     TextDrawBackgroundColor(T_Buffer[8], 255);
  161.                                                     TextDrawFont(T_Buffer[8], 3);
  162.                                                     TextDrawLetterSize(T_Buffer[8], 0.600000, 2.000000);
  163.                                                     TextDrawColor(T_Buffer[8], -16711681);
  164.                                                     TextDrawSetOutline(T_Buffer[8], 0);
  165.                                                     TextDrawSetProportional(T_Buffer[8], 1);
  166.                                                     TextDrawSetShadow(T_Buffer[8], 1);
  167.      
  168.                                                     T_Buffer[9] = TextDrawCreate(450.000000, 120.000000, "New version!");
  169.                                                     TextDrawBackgroundColor(T_Buffer[9], 255);
  170.                                                     TextDrawFont(T_Buffer[9], 3);
  171.                                                     TextDrawLetterSize(T_Buffer[9], 0.600000, 2.000000);
  172.                                                     TextDrawColor(T_Buffer[9], -16711681);
  173.                                                     TextDrawSetOutline(T_Buffer[9], 0);
  174.                                                     TextDrawSetProportional(T_Buffer[9], 1);
  175.                                                     TextDrawSetShadow(T_Buffer[9], 1);
  176.                                     }
  177.                     }
  178.                
  179.                     return 1;
  180.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement