Use renamed game feature names
This commit is contained in:
@@ -1948,7 +1948,7 @@ function createAllBusinessPickups() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1974,7 +1974,7 @@ function createAllBusinessBlips() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2002,7 +2002,7 @@ function createBusinessEntrancePickup(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2074,7 +2074,7 @@ function createBusinessEntranceBlip(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2136,7 +2136,7 @@ function createBusinessExitPickup(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2197,7 +2197,7 @@ function createBusinessExitBlip(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2402,7 +2402,7 @@ function deleteBusinessEntrancePickup(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2429,7 +2429,7 @@ function deleteBusinessExitPickup(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2452,7 +2452,7 @@ function deleteBusinessEntranceBlip(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -846,11 +846,12 @@ function getPlayerHouse(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function saveAllHousesToDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.House]: Saving all server houses to database ...`);
|
||||
if (getServerConfig().devServer) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.House]: Aborting save all houses to database, dev server is enabled.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[VRR.House]: Saving all server houses to database ...`);
|
||||
for (let i in getServerData().houses) {
|
||||
if (getServerData().houses[i].needsSaved) {
|
||||
saveHouseToDatabase(i);
|
||||
@@ -1007,7 +1008,7 @@ function createHouseEntrancePickup(houseId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1064,7 +1065,7 @@ function createHouseEntranceBlip(houseId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1121,7 +1122,7 @@ function createHouseExitPickup(houseId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1169,7 +1170,7 @@ function createHouseExitBlip(houseId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ function getServerName() {
|
||||
// ===========================================================================
|
||||
|
||||
function createGamePickup(modelIndex, position, type) {
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
return game.createPickup(modelIndex, position, type);
|
||||
@@ -483,7 +483,7 @@ function createGamePickup(modelIndex, position, type) {
|
||||
// ===========================================================================
|
||||
|
||||
function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255, 255, 255)) {
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
return game.createBlip(type, position, size, colour);
|
||||
@@ -492,7 +492,7 @@ function createGameBlip(position, type = 0, size = 1, colour = toColour(255, 255
|
||||
// ===========================================================================
|
||||
|
||||
function createGameSphere(position, size = 1, colour = toColour(255, 255, 255, 255)) {
|
||||
if (!isGameFeatureSupported("spheres")) {
|
||||
if (!isGameFeatureSupported("sphere")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ function createGameSphere(position, size = 1, colour = toColour(255, 255, 255, 2
|
||||
// ===========================================================================
|
||||
|
||||
function createGameObject(modelIndex, position) {
|
||||
if (!isGameFeatureSupported("objects")) {
|
||||
if (!isGameFeatureSupported("object")) {
|
||||
return false;
|
||||
}
|
||||
return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position);
|
||||
@@ -1400,7 +1400,7 @@ function setElementShownByDefault(element, state) {
|
||||
// ===========================================================================
|
||||
|
||||
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
|
||||
if (isGameFeatureSupported("attachedBlips")) {
|
||||
if (isGameFeatureSupported("attachedBlip")) {
|
||||
return game.createBlipAttachedTo(element, type, size, colour, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ function getServerName() {
|
||||
// ===========================================================================
|
||||
|
||||
function createGamePickup(modelIndex, position, type) {
|
||||
if (!isGameFeatureSupported("pickups")) {
|
||||
if (!isGameFeatureSupported("pickup")) {
|
||||
return false;
|
||||
}
|
||||
return game.createPickup(modelIndex, position, type);
|
||||
@@ -479,7 +479,7 @@ function createGamePickup(modelIndex, position, type) {
|
||||
// ===========================================================================
|
||||
|
||||
function createGameBlip(position, type = 0, colour = toColour(255, 255, 255, 255)) {
|
||||
if (!isGameFeatureSupported("blips")) {
|
||||
if (!isGameFeatureSupported("blip")) {
|
||||
return false;
|
||||
}
|
||||
return game.createBlip(type, position, 1, colour);
|
||||
@@ -488,7 +488,7 @@ function createGameBlip(position, type = 0, colour = toColour(255, 255, 255, 255
|
||||
// ===========================================================================
|
||||
|
||||
function createGameObject(modelIndex, position) {
|
||||
if (!isGameFeatureSupported("objects")) {
|
||||
if (!isGameFeatureSupported("object")) {
|
||||
return false;
|
||||
}
|
||||
return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position);
|
||||
@@ -1251,7 +1251,7 @@ function setElementShownByDefault(element, state) {
|
||||
// ===========================================================================
|
||||
|
||||
function createAttachedGameBlip(element, type, size, colour = toColour(255, 255, 255, 255)) {
|
||||
if (isGameFeatureSupported("attachedBlips")) {
|
||||
if (isGameFeatureSupported("attachedBlip")) {
|
||||
return game.createBlipAttachedTo(element, type, size, colour, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ function saveAllVehiclesToDatabase() {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, "[VRR.Vehicle]: Saving all server vehicles to database ...");
|
||||
logToConsole(LOG_DEBUG, "[VRR.Vehicle]: Saving all server vehicles to database ...");
|
||||
let vehicles = getServerData().vehicles;
|
||||
for (let i in vehicles) {
|
||||
if (vehicles[i].needsSaved) {
|
||||
@@ -1480,7 +1480,7 @@ function spawnVehicle(vehicleData) {
|
||||
|
||||
vehicleData.vehicle = vehicle;
|
||||
|
||||
if (isGameFeatureSupported("vehicleColours")) {
|
||||
if (isGameFeatureSupported("vehicleColour")) {
|
||||
if (vehicleData.colour1IsRGBA && vehicleData.colour2IsRGBA) {
|
||||
vehicle.setRGBColours(vehicleData.colour1RGBA, vehicleData.colour2RGBA);
|
||||
let colour1 = rgbaArrayFromToColour(vehicleData.colour1RGBA);
|
||||
@@ -1614,7 +1614,7 @@ function createTemporaryVehicle(modelIndex, position, heading, interior = 0, dim
|
||||
tempVehicleData.databaseId = -1;
|
||||
tempVehicleData.interior = interior;
|
||||
tempVehicleData.dimension = dimension;
|
||||
if (!isGameFeatureSupported("vehicleColours")) {
|
||||
if (!isGameFeatureSupported("vehicleColour")) {
|
||||
tempVehicleData.colour1 = 0;
|
||||
tempVehicleData.colour2 = 0;
|
||||
tempVehicleData.colour3 = 0;
|
||||
@@ -1640,7 +1640,7 @@ function createPermanentVehicle(modelIndex, position, heading, interior = 0, dim
|
||||
tempVehicleData.model = modelIndex;
|
||||
tempVehicleData.interior = interior;
|
||||
tempVehicleData.dimension = dimension;
|
||||
if (!isGameFeatureSupported("vehicleColours")) {
|
||||
if (!isGameFeatureSupported("vehicleColour")) {
|
||||
tempVehicleData.colour1 = 0;
|
||||
tempVehicleData.colour2 = 0;
|
||||
tempVehicleData.colour3 = 0;
|
||||
|
||||
@@ -1708,19 +1708,19 @@ function isWeatherSupported() {
|
||||
// ===========================================================================
|
||||
|
||||
function arePickupsSupported() {
|
||||
return isGameFeatureSupported("pickups");
|
||||
return isGameFeatureSupported("pickup");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function areBlipsSupported() {
|
||||
return isGameFeatureSupported("blips");
|
||||
return isGameFeatureSupported("blip");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function areMarkersSupported() {
|
||||
return isGameFeatureSupported("markers");
|
||||
return isGameFeatureSupported("marker");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -1738,22 +1738,25 @@ function isCustomCameraSupported() {
|
||||
// ===========================================================================
|
||||
|
||||
function areFightStylesSupported() {
|
||||
return isGameFeatureSupported("fightStyles");
|
||||
return isGameFeatureSupported("fightStyle");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function areWorldLabelsSupported() {
|
||||
return isGameFeatureSupported("worldLabels");
|
||||
return isGameFeatureSupported("worldLabel");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function isGameFeatureSupported(featureName) {
|
||||
if (typeof supportedFeatures[featureName] === "undefined") {
|
||||
logToConsole(LOG_WARN, `[AGRP.Utilities] Game feature support error. Unknown feature name: ${featureName}`);
|
||||
if (isServerScript()) {
|
||||
submitBugReport(null, `[AUTOMATED REPORT] Game feature support error. Unknown feature name: ${featureName}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return supportedFeatures[featureName][getGame()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user