16.07.2014, 05:49
I've never used floatround, but I researched it and I think you're using it wrong.
Try this:
Try this:
pawn Код:
case CHECKPOINT_RETURNTRUCK:
{
if(TruckDeliveringTo[vehicleid] != INVALID_BUSINESS_ID)
{
new iBusiness = TruckDeliveringTo[vehicleid], iDistex, paymentEx;
new Float: iDist = GetPlayerDistanceFromPoint(playerid, Businesses[iBusiness][bSupplyPos][0], Businesses[iBusiness][bSupplyPos][1], Businesses[iBusiness][bSupplyPos][2]);
iDistex = floatround(iDist, floatround_round);
paymentEx = iDistex / 3000 * payment;
if (paymentEx > 25000) paymentEx = 25000;
GivePlayerCash(playerid, paymentEx);
format(string, sizeof(string), "* You were paid $%d for delivering the goods and returning the vehicle.", paymentEx);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
SetVehicleToRespawn(vehicleid);
}
}