Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- by: LinkiNPark 19.06.2012
- */
- #include a_samp
- #define MAX_COLOR 400
- #define X_SIZE 130.0
- #define X_MAX > 472.0
- #define X_PLUS += 18.0
- #define Y_SIZE 110.0
- #define Y_PLUS += 16.0
- new
- Text: Draw[ MAX_COLOR + 1 ], color[ MAX_COLOR ] ;
- public OnFilterScriptInit()
- {
- Draw[ 400 ] = TextDrawCreate(123.0, 104.0, "."), TextDrawBackgroundColor( Draw[ 400 ], 255);
- TextDrawFont( Draw[ 400 ], 1), TextDrawLetterSize( Draw[ 400 ], 0.0, 36.20);
- TextDrawUseBox( Draw[ 400 ], 1), TextDrawBoxColor( Draw[ 400 ], 255);
- TextDrawTextSize( Draw[ 400 ], 490.0, 0.0);
- for ( new i, Float: x = X_SIZE, Float: y = Y_SIZE ; i != sizeof color ; i ++ )
- {
- if ( x X_MAX ) x = X_SIZE, y Y_PLUS ;
- Draw[ i ] = TextDrawCreate(x, y, "."), TextDrawTextSize( Draw[ i ], x + 10.0, 10.00);
- TextDrawBackgroundColor( Draw[ i ], 0x00000000 ), TextDrawFont( Draw[ i ], 1);
- TextDrawLetterSize( Draw[ i ], 0.0, 1.00 ), TextDrawColor( Draw[ i ], -1);
- TextDrawSetOutline( Draw[ i ], 0), TextDrawSetProportional( Draw[ i ], 1);
- TextDrawSetShadow( Draw[ i ], 0), TextDrawUseBox( Draw[ i ], 1);
- color[ i ] = ( ( random ( 0xFF ) * 0x1000000) + ( random ( 0xFF ) * 0x10000) + ( random ( 0xFF ) * 0x100 ) + 0xFF );
- TextDrawBoxColor( Draw[ i ], color[ i ] ), x X_PLUS ;
- TextDrawSetSelectable ( Draw[ i ], true ) ;
- }
- return 1 ;
- }
- public OnFilterScriptExit()
- {
- for ( new i ; i != sizeof( Draw ) ; i ++ ) TextDrawHideForAll( Draw[ i ] ), TextDrawDestroy ( Draw[ i ] ) ;
- return 1 ;
- }
- public OnPlayerClickTextDraw( playerid, Text:clickedid )
- {
- for ( new i ; i != sizeof( Draw ) ; i ++ )
- if ( Draw[ i ] == clickedid )
- {
- SetPlayerColor( playerid, color[ i ] ), CancelSelectTextDraw( playerid ) ;
- for ( new t ; t != sizeof( Draw ); t ++ ) TextDrawHideForPlayer( playerid, Draw[ t ] ) ;
- return 1;
- }
- if ( _:clickedid == INVALID_TEXT_DRAW )
- {
- for ( new t ; t != sizeof( Draw ); t ++ ) TextDrawHideForPlayer( playerid, Draw[ t ] ) ;
- }
- return 1 ;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/color", true) == 0)
- {
- for ( new i ; i != sizeof( Draw ); i ++ ) TextDrawShowForPlayer( playerid, Draw[ i ]) ;
- SelectTextDraw( playerid, -1 ) ;
- return 1 ;
- }
- return 0;
- }
- //by LinkiNPark
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement