[Pedido] Sistema de coordenadas in-game
#1

Olб, gostaria de saber se conhecem algum sistema que mostre as coordenadas in game (nгo um salvador de coords, apenas uma textdraw que mostre a pos X, Y e Z)... Jб usei o Search e o ****** e os ъnicos resultados que obtive foram de salvamento de coords apуs sair, alguйm conhece algum sistema assim?


PS: Caso ninguйm encontre ou conheзa, vocкs gostariam de que eu criasse e postasse um fs assim?
Reply
#2

Use o Zamaroth's TextDraw Editor =)

Vocк cria a TextDraw de qualquer geito, coloca lб encima em size, depois coloca a segunda opзгo ai vai movendo na tela que vai mostrando a cordenada X Y Z ali embaixo =)
Reply
#3

usa o /save para saber as Cords X , Y , Z
Reply
#4

eu havia feito um desse mбs nгo cheguei a posta-lo .. й muito simples e nгo daria como fs o meu completo deu menos de 100 Linhas :0

Cуdigo ъtil
Reply
#5

Quote:

Use o Zamaroth's TextDraw Editor =)

Vocк cria a TextDraw de qualquer geito, coloca lб encima em size, depois coloca a segunda opзгo ai vai movendo na tela que vai mostrando a cordenada X Y Z ali embaixo =)

/z Somebody Kill-me... Й pra mostrar as coordenadas do jogador in-game.

Quote:

usa o /save para saber as Cords X , Y , Z

LoooL tб de saca? asdhuashudashudhu lк o post dnv...

Quote:

eu havia feito um desse mбs nгo cheguei a posta-lo .. й muito simples e nгo daria como fs o meu completo deu menos de 100 Linhas :0

Cуdigo ъtil

Hmm de boa entгo acho que vou criar e postar um tutorial de como colocar no gamemode...

Obrigado a todos mas se alguйm achar um sistema assim avisa ai...
Reply
#6

Fiz aqui rapidinho para vocк:

pawn Код:
#include <a_samp>
#include <YSI\y_commands>

new
    PlayerText: txtdrw_coords [ MAX_PLAYERS ],
    Float: flo_old_pos [ MAX_PLAYERS ] [ 3 ],
    time_coords [ MAX_PLAYERS ];

forward UpdatePlayerCoords ( playerid );

public OnPlayerConnect ( playerid )
{
    txtdrw_coords [ playerid ] = CreatePlayerTextDraw ( playerid, 357.000000, 359.000000, "--.------, --.-------, --.------" );
    PlayerTextDrawAlignment ( playerid, txtdrw_coords [ playerid ], 2 );
    PlayerTextDrawBackgroundColor ( playerid, txtdrw_coords [ playerid ], 255 );
    PlayerTextDrawFont ( playerid, txtdrw_coords [ playerid ], 2 );
    PlayerTextDrawLetterSize ( playerid, txtdrw_coords [ playerid ], 0.580000, 4.300000 );
    PlayerTextDrawColor ( playerid, txtdrw_coords [ playerid ], -1 );
    PlayerTextDrawSetOutline ( playerid, txtdrw_coords [ playerid ], 0 );
    PlayerTextDrawSetProportional ( playerid, txtdrw_coords [ playerid ], 1 );
    PlayerTextDrawSetShadow ( playerid, txtdrw_coords [ playerid ], 1 );
    PlayerTextDrawSetSelectable ( playerid, txtdrw_coords [ playerid ], 0 );

    return 1;
}

public UpdatePlayerCoords ( playerid )
{
    new
        Float: flo_new_pos [ MAX_PLAYERS ] [ 3 ];

    if ( flo_new_pos [ playerid ] [ 0 ] != flo_old_pos [ playerid ] [ 0 ] &&
         flo_new_pos [ playerid ] [ 1 ] != flo_old_pos [ playerid ] [ 1 ] &&
         flo_new_pos [ playerid ] [ 2 ] != flo_old_pos [ playerid ] [ 2 ] )
    {
        new
            str_text_formatted [ 128 ];

        GetPlayerPos ( playerid, flo_old_pos [ playerid ] [ 0 ], flo_old_pos [ playerid ] [ 1 ], flo_old_pos [ playerid ] [ 2 ] );
        format ( str_text_formatted, sizeof str_text_formatted, "%f, %f, %f", flo_old_pos [ playerid ] [ 0 ], flo_old_pos [ playerid ] [ 1 ], flo_old_pos [ playerid ] [ 2 ] );
        PlayerTextDrawShow ( playerid, txtdrw_coords [ playerid ] );
        PlayerTextDrawSetString ( playerid, txtdrw_coords [ playerid ], str_text_formatted );
    }

    return 1;
}

ShowPlayerCoords ( playerid )
{
    new
        str_text_formatted [ 128 ];

    GetPlayerPos ( playerid, flo_old_pos [ playerid ] [ 0 ], flo_old_pos [ playerid ] [ 1 ], flo_old_pos [ playerid ] [ 2 ] );
    format ( str_text_formatted, sizeof str_text_formatted, "%f, %f, %f", flo_old_pos [ playerid ] [ 0 ], flo_old_pos [ playerid ] [ 1 ], flo_old_pos [ playerid ] [ 2 ] );
    PlayerTextDrawShow ( playerid, txtdrw_coords [ playerid ] );
    PlayerTextDrawSetString ( playerid, txtdrw_coords [ playerid ], str_text_formatted );

    time_coords [ playerid ] = SetTimerEx ( "UpdatePlayerCoords", 500, true, "i", playerid );

    return 1;
}

HidePlayerCoords ( playerid )
{
    PlayerTextDrawHide ( playerid, txtdrw_coords [ playerid ] );
    KillTimer ( time_coords [ playerid ] );
    return 1;
}

YCMD:mostrarcoords ( playerid, params [ ], help )
{
    ShowPlayerCoords ( playerid );
    return 1;
}

YCMD:escondercoords ( playerid, params [ ], help )
{
    HidePlayerCoords ( playerid );
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)