30.07.2010, 22:16
hi all, so there is one problem when i refuel my car, it refuel it ok but it doesn't take my money, like its free,
here the script. i hope someone can help me
here the script. i hope someone can help me
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 - Fuel[vehicleid];
money[playerid] = strval(fuel[playerid]) * 5;
if(GetPlayerCash(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");
GivePlayerCash(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;
}
}