02.08.2010, 19:28
hello there i am making my gamemode and i can't find problem in my fuel system
here is the part of script
when i refuel vehicle it doesn't take my money.
please help.
here is the part of script
pawn Код:
if (strcmp(cmd, "/fuelvehicle", true) ==0 )
{
if (PlayerToPoint(10.0, playerid,-1674.7214,414.8608,6.7380) || PlayerToPoint(10.0, playerid,-1680.3044,420.9971,6.7356) || PlayerToPoint(10.0, playerid,-2416.8726,971.9842,44.8690))
{
if(IsPlayerInAnyVehicle(playerid))
{
new fuel[MAX_PLAYERS], money[MAX_PLAYERS];
fuel[playerid] = 100 - strval(Fuel[vehicleid]);
money[playerid] = strval(fuel[playerid]) * 5;
money[playerid] = money[playerid] * (-1);
if(GetPlayerMoney(playerid) >= money[playerid])
{
if(engine[vehicleid] == 1)
{
SendClientMessage(playerid, COLOR_BLUE, "The vehicle's engine must be off.");
return 1;
}
Fuel[vehicleid] = 100;
SendClientMessage(playerid, COLOR_SPRINGGREEN, "Your car's gas is refueled");
GivePlayerMoney(playerid, money[playerid]);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "You don't have enough money");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "You're not at a gas station");
return 1;
}
}
please help.