Radio data
This commit is contained in:
@@ -57,7 +57,7 @@ class JobData {
|
|||||||
this.colour = toColour(0, 0, 0, 255);
|
this.colour = toColour(0, 0, 0, 255);
|
||||||
this.whiteListEnabled = false;
|
this.whiteListEnabled = false;
|
||||||
this.blackListEnabled = false;
|
this.blackListEnabled = false;
|
||||||
this.walkieTalkieFrequency = 0;
|
this.radioFrequency = 0;
|
||||||
this.index = -1;
|
this.index = -1;
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
this.whoAdded = 0;
|
this.whoAdded = 0;
|
||||||
@@ -95,7 +95,7 @@ class JobData {
|
|||||||
this.colour = toColour(dbAssoc["job_colour_r"], dbAssoc["job_colour_g"], dbAssoc["job_colour_b"], 255);
|
this.colour = toColour(dbAssoc["job_colour_r"], dbAssoc["job_colour_g"], dbAssoc["job_colour_b"], 255);
|
||||||
this.whiteListEnabled = dbAssoc["job_wl"];
|
this.whiteListEnabled = dbAssoc["job_wl"];
|
||||||
this.blackListEnabled = dbAssoc["job_bl"];
|
this.blackListEnabled = dbAssoc["job_bl"];
|
||||||
this.walkieTalkieFrequency = dbAssoc["job_walkietalkiefreq"];
|
this.radioFrequency = dbAssoc["job_radio_freq"];
|
||||||
this.whoAdded = dbAssoc["job_who_added"];
|
this.whoAdded = dbAssoc["job_who_added"];
|
||||||
this.whenAdded = dbAssoc["job_when_added"];
|
this.whenAdded = dbAssoc["job_when_added"];
|
||||||
|
|
||||||
@@ -1148,7 +1148,7 @@ function givePlayerJobEquipment(client, equipmentId) {
|
|||||||
for (let i in getJobData(jobId).equipment[equipmentId].items) {
|
for (let i in getJobData(jobId).equipment[equipmentId].items) {
|
||||||
let value = getJobData(jobId).equipment[equipmentId].items[i].value
|
let value = getJobData(jobId).equipment[equipmentId].items[i].value
|
||||||
if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == V_ITEM_USE_TYPE_WALKIETALKIE) {
|
if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == V_ITEM_USE_TYPE_WALKIETALKIE) {
|
||||||
value = getJobData(jobId).walkieTalkieFrequency;
|
value = getJobData(jobId).radioFrequency;
|
||||||
}
|
}
|
||||||
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
||||||
getItemData(itemId).needsSaved = false;
|
getItemData(itemId).needsSaved = false;
|
||||||
@@ -2813,7 +2813,7 @@ function saveJobToDatabase(jobData) {
|
|||||||
["job_colour_r", colour[0]],
|
["job_colour_r", colour[0]],
|
||||||
["job_colour_g", colour[1]],
|
["job_colour_g", colour[1]],
|
||||||
["job_colour_b", colour[2]],
|
["job_colour_b", colour[2]],
|
||||||
["job_walkietalkiefreq", jobData.walkieTalkieFrequency],
|
["job_radio_freq", jobData.radioFrequency],
|
||||||
["job_wl", jobData.whiteListEnabled],
|
["job_wl", jobData.whiteListEnabled],
|
||||||
["job_bl", jobData.blackListEnabled],
|
["job_bl", jobData.blackListEnabled],
|
||||||
["job_who_added", jobData.whoAdded],
|
["job_who_added", jobData.whoAdded],
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ function setAllServerDataIndexes() {
|
|||||||
setAllRaceDataIndexes();
|
setAllRaceDataIndexes();
|
||||||
setAllRadioStationIndexes();
|
setAllRadioStationIndexes();
|
||||||
setAllPayPhoneIndexes();
|
setAllPayPhoneIndexes();
|
||||||
|
setAllVehicleRadioTransmitFrequencies();
|
||||||
cacheAllGroundItems();
|
cacheAllGroundItems();
|
||||||
cacheAllBusinessItems();
|
cacheAllBusinessItems();
|
||||||
cacheAllItemItems();
|
cacheAllItemItems();
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ class VehicleData {
|
|||||||
this.whoAdded = 0;
|
this.whoAdded = 0;
|
||||||
this.whenAdded = 0;
|
this.whenAdded = 0;
|
||||||
this.licensePlate = "";
|
this.licensePlate = "";
|
||||||
|
this.radioFrequency = -1;
|
||||||
|
|
||||||
this.lastActiveTime = false;
|
this.lastActiveTime = false;
|
||||||
|
|
||||||
@@ -160,6 +161,9 @@ class VehicleData {
|
|||||||
this.whenAdded = toInteger(dbAssoc["veh_when_added"]);
|
this.whenAdded = toInteger(dbAssoc["veh_when_added"]);
|
||||||
this.licensePlate = toInteger(dbAssoc["veh_license_plate"]);
|
this.licensePlate = toInteger(dbAssoc["veh_license_plate"]);
|
||||||
this.rank = toInteger(dbAssoc["veh_rank"]);
|
this.rank = toInteger(dbAssoc["veh_rank"]);
|
||||||
|
this.radioFrequency = toInteger(dbAssoc["veh_radio_freq"]);
|
||||||
|
this.whoAdded = toInteger(dbAssoc["veh_who_added"]);
|
||||||
|
this.whenAdded = toInteger(dbAssoc["veh_when_added"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -2009,3 +2013,15 @@ function doesVehicleHaveTransmitRadio(vehicle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setAllVehicleRadioTransmitFrequencies() {
|
||||||
|
for (let i in getServerData().vehicles) {
|
||||||
|
if (getServerData().vehicles[i].ownerType == V_VEHOWNER_JOB) {
|
||||||
|
if (getJobData(getJobIdFromDatabaseId(getServerData().vehicles[i].ownerId)) != false) {
|
||||||
|
getServerData().vehicles[i].radioFrequency = getJobData(getJobIdFromDatabaseId(getServerData().vehicles[i].ownerId)).radioFrequency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user