SA-MP Forums Archive
how to convert this.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to convert this.. (/showthread.php?tid=191625)



how to convert this.. - The_Gangstas - 19.11.2010

like how do i make this return

metres.milimetres

and kilometers. meters

and if kilometers = more than one use the second format( kilometers.metres) and if its less than 1 = 0 do the first format

pawn Код:
stock Float:GetPlayerDistanceToPoint(playerid, Float:x, Float:y, Float:z)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    pX -= x, pY -= y, pZ -= z;
    return floatsqroot( (pX * pX) + (pY * pY) + (pZ * pZ) );
}