25.10.2013, 06:49
(
Последний раз редактировалось Lops; 25.10.2013 в 13:31.
)
So. I have the problem with command /fill. It supposed to refuel my vehicle with certain amount of fuel.
If i write example /fill 12, it isn't refuel my vehicle properly and the fuel meter don't increase about 12. Sometimes if i refuel my vehicle, it says, that, "Your car is full of fuel" or sth, but it isn't.
Here is the command, what may help you to understand, whats the problem. I can't figure it out.
If i write example /fill 12, it isn't refuel my vehicle properly and the fuel meter don't increase about 12. Sometimes if i refuel my vehicle, it says, that, "Your car is full of fuel" or sth, but it isn't.
Here is the command, what may help you to understand, whats the problem. I can't figure it out.
pawn Код:
command(fill, playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid), fuel;
if(PetrolStations(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Engine[vehicleid] == 0)
{
if(sscanf(params, "i", fuel)) return SendClientMessage(playerid, WHITE, "Kasutus: /fill [amount(1-100)]");
{
new amount = VehicleFuel[vehicleid] + fuel;
if(amount < 100)
{
KillTimer(FuelTimer[playerid]);
VehicleFuel[vehicleid] += fuel;
new value = fuel * 2;
GivePlayerMoney(playerid, value);
if(VehicleFuel[playerid] > 100)
{
VehicleFuel[vehicleid] = 100;
}
FuelLowerTimer(playerid, vehicleid);
}
else return SendClientMessage(playerid, WHITE, "Your vehicle is full of fuel. (/einfo)");
}
}
else return SendClientMessage(playerid, WHITE, "You have to turn engine off first.");
}
else return SendClientMessage(playerid, WHITE, "You have to be in vehicle.");
}
else return SendClientMessage(playerid, WHITE, "You are not nere any gas stations.");
return 1;
}