24.11.2013, 11:56
I will post 2 command because problem might be in command above /gascan
error (error line is marked in command /gascan - "return 0;")
pawn Код:
if(strcmp(cmdtext, "/refuel", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}You need to be in vehicle to use this command.");
if(IsRefuelling[playerid] == true) return SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}You are already refueling!");
if(IsPlayerInRangeOfGasStations(playerid))
{
if(Carinfo[vehicleid][F] >= 99) SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}Your fuel tank is full!");
{
KillTimer(GasTimer[playerid]); // It will kill timer to avoid any bugs
if(Carinfo[vehicleid][F] > 90 && Carinfo[vehicleid][F] < 99) GasPrice = 50;
if(Carinfo[vehicleid][F] > 80 && Carinfo[vehicleid][F] < 90) GasPrice = 100;
if(Carinfo[vehicleid][F] > 70 && Carinfo[vehicleid][F] < 80) GasPrice = 150;
if(Carinfo[vehicleid][F] > 60 && Carinfo[vehicleid][F] < 70) GasPrice = 200;
if(Carinfo[vehicleid][F] > 50 && Carinfo[vehicleid][F] < 60) GasPrice = 250;
if(Carinfo[vehicleid][F] > 40 && Carinfo[vehicleid][F] < 50) GasPrice = 300;
if(Carinfo[vehicleid][F] > 30 && Carinfo[vehicleid][F] < 40) GasPrice = 350;
if(Carinfo[vehicleid][F] > 20 && Carinfo[vehicleid][F] < 30) GasPrice = 400;
if(Carinfo[vehicleid][F] > 10 && Carinfo[vehicleid][F] < 20) GasPrice = 450;
if(Carinfo[vehicleid][F] < 10) GasPrice = 500;
if(GetPlayerMoney(playerid) < GasPrice) return SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}You don't have enough money.");
IsRefuelling[playerid] = true;
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Refuelling...", 1000, 5);
SetTimerEx("RefuelVehicle", 5000, 0, "d", playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}You are not near any gas pump.");
return 1;
}
}
if(strcmp(cmdtext, "/gascan", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}You need to be in vehicle to use this command.");
if(IsPlayerInRangeOfGasStations(playerid))
{
//
}
else
{
SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}You are not near any gas pump.");
return 1;
}
}
return 1;
}
return 0; // error line
}
pawn Код:
error 010: invalid function or declaration