Use new AGRP prefix on console msg
This commit is contained in:
@@ -170,15 +170,15 @@ class VehicleData {
|
||||
// ===========================================================================
|
||||
|
||||
function initVehicleScript() {
|
||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Initializing vehicle script ...");
|
||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Vehicle script initialized successfully!");
|
||||
logToConsole(LOG_INFO, "[AGRP.Vehicle]: Initializing vehicle script ...");
|
||||
logToConsole(LOG_INFO, "[AGRP.Vehicle]: Vehicle script initialized successfully!");
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadVehiclesFromDatabase() {
|
||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Loading vehicles from database ...");
|
||||
logToConsole(LOG_INFO, "[AGRP.Vehicle]: Loading vehicles from database ...");
|
||||
let dbConnection = connectToDatabase();
|
||||
let tempVehicles = [];
|
||||
let dbAssoc;
|
||||
@@ -195,7 +195,7 @@ function loadVehiclesFromDatabase() {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[VRR.Vehicle]: ${tempVehicles.length} vehicles loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[AGRP.Vehicle]: ${tempVehicles.length} vehicles loaded from database successfully!`);
|
||||
return tempVehicles;
|
||||
}
|
||||
|
||||
@@ -206,14 +206,14 @@ function saveAllVehiclesToDatabase() {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, "[VRR.Vehicle]: Saving all server vehicles to database ...");
|
||||
logToConsole(LOG_DEBUG, "[AGRP.Vehicle]: Saving all server vehicles to database ...");
|
||||
let vehicles = getServerData().vehicles;
|
||||
for (let i in vehicles) {
|
||||
if (vehicles[i].needsSaved) {
|
||||
saveVehicleToDatabase(i);
|
||||
}
|
||||
}
|
||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Saved all server vehicles to database!");
|
||||
logToConsole(LOG_INFO, "[AGRP.Vehicle]: Saved all server vehicles to database!");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ function saveVehicleToDatabase(vehicleDataId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Saving vehicle ${tempVehicleData.databaseId} to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Saving vehicle ${tempVehicleData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
if (tempVehicleData.vehicle != false) {
|
||||
@@ -315,7 +315,7 @@ function saveVehicleToDatabase(vehicleDataId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Saved vehicle ${vehicleDataId} to database!`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Saved vehicle ${vehicleDataId} to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1466,7 +1466,7 @@ function respawnVehicle(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function spawnVehicle(vehicleData) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Vehicle]: Spawning ${getVehicleNameFromModel(vehicleData.model)} at ${vehicleData.spawnPosition.x}, ${vehicleData.spawnPosition.y}, ${vehicleData.spawnPosition.z} with heading ${vehicleData.spawnRotation}`);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Vehicle]: Spawning ${getVehicleNameFromModel(vehicleData.model)} at ${vehicleData.spawnPosition.x}, ${vehicleData.spawnPosition.y}, ${vehicleData.spawnPosition.z} with heading ${vehicleData.spawnRotation}`);
|
||||
let vehicle = createGameVehicle(vehicleData.model, vehicleData.spawnPosition, vehicleData.spawnRotation);
|
||||
|
||||
if (!vehicle) {
|
||||
@@ -1483,25 +1483,25 @@ function spawnVehicle(vehicleData) {
|
||||
vehicle.setRGBColours(vehicleData.colour1RGBA, vehicleData.colour2RGBA);
|
||||
let colour1 = rgbaArrayFromToColour(vehicleData.colour1RGBA);
|
||||
let colour2 = rgbaArrayFromToColour(vehicleData.colour2RGBA);
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Setting vehicle ${vehicle.id}'s colours to RGBA [${colour1[0]}, ${colour1[1]}, ${colour1[2]}, ${colour1[3]}], [(]${colour2[0]}, ${colour2[1]}, ${colour2[2]}, ${colour2[3]}]`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s colours to RGBA [${colour1[0]}, ${colour1[1]}, ${colour1[2]}, ${colour1[3]}], [(]${colour2[0]}, ${colour2[1]}, ${colour2[2]}, ${colour2[3]}]`);
|
||||
vehicle.setRGBColours(vehicleData.colour1RGBA, vehicleData.colour2RGBA);
|
||||
} else {
|
||||
setVehicleColours(vehicle, vehicleData.colour1, vehicleData.colour2, vehicleData.colour3, vehicleData.colour4);
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Setting vehicle ${vehicle.id}'s colours to ${vehicleData.colour1}, ${vehicleData.colour2}, ${vehicleData.colour3}, ${vehicleData.colour4}`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s colours to ${vehicleData.colour1}, ${vehicleData.colour2}, ${vehicleData.colour3}, ${vehicleData.colour4}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicleData.spawnLocked == true) {
|
||||
setVehicleEngine(vehicle, false);
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Setting vehicle ${vehicle.id}'s engine to OFF`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s engine to OFF`);
|
||||
} else {
|
||||
setVehicleEngine(vehicle, intToBool(vehicleData.engine));
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Setting vehicle ${vehicle.id}'s engine to ${toUpperCase(getOnOffFromBool(getVehicleEngine(vehicle)))}`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s engine to ${toUpperCase(getOnOffFromBool(getVehicleEngine(vehicle)))}`);
|
||||
}
|
||||
|
||||
if (typeof vehicle.locked != "undefined") {
|
||||
setVehicleLocked(vehicle, intToBool(vehicleData.locked));
|
||||
logToConsole(LOG_VERBOSE, `[VRR.Vehicle]: Setting vehicle ${vehicle.id}'s lock state to ${toUpperCase(getOnOffFromBool(getVehicleLocked(vehicle)))}`);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s lock state to ${toUpperCase(getOnOffFromBool(getVehicleLocked(vehicle)))}`);
|
||||
}
|
||||
|
||||
//setVehicleHealth(vehicle, 1000);
|
||||
|
||||
Reference in New Issue
Block a user