Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 13/07/2013 3:49 p.m.
- Dynamic System announced
- By [FADE]Parka
- Version: 0.1a
- */
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #pragma tabsize 4
- #define CallBack:%0(%1) forward%0(%1); public%0(%1)
- new
- Float:TD_Position,
- Text:Anuncio,
- Text:Fondo,
- sAnuncio[90],
- Type,
- bool:aProgress,
- TimeTextDraw
- ;
- public OnFilterScriptInit()
- {
- print("\n\n 13/07/2013 3:49 p.m.");
- print("Dynamic System announced");
- print(" By [FADE]Parka\n\n");
- Anuncio = TextDrawCreate(250.000000, 1.000000, "~y~Dynamic ~b~ System~r~ announced");
- TextDrawBackgroundColor(Anuncio, 51);
- TextDrawFont(Anuncio, 1);
- TextDrawLetterSize(Anuncio, 0.440000, 1.300000);
- TextDrawColor(Anuncio, -1);
- TextDrawSetOutline(Anuncio, 1);
- TextDrawSetProportional(Anuncio, 1);
- TextDrawSetSelectable(Anuncio, 0);
- aProgress = false;
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(TimeTextDraw);
- return 1;
- }
- CMD:announce(playerid,params[])
- {
- new TD_Text[90], TD_Type;
- if( IsPlayerAdmin( playerid ) )
- {
- if(sscanf( params, "ds[90]", TD_Type, TD_Text ) )
- return SendClientMessage( playerid, 0xFF0000ff, "Use: /Announce <Type> <Text>");
- if( aProgress == true )
- return SendClientMessage( playerid, 0xFF0000ff, "Error: There is already a announce processing");
- Type = TD_Type;
- switch( TD_Type )
- {
- case 1:
- {
- AnuncioBox( 320.0000, 1.0000);
- }
- case 2:
- {
- AnuncioBox( 320.0000, 436.0000);
- }
- default: return SendClientMessage( playerid, 0xFF0000ff, "Error: Type invalid");
- }
- aProgress = true;
- TD_Position = 641.0000;
- format( sAnuncio, sizeof sAnuncio, "%s", TD_Text);
- TextDrawAnuncio();
- SendClientMessage( playerid, 0x00FF00FF, "The announcement was sent successfully");
- }else return SendClientMessage( playerid, 0xFF0000ff, "Error: You are not administrator!");
- return 1;
- }
- CallBack: AnuncioBox( Float: TD_x, Float: TD_y)
- {
- Fondo = TextDrawCreate( TD_x, TD_y, "~n~_");
- TextDrawAlignment(Fondo, 2);
- TextDrawBackgroundColor(Fondo, 255);
- TextDrawFont(Fondo, 1);
- TextDrawLetterSize(Fondo, 0.500000, 1.000000);
- TextDrawColor(Fondo, -1);
- TextDrawSetOutline(Fondo, 0);
- TextDrawSetProportional(Fondo, 1);
- TextDrawSetShadow(Fondo, 1);
- TextDrawUseBox(Fondo, 1);
- TextDrawBoxColor(Fondo, 85);
- TextDrawTextSize(Fondo, 0.000000, 658.000000);
- TextDrawSetSelectable(Fondo, 0);
- TextDrawShowForAll(Fondo);
- }
- CallBack: RemoveAnuncio()
- {
- aProgress = false;
- TextDrawHideForAll(Anuncio);
- TextDrawDestroy(Fondo);
- KillTimer(TimeTextDraw);
- return 1;
- }
- CallBack: TextDrawAnuncio()
- {
- UpDateTextDraw(Anuncio);
- TD_Position -= 1.0;
- if(TD_Position == -385.0000)
- {
- RemoveAnuncio();
- TD_Position = 641.0000;
- return 1;
- }
- if(TD_Position >= 640.0000)
- {
- TextDrawSetString(Anuncio , sAnuncio);
- }
- SetTimer("TextDrawAnuncio", 50, false);
- return 1;
- }
- CallBack: UpDateTextDraw( Text:TextId )
- {
- switch( Type )
- {
- case 1:
- {
- EditAnuncioType(TextId , 1.0000);
- }
- case 2:
- {
- EditAnuncioType(TextId , 435.0000);
- }
- }
- return TextDrawShowForAll(TextId);
- }
- CallBack: EditAnuncioType(Text:TextId, Float:TD_x )
- {
- TextDrawDestroy(TextId);
- TextId = TextDrawCreate( TD_Position, TD_x, sAnuncio );
- TextDrawBackgroundColor(TextId, 51);
- TextDrawFont(TextId, 1);
- TextDrawLetterSize(TextId, 0.440000, 1.300000);
- TextDrawColor(TextId, -1);
- TextDrawSetOutline(TextId, 1);
- TextDrawSetProportional(TextId, 1);
- TextDrawSetSelectable(TextId, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement