diff --git a/scripts/server/job.js b/scripts/server/job.js index 29eb75a8..7009af63 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -57,7 +57,7 @@ class JobData { this.colour = toColour(0, 0, 0, 255); this.whiteListEnabled = false; this.blackListEnabled = false; - this.walkieTalkieFrequency = 0; + this.radioFrequency = 0; this.index = -1; this.needsSaved = false; 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.whiteListEnabled = dbAssoc["job_wl"]; this.blackListEnabled = dbAssoc["job_bl"]; - this.walkieTalkieFrequency = dbAssoc["job_walkietalkiefreq"]; + this.radioFrequency = dbAssoc["job_radio_freq"]; this.whoAdded = dbAssoc["job_who_added"]; this.whenAdded = dbAssoc["job_when_added"]; @@ -1148,7 +1148,7 @@ function givePlayerJobEquipment(client, equipmentId) { for (let i in getJobData(jobId).equipment[equipmentId].items) { 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) { - 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); getItemData(itemId).needsSaved = false; @@ -2813,7 +2813,7 @@ function saveJobToDatabase(jobData) { ["job_colour_r", colour[0]], ["job_colour_g", colour[1]], ["job_colour_b", colour[2]], - ["job_walkietalkiefreq", jobData.walkieTalkieFrequency], + ["job_radio_freq", jobData.radioFrequency], ["job_wl", jobData.whiteListEnabled], ["job_bl", jobData.blackListEnabled], ["job_who_added", jobData.whoAdded], diff --git a/scripts/server/startup.js b/scripts/server/startup.js index 214353d6..8ac96fa9 100644 --- a/scripts/server/startup.js +++ b/scripts/server/startup.js @@ -172,6 +172,7 @@ function setAllServerDataIndexes() { setAllRaceDataIndexes(); setAllRadioStationIndexes(); setAllPayPhoneIndexes(); + setAllVehicleRadioTransmitFrequencies(); cacheAllGroundItems(); cacheAllBusinessItems(); cacheAllItemItems(); diff --git a/scripts/server/vehicle.js b/scripts/server/vehicle.js index 4cea534f..a432b02b 100644 --- a/scripts/server/vehicle.js +++ b/scripts/server/vehicle.js @@ -87,6 +87,7 @@ class VehicleData { this.whoAdded = 0; this.whenAdded = 0; this.licensePlate = ""; + this.radioFrequency = -1; this.lastActiveTime = false; @@ -160,6 +161,9 @@ class VehicleData { this.whenAdded = toInteger(dbAssoc["veh_when_added"]); this.licensePlate = toInteger(dbAssoc["veh_license_plate"]); 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"]); } } }; @@ -2008,4 +2012,16 @@ function doesVehicleHaveTransmitRadio(vehicle) { return false; } +// =========================================================================== + +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; + } + } + } +} + // =========================================================================== \ No newline at end of file