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!");
- 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)
- {
- CreateDynamicTextdraws( TEXTDRAWS_ANIMATION_0 );
- TextDraw_FadeIn( playerid, TEXTDRAWS_ANIMATION_0, 100, 2000, 0, 4 );
- return 1;
- }
- return 0;
- }
- public OnAnimFinish( playerid, index )
- {
- switch( index )
- {
- case TEXTDRAWS_ANIMATION_0:
- {
- TextDraw_Grow(playerid,TEXTDRAWS_ANIMATION_1,100,2500, 0, 4, 1.3, 4.0);
- }
- case TEXTDRAWS_ANIMATION_1:
- {
- TextDraw_Pulsate(playerid,TEXTDRAWS_ANIMATION_FINISH,10,100,0,4 );
- }
- case TEXTDRAWS_ANIMATION_FINISH:
- {
- TextDraw_Hide( playerid, 0, -1 );
- }
- }
- return 1;
- }
- CreateDynamicTextdraws( index )
- {
- switch( index )
- {
- case TEXTDRAWS_ANIMATION_0:
- {
- T_Buffer[0] = TextDrawCreate(320.000000, 130.000000, "You");
- TextDrawAlignment(T_Buffer[0], 2);
- TextDrawBackgroundColor(T_Buffer[0], 255);
- TextDrawFont(T_Buffer[0], 1);
- TextDrawLetterSize(T_Buffer[0], 1.300000, 4.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, 160.000000, "Can");
- TextDrawAlignment(T_Buffer[1], 2);
- TextDrawBackgroundColor(T_Buffer[1], 255);
- TextDrawFont(T_Buffer[1], 1);
- TextDrawLetterSize(T_Buffer[1], 1.300000, 4.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, 190.000000, "Animate");
- TextDrawAlignment(T_Buffer[2], 2);
- TextDrawBackgroundColor(T_Buffer[2], 255);
- TextDrawFont(T_Buffer[2], 1);
- TextDrawLetterSize(T_Buffer[2], 1.300000, 4.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, 220.000000, "this text!");
- TextDrawAlignment(T_Buffer[3], 2);
- TextDrawBackgroundColor(T_Buffer[3], 255);
- TextDrawFont(T_Buffer[3], 1);
- TextDrawLetterSize(T_Buffer[3], 1.300000, 4.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(340.000000, 280.000000, "Or make it grow!!!");
- TextDrawAlignment(T_Buffer[4], 2);
- TextDrawBackgroundColor(T_Buffer[4], 255);
- TextDrawFont(T_Buffer[4], 1);
- TextDrawLetterSize(T_Buffer[4], 1.300000, 4.000000);
- TextDrawColor(T_Buffer[4], -16711681);
- TextDrawSetOutline(T_Buffer[4], 0);
- TextDrawSetProportional(T_Buffer[4], 1);
- TextDrawSetShadow(T_Buffer[4], 1);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement