[AJUDA] TextDraw
#1

Alguem ai pode me ajuda ? tф com um texdraw q eu fiz, mais so q naum sei coloca a parte do sistema.
no texdraw ta
=================
PING:
FPS:

SPREE:
SCORE:
=================
eu tenho score e spree tudo certo marcando em /status
mais to qrendo colocar pra mostra tudo com o texdraw tbm.
lembrando eu uso o "ladmin/users/"

o textdraw eh a seguinte



#include <a_samp>

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5;

public OnFilterScriptInit()
{
print("Jamaica textdraw");
print("ExelentGames[BoS]");

// Create the textdraws:
Textdraw0 = TextDrawCreate(507.000000, 335.000000, "PING:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 2);
TextDrawLetterSize(Textdraw0, 0.349999, 2.699999);
TextDrawColor(Textdraw0, -16776961);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);

Textdraw1 = TextDrawCreate(508.000000, 356.000000, "SPREE:");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 2);
TextDrawLetterSize(Textdraw1, 0.389999, 2.499999);
TextDrawColor(Textdraw1, -16776961);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 0);

Textdraw2 = TextDrawCreate(508.000000, 372.000000, "SCORE:");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 2);
TextDrawLetterSize(Textdraw2, 0.389999, 2.59999;
TextDrawColor(Textdraw2, -16776961);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 0);

Textdraw3 = TextDrawCreate(507.000000, 320.000000, "FPS:");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 2);
TextDrawLetterSize(Textdraw3, 0.389999, 2.499999);
TextDrawColor(Textdraw3, -16776961);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 0);

Textdraw4 = TextDrawCreate(507.000000, 335.000000, "PING:");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 2);
TextDrawLetterSize(Textdraw4, 0.349999, 2.699999);
TextDrawColor(Textdraw4, -16776961);
TextDrawSetOutline(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);

Textdraw5 = TextDrawCreate(507.000000, 320.000000, "FPS:");
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 2);
TextDrawLetterSize(Textdraw5, 0.389999, 2.499999);
TextDrawColor(Textdraw5, -16776961);
TextDrawSetOutline(Textdraw5, 1);
TextDrawSetProportional(Textdraw5, 0);

for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, Textdraw0);
TextDrawShowForPlayer(i, Textdraw1);
TextDrawShowForPlayer(i, Textdraw2);
TextDrawShowForPlayer(i, Textdraw3);
TextDrawShowForPlayer(i, Textdraw4);
TextDrawShowForPlayer(i, Textdraw5);
}
}
return 1;
}

public OnFilterScriptExit()
{
TextDrawHideForAll(Textdraw0);
TextDrawDestroy(Textdraw0);
TextDrawHideForAll(Textdraw1);
TextDrawDestroy(Textdraw1);
TextDrawHideForAll(Textdraw2);
TextDrawDestroy(Textdraw2);
TextDrawHideForAll(Textdraw3);
TextDrawDestroy(Textdraw3);
TextDrawHideForAll(Textdraw4);
TextDrawDestroy(Textdraw4);
TextDrawHideForAll(Textdraw5);
TextDrawDestroy(Textdraw5);
return 1;
}

public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw5);
return 1;
}

Me ajude ae galera, GRATO!
Reply
#2

OnPlayerUpdate(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new string[128];
format(string, sizeof(string),"Deaths: %d",GetPlayerPing(i));
TextDrawSetString(Textdraw0[i], string);
}
}
return 1;
}
Reply
#3

aki amigo

Textdraw2 = TextDrawCreate(508.000000, 372.000000, "SCORE:");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 2);
TextDrawLetterSize(Textdraw2, 0.389999, 2.59999);
TextDrawColor(Textdraw2, -16776961);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 0);
Reply
#4

Code:
#include    <   a_samp     >


#if	defined	MAX_PLAYERS
#undef		MAX_PLAYERS
#define 	MAX_PLAYERS 32 // Slosts Seu Servidor ^^
#endif

new Text: Textdraw0 [ MAX_PLAYERS ];
new Text: Textdraw1 [ MAX_PLAYERS ];
new Text: Textdraw2 [ MAX_PLAYERS ];
new Text: Textdraw3 [ MAX_PLAYERS ];
new Text: Textdraw4 [ MAX_PLAYERS ];
new Text: Textdraw5 [ MAX_PLAYERS ];

forward Actualizando ( ) ;

