From 42463a6c88e60fb4e926bed2decdff44262f9b06 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:47:13 -0600 Subject: [PATCH] Add some more debug logs --- scripts/server/vehicle.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/server/vehicle.js b/scripts/server/vehicle.js index 498b53f4..e7c31367 100644 --- a/scripts/server/vehicle.js +++ b/scripts/server/vehicle.js @@ -483,6 +483,7 @@ function vehicleAdminColourCommand(command, params, client) { function vehicleAdminRepairCommand(command, params, client) { if(!isPlayerInAnyVehicle(client)) { + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} could not repair their vehicle. Reason: Not in a vehicle.`); messagePlayerError(client, "You need to be in a vehicle!"); return false; } @@ -490,27 +491,29 @@ function vehicleAdminRepairCommand(command, params, client) { let vehicle = getPlayerVehicle(client); if(!getVehicleData(vehicle)) { + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} could not repair their ${getVehicleName(vehicle)} vehicle. Not a server vehicle.`); messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled")); return false; } if(!isAtPayAndSpray(getVehiclePosition(vehicle))) { if(!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageVehicles"))) { + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} could not repair their ${getVehicleName(vehicle)} vehicle. Not at a mechanic shop.`); messagePlayerError(client, "You need to be at a pay-n-spray!"); return false; } } if(getPlayerCurrentSubAccount(client).cash < getGlobalConfig().repairVehicleCost) { + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} could not repair their ${getVehicleName(vehicle)} vehicle. Not enough cash (Has: $${getPlayerCurrentSubAccount(client).cash}, Needs: $${getGlobalConfig().repairVehicleCost})`); messagePlayerError(client, `You don't have enough money to repair the vehicle (need $${makeLargeNumberReadable(getGlobalConfig().resprayVehicleCost-getPlayerCurrentSubAccount(client).cash)} more!)`); return false; } + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} repaired their ${getVehicleName(vehicle)} vehicle`); takePlayerCash(client, getGlobalConfig().repairVehicleCost); repairVehicle(vehicle); - getVehicleData(vehicle).needsSaved = true; - meActionToNearbyPlayers(client, `repairs the ${getVehicleName(vehicle)}`); }