[Ajuda] Sistema de localizaзгoІ
#1

Eu fiz uma textdraw para mostrar o nome do procurado e a distвncia que ele estб do playerid mas na textdraw abaixo apareceu um numero muito grande(acho que й a soma do x, y, z) mas ja tentei varias coisas, mas nгo consegui resolver.
Queria apenas ver a distancia em que o procurado estб do playerid, codigo:
PHP Code:
public TextLocalizado(playeridgiveplayerid)
{
        if(
IsPlayerConnected(giveplayerid))
        {
         new 
giveplayer[78], string[78];
         
GetPlayerName(playeridsendernamesizeof(sendername));
         
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
         new 
Float:xFloat:yFloat:z;
         
GetPlayerPos(giveplayeridxyz);
         new 
Float:Procurado GetPlayerDistanceFromPoint(playeridxyz);
         
TextDrawHideForPlayer(playerid,oficial4);
         
TextDrawHideForPlayer(playerid,TextLocalizando);
         
format(stringsizeof(string), "Procurado: %s     Distancia: %d metros" giveplayerProcurado);
          
TextDrawSetString(TextLocalizandostring);
         
TextDrawShowForPlayer(playerid,TextLocalizando);
        }
        else
        {
        
TextDrawHideForPlayer(playerid,TextLocalizando);
        
TextDrawShowForPlayer(playerid,oficial4);
        }

Print Do Problema: https://prnt.sc/ldnw6y
Reply
#2

PHP Code:
public TextLocalizado(playeridgiveplayerid

        if(
IsPlayerConnected(giveplayerid)) 
        { 
         new 
giveplayer[78], string[78]; 
         
GetPlayerName(playeridsendernamesizeof(sendername)); 
         
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer)); 
         new 
Float:xFloat:yFloat:z
         
GetPlayerPos(giveplayeridxyz); 
         new 
Float:Procurado GetPlayerDistanceFromPoint(playeridxyz); 
         
TextDrawHideForPlayer(playerid,oficial4); 
         
TextDrawHideForPlayer(playerid,TextLocalizando); 
         
format(stringsizeof(string), "Procurado: %s     Distancia: %.2f metros" giveplayerProcurado); 
          
TextDrawSetString(TextLocalizandostring); 
         
TextDrawShowForPlayer(playerid,TextLocalizando); 
        } 
        else 
        { 
        
TextDrawHideForPlayer(playerid,TextLocalizando); 
        
TextDrawShowForPlayer(playerid,oficial4); 
        } 

Teste..
Reply
#3

Quote:
Originally Posted by cristiannh2
View Post
PHP Code:
public TextLocalizado(playeridgiveplayerid

        if(
IsPlayerConnected(giveplayerid)) 
        { 
         new 
giveplayer[78], string[78]; 
         
GetPlayerName(playeridsendernamesizeof(sendername)); 
         
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer)); 
         new 
Float:xFloat:yFloat:z
         
GetPlayerPos(giveplayeridxyz); 
         new 
Float:Procurado GetPlayerDistanceFromPoint(playeridxyz); 
         
TextDrawHideForPlayer(playerid,oficial4); 
         
TextDrawHideForPlayer(playerid,TextLocalizando); 
         
format(stringsizeof(string), "Procurado: %s     Distancia: %.2f metros" giveplayerProcurado); 
          
TextDrawSetString(TextLocalizandostring); 
         
TextDrawShowForPlayer(playerid,TextLocalizando); 
        } 
        else 
        { 
        
TextDrawHideForPlayer(playerid,TextLocalizando); 
        
TextDrawShowForPlayer(playerid,oficial4); 
        } 

Teste..
Funcionou Vlw!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)