22.08.2015, 23:34
Hello! Why does it returns me ingame the "You don't have enough money message", even if I do have enough money?
PHP код:
CMD:refill(playerid, params[])
{
new Float:v=100.0;
v-=CarFuel[GetPlayerVehicleID(playerid)];
v/=100.0;
v*=BusinessInfo[23][bFee];
if(GetPlayerMoney(playerid) >= floatround(v))
{
format( fillstring, sizeof(fillstring), "You payed {FFFFFF}%d"ORANGESV"$ to refill your car's fuel.", floatround(v));
BusinessInfo[23][bMoney] += floatround(v);
GivePlayerTheMoney(playerid, - floatround(v));
SCM(playerid, ORANGES, fillstring);
foreach(Player, i)
{
if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
KillTimer(CarTimer[playerid]);
TogglePlayerControllable(i, 0);
FillTimer[playerid] = SetTimerEx("Fill", 250, false, "i", i);
}
}
}
else SCM(playerid, COLOR_DGREY, "You don't have enough money.");
return 1;
}