SA-MP Forums Archive
[Ajuda] Sistema de localizaзгoІ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Sistema de localizaзгoІ (/showthread.php?tid=660415)



Sistema de localizaзгoІ - MateGPlay - 02.11.2018

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


Re: Sistema de localizaзгoІ - cristiannh2 - 02.11.2018

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..


Re: Sistema de localizaзгoІ - MateGPlay - 02.11.2018

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!