SA-MP Forums Archive
Converter distance - 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)
+--- Thread: Converter distance (/showthread.php?tid=640270)



Converter distance - RedGun2015 - 30.08.2017

Hello guys! I work for a trucker job system and i need to convert metres in kilometres. ex: 1200 metres = 1.2 km.

I don't really know how can I do that, to create a public,stock or something for calculating metres in km.

If someone want to help me, I will be thankful.


Re: Converter distance - Vince - 30.08.2017

Divide by 1000, how difficult can it be?


Re: Converter distance - RedGun2015 - 30.08.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
Divide by 1000, how difficult can it be?
I got this error: warning 213: tag mismatch

Код:
stock DistanceConvert(Float:metres) // this is the line
{
	return metres / 1000;
}
Use (ex):
Код:
new Float:gg, Floats[3];
gg = GetPlayerPos(playerid, Floats[0], Floats[1], Floats[2]);
SCMF(playerid, -1, "%d", DistanceConvert(gg));
Can you help me, please?