Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <TextDrawAnimations>
- #define TEXTDRAWS_ANIMATION_FINISH 0
- #define TEXTDRAWS_ANIMATION_0 1
- #define TEXTDRAWS_ANIMATION_1 2
- main()
- {
- print("\n----------------------------------");
- print(" Textdraw animations test");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Textdraw animations example!");
- CreateDynamicTextdraws( TEXTDRAWS_ANIMATION_0 );
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/anm", cmdtext, true, 10) == 0)
- {
- Init_Effects();
- TextDraw_FadeIn( playerid, TEXTDRAWS_ANIMATION_0, 100, 0, 0, 2, 0 );
- TextDraw_Pulsate( playerid,-1,40, 100, 8, 10 );
- return 1;
- }
- return 0;
- }
- public OnAnimFinish( playerid, index, timer )
- {
- Init_Effects();
- switch( index )
- {
- case TEXTDRAWS_ANIMATION_0:
- {
- TextDraw_Grow( playerid,TEXTDRAWS_ANIMATION_1,100,1000, 3, 3, 1.1, 3.7);
- }
- case TEXTDRAWS_ANIMATION_1:
- {
- TextDraw_Pulsate( playerid,TEXTDRAWS_ANIMATION_FINISH,10, 150, 4, 8 );
- }
- case TEXTDRAWS_ANIMATION_FINISH:
- {
- printf( "timerid: %d", timer );
- TextDraw_Hide( playerid, timer, 0, -1 );
- }
- }
- return 1;
- }
- CreateDynamicTextdraws( index )
- {
- switch( index )
- {
- case TEXTDRAWS_ANIMATION_0:
- {
- T_Buffer[0] = TextDrawCreate(320.000000, 160.000000, "This is");
- TextDrawAlignment(T_Buffer[0], 2);
- TextDrawBackgroundColor(T_Buffer[0], 255);
- TextDrawFont(T_Buffer[0], 1);
- TextDrawLetterSize(T_Buffer[0], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[0], -16776961);
- TextDrawSetOutline(T_Buffer[0], 0);
- TextDrawSetProportional(T_Buffer[0], 1);
- TextDrawSetShadow(T_Buffer[0], 1);
- T_Buffer[1] = TextDrawCreate(320.000000, 190.000000, "the new version");
- TextDrawAlignment(T_Buffer[1], 2);
- TextDrawBackgroundColor(T_Buffer[1], 255);
- TextDrawFont(T_Buffer[1], 1);
- TextDrawLetterSize(T_Buffer[1], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[1], -16776961);
- TextDrawSetOutline(T_Buffer[1], 0);
- TextDrawSetProportional(T_Buffer[1], 1);
- TextDrawSetShadow(T_Buffer[1], 1);
- T_Buffer[2] = TextDrawCreate(320.000000, 220.000000, "of textdraw animations");
- TextDrawAlignment(T_Buffer[2], 2);
- TextDrawBackgroundColor(T_Buffer[2], 255);
- TextDrawFont(T_Buffer[2], 1);
- TextDrawLetterSize(T_Buffer[2], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[2], -16776961);
- TextDrawSetOutline(T_Buffer[2], 0);
- TextDrawSetProportional(T_Buffer[2], 1);
- TextDrawSetShadow(T_Buffer[2], 1);
- T_Buffer[3] = TextDrawCreate(320.000000, 250.000000, "with multiple...");
- TextDrawAlignment(T_Buffer[3], 2);
- TextDrawBackgroundColor(T_Buffer[3], 255);
- TextDrawFont(T_Buffer[3], 1);
- TextDrawLetterSize(T_Buffer[3], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[3], -16776961);
- TextDrawSetOutline(T_Buffer[3], 0);
- TextDrawSetProportional(T_Buffer[3], 1);
- TextDrawSetShadow(T_Buffer[3], 1);
- T_Buffer[4] = TextDrawCreate(110.000000, 230.000000, "Effects!");
- TextDrawAlignment(T_Buffer[4], 2);
- TextDrawBackgroundColor(T_Buffer[4], 255);
- TextDrawFont(T_Buffer[4], 1);
- TextDrawLetterSize(T_Buffer[4], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[4], -65281);
- TextDrawSetOutline(T_Buffer[4], 0);
- TextDrawSetProportional(T_Buffer[4], 1);
- TextDrawSetShadow(T_Buffer[4], 1);
- T_Buffer[5] = TextDrawCreate(200.000000, 320.000000, "Effects!");
- TextDrawAlignment(T_Buffer[5], 2);
- TextDrawBackgroundColor(T_Buffer[5], 255);
- TextDrawFont(T_Buffer[5], 1);
- TextDrawLetterSize(T_Buffer[5], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[5], -65281);
- TextDrawSetOutline(T_Buffer[5], 0);
- TextDrawSetProportional(T_Buffer[5], 1);
- TextDrawSetShadow(T_Buffer[5], 1);
- T_Buffer[6] = TextDrawCreate(430.000000, 320.000000, "Effects!");
- TextDrawAlignment(T_Buffer[6], 2);
- TextDrawBackgroundColor(T_Buffer[6], 255);
- TextDrawFont(T_Buffer[6], 1);
- TextDrawLetterSize(T_Buffer[6], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[6], -65281);
- TextDrawSetOutline(T_Buffer[6], 0);
- TextDrawSetProportional(T_Buffer[6], 1);
- TextDrawSetShadow(T_Buffer[6], 1);
- T_Buffer[7] = TextDrawCreate(530.000000, 240.000000, "Effects!");
- TextDrawAlignment(T_Buffer[7], 2);
- TextDrawBackgroundColor(T_Buffer[7], 255);
- TextDrawFont(T_Buffer[7], 1);
- TextDrawLetterSize(T_Buffer[7], 0.700000, 2.000000);
- TextDrawColor(T_Buffer[7], -65281);
- TextDrawSetOutline(T_Buffer[7], 0);
- TextDrawSetProportional(T_Buffer[7], 1);
- TextDrawSetShadow(T_Buffer[7], 1);
- T_Buffer[8] = TextDrawCreate(50.000000, 120.000000, "New version!");
- TextDrawBackgroundColor(T_Buffer[8], 255);
- TextDrawFont(T_Buffer[8], 3);
- TextDrawLetterSize(T_Buffer[8], 0.600000, 2.000000);
- TextDrawColor(T_Buffer[8], -16711681);
- TextDrawSetOutline(T_Buffer[8], 0);
- TextDrawSetProportional(T_Buffer[8], 1);
- TextDrawSetShadow(T_Buffer[8], 1);
- T_Buffer[9] = TextDrawCreate(450.000000, 120.000000, "New version!");
- TextDrawBackgroundColor(T_Buffer[9], 255);
- TextDrawFont(T_Buffer[9], 3);
- TextDrawLetterSize(T_Buffer[9], 0.600000, 2.000000);
- TextDrawColor(T_Buffer[9], -16711681);
- TextDrawSetOutline(T_Buffer[9], 0);
- TextDrawSetProportional(T_Buffer[9], 1);
- TextDrawSetShadow(T_Buffer[9], 1);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement