21.05.2011, 22:21
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:
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);
}