public OnGameModeInit( )
{

	SetTimer ( "Actualizando", 100, 1 ) ;

	for( new i = 0; i < MAX_PLAYERS; ++i )
	{
		Textdraw0 [ i ] = TextDrawCreate(507.000000, 335.000000, "PING:");
		TextDrawBackgroundColor( Textdraw0 [ i ], 255);
		TextDrawFont( Textdraw0 [ i ], 2);
		TextDrawLetterSize( Textdraw0 [ i ], 0.349999, 2.699999);
		TextDrawColor( Textdraw0 [ i ], -16776961);
		TextDrawSetOutline( Textdraw0 [ i ], 1);
		TextDrawSetProportional( Textdraw0 [ i ], 1);

		Textdraw1[ i ] = TextDrawCreate(508.000000, 356.000000, "SPREE:");
		TextDrawBackgroundColor( Textdraw1[ i ], 255);
		TextDrawFont( Textdraw1[ i ], 2);
		TextDrawLetterSize( Textdraw1[ i ], 0.389999, 2.499999);
		TextDrawColor( Textdraw1[ i ], -16776961);
		TextDrawSetOutline( Textdraw1[ i ], 1);
		TextDrawSetProportional( Textdraw1[ i ], 0);

		Textdraw2[ i ] = TextDrawCreate(508.000000, 372.000000, "SCORE:");
		TextDrawBackgroundColor( Textdraw2[ i ], 255);
		TextDrawFont( Textdraw2[ i ], 2);
		TextDrawLetterSize( Textdraw2[ i ], 0.389999, 2.59999 );
		TextDrawColor( Textdraw2[ i ], -16776961);
		TextDrawSetOutline( Textdraw2[ i ], 1);
		TextDrawSetProportional( Textdraw2[ i ], 0);

		Textdraw3[ i ] = TextDrawCreate(507.000000, 320.000000, "FPS:");
		TextDrawBackgroundColor( Textdraw3[ i ], 255);
		TextDrawFont( Textdraw3[ i ], 2);
		TextDrawLetterSize( Textdraw3[ i ], 0.389999, 2.499999);
		TextDrawColor( Textdraw3[ i ], -16776961);
		TextDrawSetOutline( Textdraw3[ i ], 1);
		TextDrawSetProportional( Textdraw3[ i ], 0);

		Textdraw4[ i ] = TextDrawCreate(507.000000, 335.000000, "PING:");
		TextDrawBackgroundColor( Textdraw4[ i ], 255);
		TextDrawFont( Textdraw4[ i ], 2);
		TextDrawLetterSize( Textdraw4[ i ], 0.349999, 2.699999);
		TextDrawColor( Textdraw4[ i ], -16776961);
		TextDrawSetOutline( Textdraw4[ i ], 1);
		TextDrawSetProportional( Textdraw4[ i ], 1);

		Textdraw5[ i ] = TextDrawCreate(507.000000, 320.000000, "FPS:");
		TextDrawBackgroundColor( Textdraw5[ i ], 255);
		TextDrawFont( Textdraw5[ i ], 2);
		TextDrawLetterSize( Textdraw5[ i ], 0.389999, 2.499999);
		TextDrawColor( Textdraw5[ i ], -16776961);
		TextDrawSetOutline( Textdraw5[ i ], 1);
		TextDrawSetProportional( Textdraw5[ i ], 0);
    }
	return 1;
}

public OnGameModeExit()
{
	for( new i = 0; i < MAX_PLAYERS; ++i )
	{
        TextDrawHideForPlayer( i, Textdraw0[ i ] );
		TextDrawDestroy( Textdraw0[ i ] );

        TextDrawHideForPlayer( i, Textdraw1[ i ] );
		TextDrawDestroy( Textdraw1[ i ] );

        TextDrawHideForPlayer( i, Textdraw2[ i ] );
		TextDrawDestroy( Textdraw2[ i ] );

        TextDrawHideForPlayer( i, Textdraw3[ i ] );
		TextDrawDestroy( Textdraw3[ i ] );

        TextDrawHideForPlayer( i, Textdraw4[ i ] );
		TextDrawDestroy( Textdraw4[ i ] );
		
        TextDrawHideForPlayer( i, Textdraw5[ i ] );
		TextDrawDestroy( Textdraw5[ i ] );
	}
	return 1;
}

public OnPlayerConnect( playerid )
{
	TextDrawShowForPlayer( playerid, Textdraw0 [ playerid ] ) ;
	TextDrawShowForPlayer( playerid, Textdraw1 [ playerid ] ) ;
	TextDrawShowForPlayer( playerid, Textdraw2 [ playerid ] ) ;
	TextDrawShowForPlayer( playerid, Textdraw3 [ playerid ] ) ;
	TextDrawShowForPlayer( playerid, Textdraw4 [ playerid ] ) ;
	TextDrawShowForPlayer( playerid, Textdraw5 [ playerid ] ) ;
	return 1;
}

public Actualizando ( )
{
	for ( new i = 0; i < MAX_PLAYERS; i++ )
	{
		if ( IsPlayerConnected ( i ) )
		{
			new string [ 128 ] ;
			
			format ( string, sizeof ( string ),"PING: " /*Sua Funзao */ );
			TextDrawSetString ( Textdraw0[ i ] , string ) ;

			format ( string, sizeof(string),"SPREE: " /*Sua Funзao */ );
			TextDrawSetString ( Textdraw1[ i ] , string ) ;

			format ( string, sizeof(string),"SCORE: " /*Sua Funзao */ );
			TextDrawSetString ( Textdraw2[ i ] , string ) ;

			format ( string, sizeof(string),"FPS: " /*Sua Funзao */ );
			TextDrawSetString ( Textdraw3[ i ] , string ) ;

			format ( string, sizeof(string),"PING: " /*Sua Funзao */ );
			TextDrawSetString ( Textdraw4[ i ] , string ) ;
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)