Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* [P.I.S] Player Info System
- Este sistema mostra quanta vida o jogador tem (Percentagem %s por cima da barra da vida)
- Mostra 2 textDraws cada um dentro de uma box, contendo:
- 1TextDraw:
- - Nome do jogador;
- - ID do jogador;
- - Dinheiro;
- - Ping;
- - IP;
- 2TextDraw:
- - Coordenada X;
- - Coordenada Y;
- - Coordenada Z;
- - Ângulo;
- Créditos:
- Criador Geral: The Knight
- Box: LuxurioN
- */
- //Includes
- #include <a_samp>
- //Defines de Posições
- /* Cordenada X */
- #define CordenadaX 465.000000,340.000000
- #define LetterSizeX 0.299999,1.100000
- #define BoxColorX 0x00000066
- #define SetProportionalX 1
- #define SetOutlineX 1
- #define FontX 1
- /* Cordenada Y */
- #define CordenadaY 465.000000, 350.000000
- #define LetterSizeY 0.299999,1.100000
- #define SetProportionalY 1
- #define SetOutlineY 1
- #define FontY 1
- /*Cordenada Z */
- #define CordenadaZ 465.000000, 360.000000
- #define LetterSizeZ 0.299999,1.100000
- #define SetProportionalZ 1
- #define SetOutlineZ 1
- #define FontZ 1
- /* Cordenada Angulo */
- #define CordenadaA 465.000000, 370.000000
- #define LetterSizeA 0.299999,1.100000
- #define SetProportionalA 1
- #define SetOutlineA 1
- #define FontA 1
- /* Saude */
- #define BarraVida 560.000000, 66.000000
- #define LetterSizeBV 0.299999,1.100000
- #define SetProportionalBV 1
- #define SetOutlineBV 1
- #define FontBV 1
- /* Sentido */
- #define jSentido 465.000000, 380.000000
- #define LetterSizeS 0.299999,1.100000
- #define SetProportionalS 1
- #define SetOutlineS 1
- #define FontS 1
- /* Nome */
- #define jNome 465.000000,225.000000
- #define LetterSizeN 0.299999,1.100000
- #define BoxColorN 0x00000066
- #define SetProportionalN 1
- #define SetOutlineN 1
- #define FontN 1
- /* ID */
- #define jID 465.000000, 235.000000
- #define LetterSizeID 0.299999,1.100000
- #define SetProportionalID 1
- #define SetOutlineID 1
- #define FontID 1
- /* Dinheiro */
- #define jDinheiro 465.000000, 245.000000
- #define LetterSizeD 0.299999,1.100000
- #define SetProportionalD 1
- #define SetOutlineD 1
- #define FontD 1
- /* Ping */
- #define jPing 465.000000, 255.000000
- #define LetterSizeP 0.299999,1.100000
- #define SetProportionalP 1
- #define SetOutlineP 1
- #define FontP 1
- /* IP */
- #define jIP 465.000000, 265.000000
- #define LetterSizeI 0.299999,1.100000
- #define SetProportionalI 1
- #define SetOutlineI 1
- #define FontI 1
- //Textdraw Variaveis
- new Text: bVida[MAX_PLAYERS];
- new Text: cX[ MAX_PLAYERS ];
- new Text: cY[ MAX_PLAYERS ];
- new Text: cZ[ MAX_PLAYERS ];
- new Text: cA[ MAX_PLAYERS ];
- new Text: Nome[ MAX_PLAYERS ];
- new Text: ID[ MAX_PLAYERS ];
- new Text: Dinheiro[ MAX_PLAYERS ];
- new Text: Ping[ MAX_PLAYERS ];
- new Text: IP[ MAX_PLAYERS ];
- new Text: pLinha1[ MAX_PLAYERS ];
- new Text: pLinha2[ MAX_PLAYERS ];
- new Text: pLinha3[ MAX_PLAYERS ];
- new Text: pLinha4[ MAX_PLAYERS ];
- new Text: pBox[ MAX_PLAYERS ];
- new Text: pTitulo[MAX_PLAYERS];
- new Text: jLinha1[ MAX_PLAYERS ];
- new Text: jLinha2[ MAX_PLAYERS ];
- new Text: jLinha3[ MAX_PLAYERS ];
- new Text: jLinha4[ MAX_PLAYERS ];
- new Text: jBox[ MAX_PLAYERS ];
- new Text: jTitulo[MAX_PLAYERS];
- //Outras variáveis
- new Float: X, Float: Y, Float: Z, Float: Angulo;
- new Jogador[ MAX_PLAYER_NAME ];
- new sStr11[ 128 ];
- new sStr10[ 128 ];
- new sStr9[ 128 ];
- new sStr8[ 128 ];
- new sStr7[ 128 ];
- new sStr6[ 128 ];
- new sStr5[ 128 ];
- new sStr4[ 128 ];
- new sStr3[ 128 ];
- new sStr2[ 128 ];
- new pIP[ 16 ];
- new Float:jVida;
- //Forward
- forward PlayerSpawn( playerid, targetid );
- //Calbacks
- public OnFilterScriptInit()
- {
- print( "Sistema criado por: The Knight" );
- return true;
- }
- public OnPlayerConnect( playerid )
- {
- //Box Informacoes do Jogador
- jTitulo[ playerid ] = TextDrawCreate( 478.000000, 200.000000, "~w~ Informacoes do Jogador:" );
- TextDrawBackgroundColor( jTitulo[ playerid ], 0x000000f );
- TextDrawSetProportional( jTitulo[ playerid ], 1 );
- TextDrawLetterSize( jTitulo[ playerid ], 0.399999, 1.400000 );
- TextDrawSetOutline( jTitulo[ playerid ], 1 );
- TextDrawAlignment( jTitulo[ playerid ], 0 );
- TextDrawSetShadow( jTitulo[ playerid ], 1 );
- TextDrawColor( jTitulo[ playerid ], 0xFFF000AA );
- TextDrawFont( jTitulo[ playerid ], 0 );
- jBox[ playerid ] = TextDrawCreate( 612.000000, 220.000000, "C" ); //Center
- TextDrawUseBox( jBox[ playerid ], 1 );
- TextDrawBoxColor( jBox[ playerid ], 0x00000033 );
- TextDrawTextSize( jBox[ playerid ], 454.000000, 9.000000 );
- TextDrawAlignment( jBox[ playerid ], 0 );
- TextDrawBackgroundColor( jBox[ playerid ], 0x000000ff );
- TextDrawFont( jBox[ playerid ], 3 );
- TextDrawLetterSize( jBox[ playerid ], -0.000000, 8.700001 );
- TextDrawColor( jBox[ playerid ], 0xffffffff );
- TextDrawSetOutline( jBox[ playerid ], 1 );
- TextDrawSetProportional( jBox[ playerid ], 1 );
- TextDrawSetShadow( jBox[ playerid ], 1 );
- jLinha1[ playerid ] = TextDrawCreate( 609.000000, 224.000000, "L" ); //Acima
- TextDrawUseBox( jLinha1[ playerid ], 1 );
- TextDrawBoxColor( jLinha1[ playerid ], 0xffffff33 );
- TextDrawTextSize(jLinha1[ playerid ], 457.000000, -1.000000 );
- TextDrawAlignment( jLinha1[ playerid ], 0 );
- TextDrawBackgroundColor( jLinha1[ playerid ], 0x000000ff );
- TextDrawFont( jLinha1[ playerid ], 3 );
- TextDrawLetterSize( jLinha1[ playerid ], -0.000000, -0.400000 );
- TextDrawColor( jLinha1[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( jLinha1[ playerid ], 1 );
- TextDrawSetProportional( jLinha1[ playerid ], 1 );
- TextDrawSetShadow( jLinha1[ playerid ], 1 );
- jLinha2[ playerid ] = TextDrawCreate( 609.000000, 299.000000, "L" ); //Abaixo
- TextDrawUseBox( jLinha2[ playerid ], 1 );
- TextDrawBoxColor( jLinha2[ playerid ], 0xffffff33 );
- TextDrawTextSize( jLinha2[ playerid ], 457.000000, -9.000000 );
- TextDrawBackgroundColor( jLinha2[ playerid ], 0x000000ff );
- TextDrawFont( jLinha2[ playerid ], 3 );
- TextDrawLetterSize( jLinha2[ playerid ], -0.000000, -0.400000 );
- TextDrawColor( jLinha2[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( jLinha2[ playerid ], 1 );
- TextDrawSetProportional( jLinha2[ playerid ], 1 );
- TextDrawSetShadow( jLinha2[ playerid ], 1 );
- jLinha3[ playerid ] = TextDrawCreate( 466.000000, 226.000000, "T" ); //Esquerda
- TextDrawUseBox( jLinha3[ playerid ], 1 );
- TextDrawBoxColor( jLinha3[ playerid ], 0xffffff33 );
- TextDrawTextSize( jLinha3[ playerid ], 457.000000,0.000000 );
- TextDrawAlignment( jLinha3[ playerid ], 0 );
- TextDrawBackgroundColor( jLinha3[ playerid ], 0x000000ff );
- TextDrawFont( jLinha3[ playerid ], 3 );
- TextDrawLetterSize( jLinha3[ playerid ], -0.000000, 7.499998 );
- TextDrawColor( jLinha3[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( jLinha3[ playerid ], 1 );
- TextDrawSetProportional( jLinha3[ playerid ], 1 );
- TextDrawSetShadow( jLinha3[ playerid ], 1 );
- jLinha4[ playerid ] = TextDrawCreate( 607.000000, 226.000000, "T" ); //Direita
- TextDrawUseBox( jLinha4[ playerid ], 1 );
- TextDrawBoxColor( jLinha4[ playerid ], 0xffffff33 );
- TextDrawTextSize( jLinha4[ playerid ], 603.000000, -6.000000 );
- TextDrawAlignment( jLinha4[ playerid ], 0 );
- TextDrawBackgroundColor( jLinha4[ playerid ], 0x000000ff );
- TextDrawFont( jLinha4[ playerid ], 3 );
- TextDrawLetterSize( jLinha4[ playerid ], -0.000000, 7.499999 );
- TextDrawColor( jLinha4[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( jLinha4[ playerid ], 1 );
- TextDrawSetProportional( jLinha4[ playerid ], 1 );
- TextDrawSetShadow( jLinha4[ playerid ], 1 );
- //Box Posicoes do jogador
- pTitulo[ playerid ] = TextDrawCreate( 482.000000,320.000000, "~w~ Posicao do Jogador:" );
- TextDrawAlignment( pTitulo[ playerid ], 0 );
- TextDrawBackgroundColor( pTitulo[ playerid ], 0x000000ff );
- TextDrawFont( pTitulo[ playerid ], 0 );
- TextDrawLetterSize( pTitulo[ playerid ], 0.399999, 1.400000 );
- TextDrawColor( pTitulo[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( pTitulo[ playerid ], 1 );
- TextDrawSetProportional( pTitulo[ playerid ], 1 );
- TextDrawSetShadow( pTitulo[ playerid ], 1 );
- pBox[playerid] = TextDrawCreate( 612.000000, 338.000000, "C" );
- TextDrawUseBox( pBox[ playerid ],1 );
- TextDrawBoxColor( pBox[ playerid ], 0x00000033 );
- TextDrawTextSize( pBox[ playerid ], 454.000000, 9.000000 );
- TextDrawAlignment( pBox[ playerid ], 0 );
- TextDrawBackgroundColor( pBox[ playerid ], 0x000000ff );
- TextDrawFont( pBox[ playerid ], 3 );
- TextDrawLetterSize( pBox[ playerid ], -0.000000, 8.700001 );
- TextDrawColor( pBox[ playerid ], 0xffffffff );
- TextDrawSetOutline( pBox[ playerid ], 1 );
- TextDrawSetProportional( pBox[ playerid ], 1 );
- TextDrawSetShadow( pBox[ playerid ], 1 );
- pLinha1[ playerid ] = TextDrawCreate( 609.000000,341.000000, "L" );
- TextDrawUseBox( pLinha1[ playerid ], 1 );
- TextDrawBoxColor( pLinha1[ playerid ], 0xffffff33 );
- TextDrawTextSize( pLinha1[ playerid ], 457.000000, -1.00000 );
- TextDrawAlignment( pLinha1[ playerid ], 0);
- TextDrawBackgroundColor( pLinha1[ playerid ], 0x000000ff );
- TextDrawFont( pLinha1[ playerid ], 3);
- TextDrawLetterSize( pLinha1[ playerid ], -0.000000, -0.400000 );
- TextDrawColor( pLinha1[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( pLinha1[ playerid ], 1 );
- TextDrawSetProportional( pLinha1[ playerid], 1 );
- TextDrawSetShadow( pLinha1[ playerid ], 1 );
- pLinha2[ playerid ] = TextDrawCreate( 609.000000,416.000000, "L" );
- TextDrawUseBox( pLinha2[ playerid ], 1 );
- TextDrawBoxColor( pLinha2[ playerid ], 0xffffff33 );
- TextDrawTextSize( pLinha2[ playerid ], 457.000000, -9.000000 );
- TextDrawBackgroundColor( pLinha2[ playerid ], 0x000000ff );
- TextDrawFont( pLinha2[ playerid ], 3 );
- TextDrawLetterSize( pLinha2[ playerid ], -0.000000, -0.400000 );
- TextDrawColor( pLinha2[ playerid ], 0xffffffff );
- TextDrawSetOutline( pLinha2[ playerid ], 1 );
- TextDrawSetProportional( pLinha2[ playerid ], 1 );
- TextDrawSetShadow( pLinha2[ playerid ], 1 );
- pLinha3[ playerid ] = TextDrawCreate( 466.000000,343.000000, "T" ); //365 340
- TextDrawUseBox( pLinha3[ playerid ],1 );
- TextDrawBoxColor( pLinha3[ playerid ],0xffffff33 );
- TextDrawTextSize( pLinha3[ playerid ], 457.000000, 0.000000 );
- TextDrawAlignment( pLinha3[ playerid ], 0 );
- TextDrawBackgroundColor( pLinha3[ playerid ], 0x000000ff );
- TextDrawFont( pLinha3[ playerid ], 3 );
- TextDrawLetterSize( pLinha3[ playerid ], -0.000000,7.499998 );
- TextDrawColor( pLinha3[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( pLinha3[ playerid ], 1 );
- TextDrawSetProportional( pLinha3[ playerid ], 1 );
- TextDrawSetShadow( pLinha3[ playerid ], 1 );
- pLinha4[playerid] = TextDrawCreate( 607.000000,343.000000, "T" );
- TextDrawUseBox( pLinha4[ playerid ], 1 );
- TextDrawBoxColor( pLinha4[ playerid ], 0xffffff33 );
- TextDrawTextSize( pLinha4[ playerid ], 603.000000, -6.000000 );
- TextDrawAlignment( pLinha4[ playerid ], 0);
- TextDrawBackgroundColor( pLinha4[ playerid ], 0x000000ff );
- TextDrawFont( pLinha4[ playerid ], 3 );
- TextDrawLetterSize( pLinha4[ playerid ], -0.000000, 7.499999 );
- TextDrawColor( pLinha4[ playerid ], 0xFFF000AA );
- TextDrawSetOutline( pLinha4[ playerid ], 1 );
- TextDrawSetProportional( pLinha4[ playerid], 1 );
- TextDrawSetShadow( pLinha4[ playerid ], 1 );
- //Barra da saude
- bVida[ playerid ] = TextDrawCreate( BarraVida, "%0.1f" );
- TextDrawSetProportional( bVida[ playerid ], SetProportionalBV );
- TextDrawLetterSize( bVida[ playerid ], LetterSizeBV );
- TextDrawSetOutline( bVida[ playerid ], SetOutlineBV );
- TextDrawFont( bVida[ playerid ], FontBV );
- //Coordeanda X
- cX[ playerid ] = TextDrawCreate( CordenadaX, "~b~Cordenada X: ~w~%0.2f" );
- TextDrawSetProportional( cX[ playerid ], SetProportionalX );
- TextDrawLetterSize( cX[ playerid ], LetterSizeX );
- TextDrawSetOutline( cX[ playerid ], SetOutlineX );
- TextDrawFont( cX[ playerid ], FontX );
- //Coordenada Y
- cY[ playerid ] = TextDrawCreate( CordenadaY, "~b~Cordenada Y: ~w~%0.2f" );
- TextDrawSetProportional( cY[ playerid ], SetProportionalY );
- TextDrawLetterSize( cY[ playerid ], LetterSizeY );
- TextDrawSetOutline( cY[ playerid ], SetOutlineY );
- TextDrawFont( cY[ playerid ], FontY );
- //Coordeanda Z
- cZ[ playerid ] = TextDrawCreate( CordenadaZ, "~b~Cordenada Z: ~w~%0.2f" );
- TextDrawSetProportional( cZ[ playerid ], SetProportionalZ );
- TextDrawLetterSize( cZ[ playerid ], LetterSizeZ );
- TextDrawSetOutline( cZ[ playerid ], SetOutlineZ );
- TextDrawFont( cZ[ playerid ], FontZ );
- //Ângulo
- cA[ playerid ] = TextDrawCreate( CordenadaA, "~b~Ângulo: ~w~%0.2f" );
- TextDrawSetProportional( cA[ playerid ], SetProportionalA );
- TextDrawLetterSize( cA[ playerid ], LetterSizeA );
- TextDrawSetOutline( cA[ playerid ], SetOutlineA );
- TextDrawFont( cA[ playerid ], FontA );
- //Nome X
- Nome[ playerid ] = TextDrawCreate( jNome, "~b~Nome:~w~ %s" );
- TextDrawSetProportional( Nome[ playerid ], SetProportionalN );
- TextDrawLetterSize( Nome[ playerid ], LetterSizeN );
- TextDrawSetOutline( Nome[ playerid ], SetOutlineN );
- TextDrawFont( Nome[ playerid ], FontN );
- //ID
- ID[ playerid ] = TextDrawCreate( jID, "~b~Player ID:~w~ %d" );
- TextDrawSetProportional( ID[ playerid ], SetProportionalID );
- TextDrawLetterSize( ID[ playerid ], LetterSizeID );
- TextDrawSetOutline( ID[ playerid ], SetOutlineID );
- TextDrawFont( ID[ playerid ], FontID );
- //Dinheiro
- Dinheiro[ playerid ] = TextDrawCreate( jDinheiro, "~b~Dinheiro:~w~ %d" );
- TextDrawSetProportional( Dinheiro[ playerid ], SetProportionalD );
- TextDrawLetterSize( Dinheiro[ playerid ], LetterSizeD );
- TextDrawSetOutline( Dinheiro[ playerid ], SetOutlineD );
- TextDrawFont( Dinheiro[ playerid ], FontD );
- //Ping
- Ping[ playerid ] = TextDrawCreate( jPing, "~b~Ping:~w~ %d" );
- TextDrawSetProportional( cA[ playerid ], SetProportionalP );
- TextDrawLetterSize( Ping[ playerid ], LetterSizeP );
- TextDrawSetOutline( Ping[ playerid ], SetOutlineP );
- TextDrawFont( Ping[ playerid ], FontP );
- //IP
- IP[ playerid ] = TextDrawCreate( jIP, "~b~IP:~w~ %s" );
- TextDrawSetProportional( IP[ playerid ], SetProportionalI );
- TextDrawLetterSize( IP[ playerid ], LetterSizeI );
- TextDrawSetOutline( IP[ playerid ], SetOutlineI );
- TextDrawFont( IP[ playerid ], FontI );
- return true;
- }
- public PlayerSpawn( playerid )
- {
- GetPlayerName( playerid, Jogador, sizeof( Jogador ) );
- GetPlayerHealth( playerid, jVida );
- GetPlayerPos( playerid, X, Y, Z );
- GetPlayerFacingAngle( playerid, Angulo);
- GetPlayerIp( playerid, pIP, sizeof( pIP ) );
- format( sStr11, sizeof( sStr11 ), "~b~Nome:~w~ %s", Jogador );
- format( sStr10, sizeof( sStr10 ), "~b~Player ID:~w~ %d", playerid );
- format( sStr9, sizeof( sStr9 ), "~b~Dinheiro:~w~ %d", GetPlayerMoney( playerid ) );
- format( sStr8, sizeof( sStr8 ), "~b~Ping:~w~ %d", GetPlayerPing( playerid ) );
- format( sStr7, sizeof( sStr7 ), "~b~IP:~w~ %s", pIP );
- format( sStr6, sizeof( sStr6 ), "%0.1f", jVida );
- format( sStr5, sizeof( sStr5 ), "~b~Cordenada X: ~w~%0.2f", X );
- format( sStr4, sizeof( sStr4 ), "~b~Cordenada Y: ~w~%0.2f", Y );
- format( sStr3, sizeof( sStr3 ), "~b~Cordenada Z: ~w~%0.2f", Z );
- format( sStr2, sizeof( sStr2 ), "~b~Angulo: ~w~%0.2f", Angulo );
- TextDrawSetString( Nome[ playerid ], sStr11 );
- TextDrawSetString( ID[ playerid ], sStr10 );
- TextDrawSetString( Dinheiro[ playerid ], sStr9 );
- TextDrawSetString( Ping[ playerid ], sStr8 );
- TextDrawSetString( IP[ playerid ], sStr7 );
- TextDrawSetString( bVida[ playerid ], sStr6 );
- TextDrawSetString( cX[ playerid ], sStr5 );
- TextDrawSetString( cY[ playerid ], sStr4 );
- TextDrawSetString( cZ[ playerid ], sStr3 );
- TextDrawSetString( cA[ playerid ], sStr2 );
- return true;
- }
- public OnPlayerSpawn( playerid )
- {
- SetTimer("PlayerSpawn", 250, true);
- TextDrawShowForPlayer( playerid, bVida[ playerid ] );
- TextDrawShowForPlayer( playerid, cX[ playerid ] );
- TextDrawShowForPlayer( playerid, cY[ playerid ] );
- TextDrawShowForPlayer( playerid, cZ[ playerid ] );
- TextDrawShowForPlayer( playerid, cA[ playerid ] );
- TextDrawShowForPlayer( playerid, Nome[ playerid ] );
- TextDrawShowForPlayer( playerid, ID[ playerid ] );
- TextDrawShowForPlayer( playerid, Dinheiro[ playerid ] );
- TextDrawShowForPlayer( playerid, Ping[ playerid ] );
- TextDrawShowForPlayer( playerid, IP[ playerid ] );
- TextDrawShowForPlayer( playerid, pLinha1[ playerid ] );
- TextDrawShowForPlayer( playerid, pLinha2[ playerid ] );
- TextDrawShowForPlayer( playerid, pLinha3[ playerid ] );
- TextDrawShowForPlayer( playerid, pLinha4[ playerid ] );
- TextDrawShowForPlayer( playerid, pBox[ playerid ] );
- TextDrawShowForPlayer( playerid, pTitulo[ playerid ] );
- TextDrawShowForPlayer( playerid, jLinha1[ playerid ] );
- TextDrawShowForPlayer( playerid, jLinha2[ playerid ] );
- TextDrawShowForPlayer( playerid, jLinha3[ playerid ] );
- TextDrawShowForPlayer( playerid, jLinha4[ playerid ] );
- TextDrawShowForPlayer( playerid, jBox[ playerid ] );
- TextDrawShowForPlayer( playerid, jTitulo[ playerid ] );
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement