Returning unknown command
#1

Went over this a few times, need a second set of eyes. This keeps returning an unknown command when executed IG

pawn Код:
CMD:refuel(playerid, params[]) {
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
        new
            vehicleID = GetPlayerVehicleID(playerid);

        if(playerData[playerid][pRefill] != INVALID_VEHICLE_ID) {
            businessData[playerData[playerid][pGasStation]][businessMoney] += playerData[playerid][pRefillPrice];
            saveBusiness(playerData[playerid][pGasStation]);

            givePlayerCash(playerid, -playerData[playerid][pRefillPrice]);

            sendServerMessage(playerid, "You have refueled your vehicle for $%s.", number_format(playerData[playerid][pRefillPrice]));
            stopRefilling(playerid);

            return 1;
        }
       
        if(!vehicleID)
            return sendErrorMessage(playerid, "You are not inside any vehicle!");

        if(GetEngineStatus(vehicleID))
            return sendErrorMessage(playerid, "You must turn the engine off first.");

        new
            localpumpID = nearestPump(playerid);

        if(localpumpID != -1) {
            if(floatround(vehicleData[vehicleID][v_fFuel], floatround_round) > 95)
                return sendErrorMessage(playerid, "This vehicle doesn't need any fuel.");

            if(isPumpOccupied(localpumpID))
                return sendErrorMessage(playerid, "This fuel pump is already occupied.");

            if(pumpData[localpumpID][pumpFuel] < 1)
                return sendErrorMessage(playerid, "This pump doesn't have enough fuel.");

            playerData[playerid][pGasPump] = localpumpID;
            playerData[playerid][pGasStation] = pumpData[localpumpID][pumpBusinessID];

            playerData[playerid][pRefill] = vehicleID;
           
            SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has started refilling their vehicle.", getPlayerName(playerid, 0));

            SetTimerEx("OtherTimerEx", 500, false, "ii", playerid, TYPE_REFUEL_VEHICLE);
        }
        else sendErrorMessage(playerid, "You are not in range of a unused gas pump.");
    }
    else sendErrorMessage(playerid, "You are not inside any vehicle.");
    return 1;
}
Reply


Messages In This Thread
Returning unknown command - by conor565 - 06.09.2015, 19:00
Re: Returning unknown command - by Nixtren - 06.09.2015, 19:49
Re: Returning unknown command - by conor565 - 06.09.2015, 19:54
Re: Returning unknown command - by Nixtren - 06.09.2015, 20:07
Re: Returning unknown command - by conor565 - 06.09.2015, 20:23
Re: Returning unknown command - by Nixtren - 06.09.2015, 20:39
Re: Returning unknown command - by Threshold - 07.09.2015, 03:56

Forum Jump:


Users browsing this thread: 1 Guest(s)