SA-MP Forums Archive
format - 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: format (/showthread.php?tid=256661)



format - BaubaS - 21.05.2011

Im creating "speed cameras", its working good, but I have a small problem with the fine.

Line:

format(Stringas, 90, "{FFFFFF}[ {FFFF00}GREIИIO MATUOKLIS {FFFFFF}]: Jыs gavote {FFFF00}$%d {FFFFFF}baudа", GetVehicleSpeed(GetPlayerVehicleID(i)) - 85);

And its show not the value(like 90-85=5) but -1. If I use %f instead of %d then its shows 0.00000.

GetVehicleSpeed:

pawn Код:
stock GetVehicleSpeed(vehicleid)
{
    new Float: Pozicija[3];
    GetVehicleVelocity(vehicleid, Pozicija[0], Pozicija[1], Pozicija[2]);
    return floatround(floatsqroot(Pozicija[0] * Pozicija[0] + Pozicija[1] * Pozicija[1] + Pozicija[2] * Pozicija[2]) * 160);
}



Re: format - BaubaS - 22.05.2011

Bump