diff --git a/ESX/trew_hud_ui/LICENSE b/ESX/esx_trew_hud/LICENSE similarity index 100% rename from ESX/trew_hud_ui/LICENSE rename to ESX/esx_trew_hud/LICENSE diff --git a/ESX/esx_trew_hud/README.md b/ESX/esx_trew_hud/README.md new file mode 100644 index 0000000..967ec79 --- /dev/null +++ b/ESX/esx_trew_hud/README.md @@ -0,0 +1,56 @@ +

[ESX/QB] Trew Hud

2023 Remaster By Mycroft

+ +One of the most, if not **the most**, popular hud for FiveM brought back with a new life - running with 0.03-0.05ms resmon and 2023 Resource support! + +## Major Changes + +```diff ++ PMA Voice Support ++ ESX Legacy Support ++ Rewrote major sections ++ Completely Optimised ++ Better Font ++ Completely Client-Sided ++ Added Player Id to HUD ++ Added QBCore Support (Including Stress and Crypto!) +- Removed Unused Code +- Removed Unused Files +- Removed vRP support +``` + +# Preview + +[![Preview](https://i.imgur.com/kerhT5C.png)](https://streamable.com/rhrrn6) + +## Installation + +1. Extract/Open the .zip. +2. Place `trew_hud-remastered` in your resources directory. +3. Add `ensure trew_hud-remastered` to your server.cfg + +### ESX + +#### Requirements + +- [ESX Legacy](https://github.com/esx-framework/esx_core) +- [ESX Society](https://github.com/esx-framework/esx_society) +- [ESX Addon Account](https://github.com/esx-framework/esx_addonaccount) + +#### Optional + +- [esx_basicneeds](https://github.com/esx-framework/esx_basicneeds) +- [esx_status](https://github.com/esx-framework/esx_status) + +### QBCore + +#### Requirements + +- [QBCore](https://github.com/qbcore-framework/qb-core) +- [qb-management](https://github.com/qbcore-framework/qb-management) + +## Commands + +**/toggleui** +Enables/Disables HUD information elements, like _and job all types money_. Useful for streamers. + +_**Usage example:**_ /toggleui diff --git a/ESX/esx_trew_hud/client/client.lua b/ESX/esx_trew_hud/client/client.lua new file mode 100644 index 0000000..fde0230 --- /dev/null +++ b/ESX/esx_trew_hud/client/client.lua @@ -0,0 +1,651 @@ +local zones = json.decode('{"HAWICK":"Hawick","ELYSIAN":"Elysian Island","SANDY":"Sandy Shores","DESRT":"Grand Senora Desert","LEGSQU":"Legion Square","MTCHIL":"Mount Chiliad","PALMPOW":"Palmer-Taylor Power Station","CCREAK":"Cassidy Creek","PROL":"North Yankton","PBLUFF":"Pacific Bluffs","MIRR":"Mirror Park","RICHM":"Richman","ZQ_UAR":"Davis Quartz","EAST_V":"East Vinewood","LAGO":"Lago Zancudo","BRADT":"Braddock Tunnel","NCHU":"North Chumash","CYPRE":"Cypress Flats","GALFISH":"Galilee","ZP_ORT":"Port of South Los Santos","PALETO":"Paleto Bay","BURTON":"Burton","GRAPES":"Grapeseed","DELSOL":"La Puerta","ALAMO":"Alamo Sea","DELPE":"Del Perro","ARMYB":"Fort Zancudo","STAD":"Maze Bank Arena","MORN":"Morningwood","CANNY":"Raton Canyon","ISHeist":"Cayo Perico Island","TEXTI":"Textile City","ALTA":"Alta","DTVINE":"Downtown Vinewood","HARMO":"Harmony","MURRI":"Murrieta Heights","KOREAT":"Little Seoul","GALLI":"Galileo Park","DOWNT":"Downtown","ZANCUDO":"Zancudo River","WVINE":"West Vinewood","BAYTRE":"Baytree Canyon","WINDF":"Ron Alternates Wind Farm","VINE":"Vinewood","EBURO":"El Burro Heights","DAVIS":"Davis","STRAW":"Strawberry","TONGVAV":"Tongva Valley","PALHIGH":"Palomino Highlands","TONGVAH":"Tongva Hills","CALAFB":"Calafia Bridge","CHAMH":"Chamberlain Hills","PBOX":"Pillbox Hill","MTJOSE":"Mount Josiah","TERMINA":"Terminal","HUMLAB":"Humane Labs and Research","PALFOR":"Paleto Forest","PALCOV":"Paleto Cove","TATAMO":"Tataviam Mountains","LDAM":"Land Act Dam","MOVIE":"Richards Majestic","VCANA":"Vespucci Canals","HORS":"Vinewood Racetrack","SKID":"Mission Row","CHU":"Chumash","SANCHIA":"San Chianski Mountain Range","CHIL":"Vinewood Hills","ROCKF":"Rockford Hills","RTRAK":"Redwood Lights Track","RGLEN":"Richman Glen","CMSW":"Chiliad Mountain State Wilderness","PROCOB":"Procopio Beach","RANCHO":"Rancho","GREATC":"Great Chaparral","BRADP":"Braddock Pass","ELGORL":"El Gordo Lighthouse","VESP":"Vespucci","OCEANA":"Pacific Ocean","JAIL":"Bolingbroke Penitentiary","OBSERV":"Galileo Observatory","BEACH":"Vespucci Beach","BHAMCA":"Banham Canyon","GOLF":"GWC and Golfing Society","SLAB":"Stab City","LACT":"Land Act Reservoir","LMESA":"La Mesa","DELBE":"Del Perro Beach","BANNING":"Banning","MTGORDO":"Mount Gordo","LOSPUER":"La Puerta","NOOSE":"N.O.O.S.E","AIRP":"Los Santos International Airport"}') + +local AllWeapons = json.decode('{"melee":{"dagger":"0x92A27487","bat":"0x958A4A8F","bottle":"0xF9E6AA4B","crowbar":"0x84BD7BFD","unarmed":"0xA2719263","flashlight":"0x8BB05FD7","golfclub":"0x440E4788","hammer":"0x4E875F73","hatchet":"0xF9DCBF2D","knuckle":"0xD8DF3C3C","knife":"0x99B507EA","machete":"0xDD5DF8D9","switchblade":"0xDFE37640","nightstick":"0x678B81B1","wrench":"0x19044EE0","battleaxe":"0xCD274149","poolcue":"0x94117305","stone_hatchet":"0x3813FC08"},"handguns":{"pistol":"0x1B06D571","pistol_mk2":"0xBFE256D4","combatpistol":"0x5EF9FEC4","appistol":"0x22D8FE39","stungun":"0x3656C8C1","pistol50":"0x99AEEB3B","snspistol":"0xBFD21232","snspistol_mk2":"0x88374054","heavypistol":"0xD205520E","vintagepistol":"0x83839C4","flaregun":"0x47757124","marksmanpistol":"0xDC4DB296","revolver":"0xC1B3C3D1","revolver_mk2":"0xCB96392F","doubleaction":"0x97EA20B8","raypistol":"0xAF3696A1"},"smg":{"microsmg":"0x13532244","smg":"0x2BE6766B","smg_mk2":"0x78A97CD0","assaultsmg":"0xEFE7E2DF","combatpdw":"0xA3D4D34","machinepistol":"0xDB1AA450","minismg":"0xBD248B55","raycarbine":"0x476BF155"},"shotguns":{"pumpshotgun":"0x1D073A89","pumpshotgun_mk2":"0x555AF99A","sawnoffshotgun":"0x7846A318","assaultshotgun":"0xE284C527","bullpupshotgun":"0x9D61E50F","musket":"0xA89CB99E","heavyshotgun":"0x3AABBBAA","dbshotgun":"0xEF951FBB","autoshotgun":"0x12E82D3D"},"assault_rifles":{"assaultrifle":"0xBFEFFF6D","assaultrifle_mk2":"0x394F415C","carbinerifle":"0x83BF0278","carbinerifle_mk2":"0xFAD1F1C9","advancedrifle":"0xAF113F99","specialcarbine":"0xC0A3098D","specialcarbine_mk2":"0x969C3D67","bullpuprifle":"0x7F229F94","bullpuprifle_mk2":"0x84D6FAFD","compactrifle":"0x624FE830"},"machine_guns":{"mg":"0x9D07F764","combatmg":"0x7FD62962","combatmg_mk2":"0xDBBD7280","gusenberg":"0x61012683"},"sniper_rifles":{"sniperrifle":"0x5FC3C11","heavysniper":"0xC472FE2","heavysniper_mk2":"0xA914799","marksmanrifle":"0xC734385A","marksmanrifle_mk2":"0x6A6C02E0"},"heavy_weapons":{"rpg":"0xB1CA77B1","grenadelauncher":"0xA284510B","grenadelauncher_smoke":"0x4DD2DC56","minigun":"0x42BF8A85","firework":"0x7F7497E5","railgun":"0x6D544C99","hominglauncher":"0x63AB0442","compactlauncher":"0x781FE4A","rayminigun":"0xB62D1F67"},"throwables":{"grenade":"0x93E220BD","bzgas":"0xA0973D5E","smokegrenade":"0xFDBC8A50","flare":"0x497FACC3","molotov":"0x24B17070","stickybomb":"0x2C3731D9","proxmine":"0xAB564B93","snowball":"0x787F0BB","pipebomb":"0xBA45E8B8","ball":"0x23C9F95C"},"misc":{"petrolcan":"0x34A67B97","fireextinguisher":"0x60EC506","parachute":"0xFBAB5776"}}') +local vehiclesCars = {0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20}; +local isTalking = false +local Playerid = PlayerId() +local ServerId = 0 +function Startup() + ServerId = GetPlayerServerId(Playerid) + SendNUIMessage({ action = 'ui', config = Config.ui }) + SendNUIMessage({ action = 'setFont', url = Config.font.url, name = Config.font.name }) + SendNUIMessage({ action = 'setLogo', value = Config.serverLogo }) + SendNUIMessage({ action = 'setVoiceDistance', value = LocalPlayer.state.proximity and LocalPlayer.state.proximity.mode or "Normal" }) + SendNUIMessage({ action = 'setMoney', id = 'plyId', value = tostring(ServerId) }) +end + +AddEventHandler('esx:onPlayerSpawn', function() + Startup() +end) + +-- Vehicle Info +local vehicleCruiser +local vehicleSignalIndicator = 'off' +local seatbeltEjectSpeed = 45.0 +local seatbeltEjectAccel = 100.0 +local seatbeltIsOn = false +local currSpeed = 0.0 +local prevVelocity = {x = 0.0, y = 0.0, z = 0.0} + +CreateThread(function() + Startup() + while true do + Wait(200) + local player = ESX.PlayerData.ped + local vehicle = GetVehiclePedIsIn(player, false) + local position = GetEntityCoords(player) + local vehicleIsOn = GetIsVehicleEngineRunning(vehicle) + local vehicleInfo + + if IsPauseMenuActive() then -- ESC Key + if not isPauseMenu then + isPauseMenu = not isPauseMenu + SendNUIMessage({ action = 'toggleUi', value = false }) + end + else + if isPauseMenu then + isPauseMenu = not isPauseMenu + SendNUIMessage({ action = 'toggleUi', value = true }) + end + end + if IsPedInAnyVehicle(player, false) and vehicleIsOn then + local vehicleClass = GetVehicleClass(vehicle) + + if not Config.ui.showMinimapOnFoot and Config.ui.showMinimapInVehicle then + DisplayRadar(true) + end + + -- Vehicle Speed + local vehicleSpeedSource = GetEntitySpeed(vehicle) + local vehicleSpeed + if Config.vehicle.speedUnit == 'MPH' then + vehicleSpeed = math.ceil(vehicleSpeedSource * 2.237) + else + vehicleSpeed = math.ceil(vehicleSpeedSource * 3.6) + end + + -- Vehicle Gradient Speed + local vehicleNailSpeed + + if vehicleSpeed > Config.vehicle.maxSpeed then + vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(Config.vehicle.maxSpeed * 205) / Config.vehicle.maxSpeed) ) + else + vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(vehicleSpeed * 205) / Config.vehicle.maxSpeed) ) + end + + -- Vehicle Fuel and Gear + local vehicleFuel + vehicleFuel = GetVehicleFuelLevel(vehicle) + + local vehicleGear = GetVehicleCurrentGear(vehicle) + + if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then + vehicleGear = 'N' + elseif vehicleSpeed > 0 and vehicleGear == 0 then + vehicleGear = 'R' + end + + -- Vehicle Lights + local vehicleVal,vehicleLights,vehicleHighlights = GetVehicleLightsState(vehicle) + local vehicleIsLightsOn + if vehicleLights == 1 and vehicleHighlights == 0 then + vehicleIsLightsOn = 'normal' + elseif (vehicleLights == 1 and vehicleHighlights == 1) or (vehicleLights == 0 and vehicleHighlights == 1) then + vehicleIsLightsOn = 'high' + else + vehicleIsLightsOn = 'off' + end + + -- Vehicle Siren + local vehicleSiren + + if IsVehicleSirenOn(vehicle) then + vehicleSiren = true + else + vehicleSiren = false + end + + -- Vehicle Seatbelt + if has_value(vehiclesCars, vehicleClass) and vehicleClass ~= 8 then + + local prevSpeed = currSpeed + currSpeed = vehicleSpeedSource + + SetPedConfigFlag(ESX.PlayerData.ped, 32, true) + + if not seatbeltIsOn then + local vehIsMovingFwd = GetEntitySpeedVector(vehicle, true).y > 1.0 + local vehAcc = (prevSpeed - currSpeed) / GetFrameTime() + if (vehIsMovingFwd and (prevSpeed > (seatbeltEjectSpeed/2.237)) and (vehAcc > (seatbeltEjectAccel*9.81))) then + + SetEntityCoords(player, position.x, position.y, position.z - 0.47, true, true, true) + SetEntityVelocity(player, prevVelocity.x, prevVelocity.y, prevVelocity.z) + SetPedToRagdoll(player, 1000, 1000, 0, 0, 0, 0) + else + -- Update previous velocity for ejecting player + prevVelocity = GetEntityVelocity(vehicle) + end + + else + + DisableControlAction(0, 75) + + end + end + + vehicleInfo = { + action = 'updateVehicle', + status = true, + speed = vehicleSpeed, + nail = vehicleNailSpeed, + gear = vehicleGear, + fuel = vehicleFuel, + lights = vehicleIsLightsOn, + signals = vehicleSignalIndicator, + cruiser = vehicleCruiser, + type = vehicleClass, + siren = vehicleSiren, + seatbelt = {}, + + config = { + speedUnit = Config.vehicle.speedUnit, + maxSpeed = Config.vehicle.maxSpeed + } + } + + vehicleInfo['seatbelt']['status'] = seatbeltIsOn + else + vehicleCruiser = false + vehicleNailSpeed = 0 + vehicleSignalIndicator = 'off' + + seatbeltIsOn = false + + vehicleInfo = { + action = 'updateVehicle', + + status = false, + nail = vehicleNailSpeed, + seatbelt = { status = seatbeltIsOn }, + cruiser = vehicleCruiser, + signals = vehicleSignalIndicator, + type = 0, + } + + if not Config.ui.showMinimapOnFoot then + DisplayRadar(false) + end + + end + + SendNUIMessage(vehicleInfo) + + if Config.ui.showLocation then + local player = ESX.PlayerData.ped + local position = GetEntityCoords(player) + local zoneNameFull = zones[GetNameOfZone(position.x, position.y, position.z)] + local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(position.x, position.y, position.z)) + + local locationMessage = nil + + if zoneNameFull then + locationMessage = streetName .. ', ' .. zoneNameFull + else + locationMessage = streetName + end + + locationMessage = string.format( + Locales[Config.Locale]['you_are_on_location'], + locationMessage + ) + + SendNUIMessage({ action = 'setText', id = 'location', value = locationMessage }) + end + + if Config.ui.showVoice then + if NetworkIsPlayerTalking(Playerid) and not isTalking then + isTalking = not isTalking + SendNUIMessage({ action = 'isTalking', value = isTalking }) + elseif not NetworkIsPlayerTalking(Playerid) and isTalking then + isTalking = not isTalking + SendNUIMessage({ action = 'isTalking', value = isTalking }) + end + end + end +end) + +CreateThread(function() + + while true do + Wait(2000) + + local playerStatus + local showPlayerStatus = 0 + playerStatus = { action = 'setStatus', status = {} } + + if Config.ui.showHealth then + showPlayerStatus = (showPlayerStatus+1) + + playerStatus.isdead = ESX.PlayerData.dead + + playerStatus['status'][showPlayerStatus] = { + name = 'health', + value = GetEntityHealth(ESX.PlayerData.ped) - 100 + } + + end + + if Config.ui.showDate then + SendNUIMessage({ action = 'setText', id = 'date', value = trewDate() }) + end + + if Config.ui.showArmor then + showPlayerStatus = (showPlayerStatus+1) + + playerStatus['status'][showPlayerStatus] = { + name = 'armor', + value = GetPedArmour(ESX.PlayerData.ped), + } + end + + if Config.ui.showStamina then + showPlayerStatus = (showPlayerStatus+1) + + playerStatus['status'][showPlayerStatus] = { + name = 'stamina', + value = 100 - GetPlayerSprintStaminaRemaining(Playerid), + } + end + + if showPlayerStatus > 0 then + SendNUIMessage(playerStatus) + end + + if ESX.PlayerData.job then + local job + local blackMoney + local bank + local money + + if ESX.PlayerData.job.label == ESX.PlayerData.job.grade_label then + job = ESX.PlayerData.job.grade_label + else + job = ESX.PlayerData.job.label .. ': ' .. ESX.PlayerData.job.grade_label + end + + for i=1, #ESX.PlayerData.accounts, 1 do + if ESX.PlayerData.accounts[i].name == 'black_money' then + blackMoney = ESX.PlayerData.accounts[i].money + elseif ESX.PlayerData.accounts[i].name == 'bank' then + bank = ESX.PlayerData.accounts[i].money + elseif ESX.PlayerData.accounts[i].name == 'money' then + money = ESX.PlayerData.accounts[i].money + end + end + + SendNUIMessage({ action = 'setText', id = 'job', value = job }) + SendNUIMessage({ action = 'setMoney', id = 'wallet', value = money }) + SendNUIMessage({ action = 'setMoney', id = 'bank', value = bank }) + SendNUIMessage({ action = 'setMoney', id = 'blackMoney', value = blackMoney }) + + if ESX.PlayerData.job.grade_name and ESX.PlayerData.job.grade_name == 'boss' then + if (Config.ui.showSocietyMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) + end + ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(money) + SendNUIMessage({ action = 'setMoney', id = 'society', value = money }) + end, ESX.PlayerData.job.name) + else + SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) + end + end + + local playerStatus + local showPlayerStatus = 0 + playerStatus = { action = 'setStatus', status = {} } + + if Config.ui.showHunger then + showPlayerStatus = (showPlayerStatus+1) + + TriggerEvent('esx_status:getStatus', 'hunger', function(status) + playerStatus['status'][showPlayerStatus] = { + name = 'hunger', + value = math.floor(100-status.getPercent()) + } + end) + + end + + if Config.ui.showThirst then + showPlayerStatus = (showPlayerStatus+1) + + TriggerEvent('esx_status:getStatus', 'thirst', function(status) + playerStatus['status'][showPlayerStatus] = { + name = 'thirst', + value = math.floor(100-status.getPercent()) + } + end) + end + + if showPlayerStatus > 0 then + SendNUIMessage(playerStatus) + end + + if Config.ui.showVoice then + AddEventHandler('pma-voice:setTalkingMode', function() + SendNUIMessage({ action = 'setVoiceDistance', value = LocalPlayer.state.proximity and LocalPlayer.state.proximity.mode or "Normal" }) + end) + end + end +end) + +-- Weapons +if Config.ui.showWeapons then + CreateThread(function() + while true do + local Sleep = 800 + + local player = ESX.PlayerData.ped + local status = {} + + if IsPedArmed(player, 7) then + Sleep = 100 + local weapon = GetSelectedPedWeapon(player) + local ammoTotal = GetAmmoInPedWeapon(player,weapon) + local bool,ammoClip = GetAmmoInClip(player,weapon) + local ammoRemaining = math.floor(ammoTotal - ammoClip) + + status['armed'] = true + + for key,value in pairs(AllWeapons) do + + for keyTwo,valueTwo in pairs(AllWeapons[key]) do + if weapon == joaat('weapon_'..keyTwo) then + status['weapon'] = keyTwo + + + if key == 'melee' then + SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) + else + if keyTwo == 'stungun' then + SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) + else + SendNUIMessage({ action = 'element', task = 'enable', value = 'weapon_bullets' }) + SendNUIMessage({ action = 'element', task = 'enable', value = 'bullets' }) + end + end + + end + end + + end + + SendNUIMessage({ action = 'setText', id = 'weapon_clip', value = ammoClip }) + SendNUIMessage({ action = 'setText', id = 'weapon_ammo', value = ammoRemaining }) + + else + if status['armed'] then + status['armed'] = false + SendNUIMessage({ action = 'updateWeapon', status = status }) + end + end + + SendNUIMessage({ action = 'updateWeapon', status = status }) + Wait(Sleep) + end + end) +end + +ESX.RegisterInput("cruise", "[HUD] Cruise Control", "keyboard", Config.vehicle.keys.cruiser, function() + local player = ESX.PlayerData.ped + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleSpeedSource = GetEntitySpeed(vehicle) + if GetPedInVehicleSeat(vehicle, -1) ~= player then + return + end + if vehicleCruiser == 'on' then + vehicleCruiser = 'off' + SetEntityMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle,"CHandlingData","fInitialDriveMaxFlatVel")) + + else + vehicleCruiser = 'on' + SetEntityMaxSpeed(vehicle, vehicleSpeedSource) + end +end) + +ESX.RegisterInput("seatbelt", "[HUD] Seatbelt", "keyboard", Config.vehicle.keys.seatbelt, function() + local player = ESX.PlayerData.ped + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if not (IsPedInAnyVehicle(player, false) and GetIsVehicleEngineRunning(vehicle)) then + return + end + if has_value(vehiclesCars, vehicleClass) ~= true and vehicleClass == 8 then + return + end + seatbeltIsOn = not seatbeltIsOn +end) + +ESX.RegisterInput("leftindicator", "[HUD] Left Indicator", "keyboard", Config.vehicle.keys.signalLeft, function() + local player = ESX.PlayerData.ped + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if has_value(vehiclesCars, vehicleClass) ~= true then + return + end + if vehicleSignalIndicator == 'off' then + vehicleSignalIndicator = 'left' + else + vehicleSignalIndicator = 'off' + end + + TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) +end) + +ESX.RegisterInput("rightindicator", "[HUD] Right Indicator", "keyboard", Config.vehicle.keys.signalRight, function() + local player = ESX.PlayerData.ped + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if has_value(vehiclesCars, vehicleClass) ~= true then + return + end + if vehicleSignalIndicator == 'off' then + vehicleSignalIndicator = 'right' + else + vehicleSignalIndicator = 'off' + end + + TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) +end) + +ESX.RegisterInput("bothindicator", "[HUD] Both Indicators", "keyboard", Config.vehicle.keys.signalBoth, function() + local player = ESX.PlayerData.ped + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if has_value(vehiclesCars, vehicleClass) ~= true then + return + end + if vehicleSignalIndicator == 'off' then + vehicleSignalIndicator = 'both' + else + vehicleSignalIndicator = 'off' + end + + TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) +end) + +AddEventHandler('trew_hud_ui:setCarSignalLights', function(status) + local driver = GetVehiclePedIsIn(ESX.PlayerData.ped, false) + local hasTrailer,vehicleTrailer = GetVehicleTrailerVehicle(driver) + local leftLight + local rightLight + + if status == 'left' then + leftLight = false + rightLight = true + if hasTrailer then driver = vehicleTrailer end + elseif status == 'right' then + leftLight = true + rightLight = false + if hasTrailer then driver = vehicleTrailer end + + elseif status == 'both' then + leftLight = true + rightLight = true + if hasTrailer then driver = vehicleTrailer end + + else + leftLight = false + rightLight = false + if hasTrailer then driver = vehicleTrailer end + + end + + SetVehicleIndicatorLights(driver, 0, leftLight) + SetVehicleIndicatorLights(driver, 1, rightLight) +end) + +function trewDate() + local timeString = nil + local weekDay = Translate('weekDay_' .. GetClockDayOfWeek()) + local month = Translate('month_' .. GetClockMonth()) + local day = Translate('day_' .. GetClockDayOfMonth()) + local year = GetClockYear() + local hour = GetClockHours() + local minutes = GetClockMinutes() + local time = nil + local AmPm = '' + + + if Config.date.AmPm then + if hour >= 13 and hour <= 24 then + hour = hour - 12 + AmPm = 'PM' + else + if hour == 0 or hour == 24 then + hour = 12 + end + AmPm = 'AM' + end + + end + + if hour <= 9 then + hour = '0' .. hour + end + if minutes <= 9 then + minutes = '0' .. minutes + end + + time = hour .. ':' .. minutes .. ' ' .. AmPm + + local date_format = Locales[Config.Locale]['date_format'][Config.date.format] + + if Config.date.format == 'default' then + timeString = string.format( + date_format, + day, month, year + ) + elseif Config.date.format == 'simple' then + timeString = string.format( + date_format, + day, month + ) + + elseif Config.date.format == 'simpleWithHours' then + timeString = string.format( + date_format, + time, day, month + ) + elseif Config.date.format == 'withWeekday' then + timeString = string.format( + date_format, + weekDay, day, month, year + ) + elseif Config.date.format == 'withHours' then + timeString = string.format( + date_format, + time, day, month, year + ) + elseif Config.date.format == 'withWeekdayAndHours' then + timeString = string.format( + date_format, + time, weekDay, day, month, year + ) + end + + return timeString +end + +function has_value(tab, val) + for index, value in ipairs(tab) do + if value == val then + return true + end + end + + return false +end + +local toggleui = false +RegisterCommand('toggleui', function() + if not toggleui then + SendNUIMessage({ action = 'element', task = 'disable', value = 'job' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'bank' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'blackMoney' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'wallet' }) + else + if (Config.ui.showJob) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'job' }) + end + if (Config.ui.showSocietyMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) + end + if (Config.ui.showBankMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'bank' }) + end + if (Config.ui.showBlackMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'blackMoney' }) + end + if (Config.ui.showWalletMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'wallet' }) + end + end + + toggleui = not toggleui +end) + +exports('createStatus', function(args) + local statusCreation = { action = 'createStatus', status = args['status'], color = args['color'], icon = args['icon'] } + SendNUIMessage(statusCreation) +end) + +exports('setStatus', function(args) + local playerStatus = { action = 'setStatus', status = { + { name = args['name'], value = args['value'] } + }} + SendNUIMessage(playerStatus) +end) + +if not Config.ui.showMinimapHealth then + Citizen.CreateThread(function() + local minimap = RequestScaleformMovie("minimap") + SetBigmapActive(true, false) + Wait(0) + SetBigmapActive(false, false) + while true do + local Sleep = 500 + if not IsRadarHidden() then + Sleep = 0 + BeginScaleformMovieMethod(minimap, "SETUP_HEALTH_ARMOUR") + ScaleformMovieMethodAddParamInt(3) + EndScaleformMovieMethod() + end + Wait(Sleep) + end + + end) +end diff --git a/ESX/esx_trew_hud/config.lua b/ESX/esx_trew_hud/config.lua new file mode 100644 index 0000000..24dc9c4 --- /dev/null +++ b/ESX/esx_trew_hud/config.lua @@ -0,0 +1,56 @@ +Config = {} + +Config.Locale = 'en' + +Config.serverLogo = 'https://i.imgur.com/9a3Tj94.png' + +Config.font = { + name = 'Signika Negative', + url = 'https://fonts.googleapis.com/css2?family=Signika+Negative&display=swap' +} + +Config.date = { + format = 'default', + AmPm = false +} + +Config.vehicle = { + speedUnit = 'MPH', + maxSpeed = 180, + + keys = { + seatbelt = 'K', + cruiser = 'CAPS', + signalLeft = 'LEFT', + signalRight = 'RIGHT', + signalBoth = 'DOWN', + } +} + +Config.ui = { + showServerLogo = false, + + showJob = true, + + showWalletMoney = true, + showBankMoney = true, + showBlackMoney = false, + showSocietyMoney = true, + + showDate = true, + showLocation = true, + showVoice = true, + + showHealth = true, + showArmor = true, + showStamina = true, + showHunger = true, + showThirst = true, + showID = true, + + showMinimapOnFoot = false, + showMinimapInVehicle = true, + showMinimapHealth = false, + + showWeapons = true, +} \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/fxmanifest.lua b/ESX/esx_trew_hud/fxmanifest.lua similarity index 93% rename from VRPEX/trew_hud_ui/fxmanifest.lua rename to ESX/esx_trew_hud/fxmanifest.lua index 18a1d07..c54a7ab 100644 --- a/VRPEX/trew_hud_ui/fxmanifest.lua +++ b/ESX/esx_trew_hud/fxmanifest.lua @@ -1,5 +1,11 @@ -fx_version 'cerulean' -games {'gta5'} +fx_version 'adamant' + +game 'gta5' + +description 'Trew HUD UI' + +version '2.0.0' +lua54 'yes' ui_page 'html/ui.html' @@ -114,18 +120,18 @@ files { 'html/sounds/car-indicators.ogg', } -client_scripts { - "@vrp/lib/utils.lua", - 'locales/languages.lua', +shared_scripts { + '@es_extended/imports.lua', + '@es_extended/locale.lua', + 'locales/*.lua', 'config.lua', +} + +client_scripts { 'client/client.lua', - 'client/hansolo.lua' } -server_scripts { - "@vrp/lib/utils.lua", - 'locales/languages.lua', - 'config.lua', - 'server/server.lua', - 'server/milleniumfalcon.lua' +dependencies { + 'es_extended', + 'esx_society' } diff --git a/VRP/trew_hud_ui/html/app.js b/ESX/esx_trew_hud/html/app.js similarity index 96% rename from VRP/trew_hud_ui/html/app.js rename to ESX/esx_trew_hud/html/app.js index bd90754..a9349ae 100644 --- a/VRP/trew_hud_ui/html/app.js +++ b/ESX/esx_trew_hud/html/app.js @@ -1,496 +1,497 @@ -function rgba(hex,opacity){ - hex = hex.replace('#',''); - redColor = parseInt(hex.substring(0,2), 16); - greenColor = parseInt(hex.substring(2,4), 16); - blueColor = parseInt(hex.substring(4,6), 16); - - result = 'rgba('+redColor+','+greenColor+','+blueColor+','+opacity/100+')'; - return result; -} - -var loadJS = function(url, implementationCode, location) { - var scriptTag = document.createElement('script'); - scriptTag.src = url; - - scriptTag.onload = implementationCode; - scriptTag.onreadystatechange = implementationCode; - - location.appendChild(scriptTag); -}; - - - -function ajaxio(method,url,type=null,data=null) { - return new Promise((resolve, reject) => { - const req = new XMLHttpRequest(); - req.open(method, url, true); - - if (method == 'POST') { - if (type == 'json' && data != null) { - req.setRequestHeader('Content-Type', 'application/json'); - var data = JSON.stringify(data); - } - else { req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } - } - - req.onload = () => req.status === 200 ? resolve(req.response) : reject(Error(req.statusText)); - req.onerror = (e) => reject(Error(`Network Error: ${e}`)); - - if (method == 'POST') { req.send(data); } - else { req.send(); } - }); -} - - -Object.prototype.addMultiListener = function(eventNames, listener) { - var events = eventNames.split(' '); - - if (NodeList.prototype.isPrototypeOf(this) == true) { - for (var x=0, xLen=this.length; x'; - - - if (document.getElementById(statusID)) { } - else { - var newStatus = document.createElement('li'); - newStatus.classList.add('icon', 'customstatus'); - newStatus.id = statusID; - - motherStatus.insertBefore(newStatus, motherStatus.firstChild); - - saferInnerHTML(document.getElementById(statusID), statusIcon); - } - }, - - - setStatus: function(data) { - - if (data.isdead == true) { - if (document.querySelector('#health').classList.contains('dead') == false) { - document.querySelector('#health').classList.add('dead'); - for (i = 0; i < data.status.length; i++) { document.querySelector('#'+data.status[i].name+' span').style.height = '0'; } - } - } - else { - for (i = 0; i < data.status.length; i++) { - if ((data.status[i].name == 'hunger') || (data.status[i].name == 'thirst')) { var statusValue = Math.floor(100 - data.status[i].value); } - else { var statusValue = Math.floor(data.status[i].value); } - if (document.querySelector('#'+data.status[i].name+' span')) { document.querySelector('#'+data.status[i].name+' span').style.height = statusValue+'%'; } - if (statusValue <= 35) { - if (document.querySelector('#'+data.status[i].name)) { - if (document.querySelector('#'+data.status[i].name).classList.contains('dying') == false) { - document.querySelector('#'+data.status[i].name).classList.add('dying'); - } - } - } - else { - if (document.querySelector('#'+data.status[i].name)) { document.querySelector('#'+data.status[i].name).classList.remove('dying'); } - - } - } - if (document.querySelector('#health').classList.contains('dead')) { document.querySelector('#health').classList.remove('dead'); } - } - }, - - - updateWeapon: function(data) { - var weaponContainer = document.querySelector('#weapon'); - var bulletsContainer = document.querySelector('#bullets'); - - if (data.status.armed == true) { - - var oldWeapon = document.querySelector('#weapon_image img').src; - var newWeapon = 'img/weapons/'+data.status.weapon+'.png'; - if (oldWeapon != newWeapon) { document.querySelector('#weapon_image img').src = newWeapon; } - - if (weaponContainer.classList.contains('armed') == false) { - weaponContainer.classList.remove('unarmed', 'fadeOut'); - weaponContainer.classList.add('armed', 'fadeIn'); - } - - } - else { - - if (weaponContainer.classList.contains('unarmed') == false) { - weaponContainer.classList.remove('armed', 'fadeIn'); - weaponContainer.classList.add('unarmed', 'fadeOut'); - } - - } - }, - - - - - - - updateVehicle: function(data) { - - var vehicleInfo = document.querySelector('.info.vehicle'); - var vehicleSeatbelt = document.querySelector('#seatbelt'); - var vehicleLights = document.querySelector('#lights'); - var vehicleSignals = document.querySelector('#signals'); - var vehicleFuel = document.querySelector('#fuel'); - var vehicleCruiser = document.querySelector('#vehicle-speed strong'); - var vehiclesCars = [0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20]; - - if (data.status == true) { - if (vehicleInfo.classList.contains('inactive')) { - - vehicleSeatbelt.style.display = 'none'; - vehicleLights.style.display = 'none'; - vehicleSignals.style.display = 'none'; - vehicleFuel.style.display = 'none'; - - if (vehiclesCars.indexOf(data.type) > -1) { - document.querySelector('#vehicle-others').style.display = 'none'; - document.querySelector('#vehicle-gear').style.display = 'block'; - - vehicleSeatbelt.style.display = 'block'; - vehicleLights.style.display = 'block'; - vehicleSignals.style.display = 'block'; - vehicleFuel.style.display = 'block'; - - document.querySelector('#vehicle-gear').style.display = 'block'; - } - - else { - document.querySelector('#vehicle-others').style.display = 'block'; - document.querySelector('#vehicle-gear').style.display = 'none'; - document.querySelector('#vehicle-others i').classList.remove('fa-biking', 'fa-helicopter', 'fa-ship'); - - if (data.type == 13) { document.querySelector('#vehicle-others i').classList.add('fa-biking'); } - else if (data.type == 14) { document.querySelector('#vehicle-others i').classList.add('fa-ship'); } - else if (data.type == 15) { document.querySelector('#vehicle-others i').classList.add('fa-helicopter'); } - else if (data.type == 16) { document.querySelector('#vehicle-others i').classList.add('fa-plane'); } - else if (data.type == 21) { document.querySelector('#vehicle-others i').classList.add('fa-train'); } - } - - vehicleInfo.classList.remove('inactive'); - vehicleInfo.classList.add('active', 'fadeIn'); - } - - if (vehicleInfo.classList.contains('updated') == false) { - - var vehicleSpeedUnit = data.config.speedUnit.slice(0,2)+'/'+data.config.speedUnit.slice(-1); - var vehicleAverageSpeed = Math.ceil(data.config.maxSpeed / 6); - - vehicleInfo.classList.add('updated'); - saferInnerHTML(vehicleCruiser,vehicleSpeedUnit); - - } - - - - - var previousGear = document.querySelector('#vehicle-gear span').innerHTML; - var currentGear = data.gear; - if (previousGear != currentGear) { document.querySelector('#vehicle-gear').classList.add('pulse') } - saferInnerHTML(document.querySelector('#vehicle-gear span'), data.gear); - - - - - - - var speedometerCircle = document.querySelector('#progress-speed svg circle.speed'); - var speedPercentage = Math.floor(Math.floor(data.speed*100)/data.config.maxSpeed); - - speedometerCircle.classList.remove('zero'); - speedometerCircle.classList.remove('twentyfive'); - speedometerCircle.classList.remove('fifty'); - speedometerCircle.classList.remove('seventyfive'); - - if (speedPercentage >= 0 && speedPercentage <= 25) { speedometerCircle.classList.add('zero'); } - else if (speedPercentage > 25 && speedPercentage <= 50) { speedometerCircle.classList.add('twentyfive'); } - else if (speedPercentage > 50 && speedPercentage <= 75) { speedometerCircle.classList.add('fifty'); } - else if (speedPercentage > 75) { speedometerCircle.classList.add('seventyfive'); } - - document.querySelector('#progress-speed svg circle.speed').style.strokeDashoffset = data.nail; - saferInnerHTML(document.querySelector('#vehicle-speed span'), data.speed); - - - - - - - - - if ( (data.seatbelt.status == true) && (vehicleSeatbelt.classList.contains('on') == false) ) { - vehicleSeatbelt.classList.remove('off'); - vehicleSeatbelt.classList.add('on'); - - eventCallback.sound('sounds/seatbelt-buckle.ogg', { volume: '0.50' }); - } - else if ( (data.seatbelt.status == false) && (vehicleSeatbelt.classList.contains('off') == false) ) { - vehicleSeatbelt.classList.remove('on'); - vehicleSeatbelt.classList.add('off'); - - eventCallback.sound('sounds/seatbelt-unbuckle.ogg', { volume: '0.50' }); - } - - - - - - - - - - - if (vehicleCruiser.classList.contains(data.cruiser) == false) { - vehicleCruiser.classList.remove('on','off'); - vehicleCruiser.classList.add(data.cruiser); - } - - - - - if (data.siren == true) { document.querySelector('#vehicle-gear').classList.add('pulsing'); } - else { document.querySelector('#vehicle-gear').classList.remove('pulsing'); } - - - - - - - if (vehicleLights.classList.contains(data.lights) == false) { - vehicleLights.classList.remove('normal','high','off'); - vehicleLights.classList.add(data.lights); - - if (data.lights == 'high') { vehicleLights.querySelector('i img').src = 'img/vehicle-lights-high.png'; } - else { vehicleLights.querySelector('i img').src = 'img/vehicle-lights.png'; } - } - - - - - - - - - - - if (vehicleSignals.classList.contains(data.signals) == false) { - - vehicleSignals.querySelector('i').className = 'fa fa-arrows-alt-h'; - vehicleSignals.classList.remove('left','right','both','off'); - - if ( (data.signals == 'left') || (data.signals == 'right') || (data.signals == 'both') ) { - - var classSignal = 'fa-long-arrow-alt-'+data.signals; - if (data.signals == 'both') { classSignal = 'fa-arrows-alt-h'; } - - vehicleSignals.querySelector('i').classList.add('fas',classSignal); - vehicleSignals.classList.add(data.signals, 'dying'); - - eventCallback.sound('sounds/car-indicators.ogg', { loop: 'loop' }); - } - - else if (data.signals == 'off') { - vehicleSignals.querySelector('i').classList.add('fas','fa-arrows-alt-h'); - vehicleSignals.classList.remove('dying'); - vehicleSignals.classList.add(data.signals); - - eventCallback.sound(); - } - - - } - - - - - - - - - - - - - vehicleFuel.querySelector('span').style.height = data.fuel+'%'; - - if (data.fuel <= 35) { - if (vehicleFuel.classList.contains('dying') == false) { vehicleFuel.classList.add('dying'); } - } - else { vehicleFuel.classList.remove('dying'); } - - } - else { - if (vehicleInfo.classList.contains('active')) { - vehicleSeatbelt.classList.remove('on'); - vehicleCruiser.classList.remove('on'); - - vehicleInfo.classList.remove('active'); - vehicleInfo.classList.add('inactive', 'fadeOut'); - - eventCallback.sound(); - } - - } - - }, - - toggleUi: function(data) { - var uiID = document.querySelector('#ui'); - if (data.value == true) { - uiID.style.display = 'block'; - } - else { - uiID.style.display = 'none'; - } - }, - - sound: function(file = null, args = null) { - var sound = document.querySelector('#sounds'); - var soundFile = file; - var args = args; - - for (i = 0; i < sound.attributes.length; i++) { - if (sound.attributes[i].name != 'id') { sound.removeAttribute(sound.attributes[i].name); } - } - - if (soundFile == null) { sound.setAttribute('src', ''); } - else { - if (args == null) { } - else { - for (var key in args) { - if (key != 'addMultiListener') { - if (key == 'volume') { sound.volume = args[key]; } - else { sound.setAttribute(key, args[key]); } - } - } - } - - sound.setAttribute('src', soundFile); - sound.play(); - } - - - }, - - - - - - - - - - - - - - - - - - - - - - - - - - }; - - document.querySelectorAll('.icon i').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { this.parentElement.classList.remove('pulse'); this.parentElement.classList.remove('shooting'); }); - - document.querySelectorAll('.info.vehicle').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { - this.classList.remove('fadeOut', 'fadeIn'); - }); - - - - window.addEventListener('message', function(event) { - eventCallback[event.data.action](event.data); - }); - +function rgba(hex,opacity){ + hex = hex.replace('#',''); + redColor = parseInt(hex.substring(0,2), 16); + greenColor = parseInt(hex.substring(2,4), 16); + blueColor = parseInt(hex.substring(4,6), 16); + + result = 'rgba('+redColor+','+greenColor+','+blueColor+','+opacity/100+')'; + return result; +} + +var loadJS = function(url, implementationCode, location) { + var scriptTag = document.createElement('script'); + scriptTag.src = url; + + scriptTag.onload = implementationCode; + scriptTag.onreadystatechange = implementationCode; + + location.appendChild(scriptTag); +}; + + + +function ajaxio(method,url,type=null,data=null) { + return new Promise((resolve, reject) => { + const req = new XMLHttpRequest(); + req.open(method, url, true); + + if (method == 'POST') { + if (type == 'json' && data != null) { + req.setRequestHeader('Content-Type', 'application/json'); + var data = JSON.stringify(data); + } + else { req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } + } + + req.onload = () => req.status === 200 ? resolve(req.response) : reject(Error(req.statusText)); + req.onerror = (e) => reject(Error(`Network Error: ${e}`)); + + if (method == 'POST') { req.send(data); } + else { req.send(); } + }); +} + + +Object.prototype.addMultiListener = function(eventNames, listener) { + var events = eventNames.split(' '); + + if (NodeList.prototype.isPrototypeOf(this) == true) { + for (var x=0, xLen=this.length; x'; + + + if (document.getElementById(statusID)) { } + else { + var newStatus = document.createElement('li'); + newStatus.classList.add('icon', 'customstatus'); + newStatus.id = statusID; + + motherStatus.insertBefore(newStatus, motherStatus.firstChild); + + saferInnerHTML(document.getElementById(statusID), statusIcon); + } + }, + + + setStatus: function(data) { + + if (data.isdead == true) { + if (document.querySelector('#health').classList.contains('dead') == false) { + document.querySelector('#health').classList.add('dead'); + for (i = 0; i < data.status.length; i++) { document.querySelector('#'+data.status[i].name+' span').style.height = '0'; } + } + } + else { + for (i = 0; i < data.status.length; i++) { + if ((data.status[i].name == 'hunger') || (data.status[i].name == 'thirst')) { var statusValue = Math.floor(100 - data.status[i].value); } + else { var statusValue = Math.floor(data.status[i].value); } + if (document.querySelector('#'+data.status[i].name+' span')) { document.querySelector('#'+data.status[i].name+' span').style.height = statusValue+'%'; } + if (statusValue <= 35) { + if (document.querySelector('#'+data.status[i].name)) { + if (document.querySelector('#'+data.status[i].name).classList.contains('dying') == false) { + document.querySelector('#'+data.status[i].name).classList.add('dying'); + } + } + } + else { + if (document.querySelector('#'+data.status[i].name)) { document.querySelector('#'+data.status[i].name).classList.remove('dying'); } + + } + } + if (document.querySelector('#health').classList.contains('dead')) { document.querySelector('#health').classList.remove('dead'); } + } + }, + + + updateWeapon: function(data) { + var weaponContainer = document.querySelector('#weapon'); + var bulletsContainer = document.querySelector('#bullets'); + + if (data.status.armed == true) { + + var oldWeapon = document.querySelector('#weapon_image img').src; + var newWeapon = 'img/weapons/'+data.status.weapon+'.png'; + if (oldWeapon != newWeapon) { document.querySelector('#weapon_image img').src = newWeapon; } + + if (weaponContainer.classList.contains('armed') == false) { + weaponContainer.classList.remove('unarmed', 'fadeOut'); + weaponContainer.classList.add('armed', 'fadeIn'); + } + + } + else { + + if (weaponContainer.classList.contains('unarmed') == false) { + weaponContainer.classList.remove('armed', 'fadeIn'); + weaponContainer.classList.add('unarmed', 'fadeOut'); + } + + } + }, + + + + + + + updateVehicle: function(data) { + + var vehicleInfo = document.querySelector('.info.vehicle'); + var vehicleSeatbelt = document.querySelector('#seatbelt'); + var vehicleLights = document.querySelector('#lights'); + var vehicleSignals = document.querySelector('#signals'); + var vehicleFuel = document.querySelector('#fuel'); + var vehicleCruiser = document.querySelector('#vehicle-speed strong'); + var vehiclesCars = [0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20]; + + if (data.status == true) { + if (vehicleInfo.classList.contains('inactive')) { + + vehicleSeatbelt.style.display = 'none'; + vehicleLights.style.display = 'none'; + vehicleSignals.style.display = 'none'; + vehicleFuel.style.display = 'none'; + + if (vehiclesCars.indexOf(data.type) > -1) { + document.querySelector('#vehicle-others').style.display = 'none'; + document.querySelector('#vehicle-gear').style.display = 'block'; + + vehicleSeatbelt.style.display = 'block'; + vehicleLights.style.display = 'block'; + vehicleSignals.style.display = 'block'; + vehicleFuel.style.display = 'block'; + + document.querySelector('#vehicle-gear').style.display = 'block'; + } + + else { + document.querySelector('#vehicle-others').style.display = 'block'; + document.querySelector('#vehicle-gear').style.display = 'none'; + document.querySelector('#vehicle-others i').classList.remove('fa-biking', 'fa-helicopter', 'fa-ship'); + + if (data.type == 13) { document.querySelector('#vehicle-others i').classList.add('fa-biking'); } + else if (data.type == 14) { document.querySelector('#vehicle-others i').classList.add('fa-ship'); } + else if (data.type == 15) { document.querySelector('#vehicle-others i').classList.add('fa-helicopter'); } + else if (data.type == 16) { document.querySelector('#vehicle-others i').classList.add('fa-plane'); } + else if (data.type == 21) { document.querySelector('#vehicle-others i').classList.add('fa-train'); } + } + + vehicleInfo.classList.remove('inactive'); + vehicleInfo.classList.add('active', 'fadeIn'); + } + + if (vehicleInfo.classList.contains('updated') == false) { + + var vehicleSpeedUnit = data.config.speedUnit.slice(0,2)+'/'+data.config.speedUnit.slice(-1); + var vehicleAverageSpeed = Math.ceil(data.config.maxSpeed / 6); + + vehicleInfo.classList.add('updated'); + saferInnerHTML(vehicleCruiser,vehicleSpeedUnit); + + } + + + + + var previousGear = document.querySelector('#vehicle-gear span').innerHTML; + var currentGear = data.gear; + if (previousGear != currentGear) { document.querySelector('#vehicle-gear').classList.add('pulse') } + saferInnerHTML(document.querySelector('#vehicle-gear span'), data.gear); + + + + + + + var speedometerCircle = document.querySelector('#progress-speed svg circle.speed'); + var speedPercentage = Math.floor(Math.floor(data.speed*100)/data.config.maxSpeed); + + speedometerCircle.classList.remove('zero'); + speedometerCircle.classList.remove('twentyfive'); + speedometerCircle.classList.remove('fifty'); + speedometerCircle.classList.remove('seventyfive'); + + if (speedPercentage >= 0 && speedPercentage <= 25) { speedometerCircle.classList.add('zero'); } + else if (speedPercentage > 25 && speedPercentage <= 50) { speedometerCircle.classList.add('twentyfive'); } + else if (speedPercentage > 50 && speedPercentage <= 75) { speedometerCircle.classList.add('fifty'); } + else if (speedPercentage > 75) { speedometerCircle.classList.add('seventyfive'); } + + document.querySelector('#progress-speed svg circle.speed').style.strokeDashoffset = data.nail; + saferInnerHTML(document.querySelector('#vehicle-speed span'), data.speed); + + + + + + + + + if ( (data.seatbelt.status == true) && (vehicleSeatbelt.classList.contains('on') == false) ) { + vehicleSeatbelt.classList.remove('off'); + vehicleSeatbelt.classList.add('on'); + + eventCallback.sound('sounds/seatbelt-buckle.ogg', { volume: '0.50' }); + } + else if ( (data.seatbelt.status == false) && (vehicleSeatbelt.classList.contains('off') == false) ) { + vehicleSeatbelt.classList.remove('on'); + vehicleSeatbelt.classList.add('off'); + + eventCallback.sound('sounds/seatbelt-unbuckle.ogg', { volume: '0.50' }); + } + + + + + + + + + + + if (vehicleCruiser.classList.contains(data.cruiser) == false) { + vehicleCruiser.classList.remove('on','off'); + vehicleCruiser.classList.add(data.cruiser); + } + + + + + if (data.siren == true) { document.querySelector('#vehicle-gear').classList.add('pulsing'); } + else { document.querySelector('#vehicle-gear').classList.remove('pulsing'); } + + + + + + + if (vehicleLights.classList.contains(data.lights) == false) { + vehicleLights.classList.remove('normal','high','off'); + vehicleLights.classList.add(data.lights); + + if (data.lights == 'high') { vehicleLights.querySelector('i img').src = 'img/vehicle-lights-high.png'; } + else { vehicleLights.querySelector('i img').src = 'img/vehicle-lights.png'; } + } + + + + + + + + + + + if (vehicleSignals.classList.contains(data.signals) == false) { + + vehicleSignals.querySelector('i').className = 'fa fa-arrows-alt-h'; + vehicleSignals.classList.remove('left','right','both','off'); + + if ( (data.signals == 'left') || (data.signals == 'right') || (data.signals == 'both') ) { + + var classSignal = 'fa-long-arrow-alt-'+data.signals; + if (data.signals == 'both') { classSignal = 'fa-arrows-alt-h'; } + + vehicleSignals.querySelector('i').classList.add('fas',classSignal); + vehicleSignals.classList.add(data.signals, 'dying'); + + eventCallback.sound('sounds/car-indicators.ogg', { loop: 'loop' }); + } + + else if (data.signals == 'off') { + vehicleSignals.querySelector('i').classList.add('fas','fa-arrows-alt-h'); + vehicleSignals.classList.remove('dying'); + vehicleSignals.classList.add(data.signals); + + eventCallback.sound(); + } + + + } + + + + + + + + + + + + + vehicleFuel.querySelector('span').style.height = data.fuel+'%'; + + if (data.fuel <= 35) { + if (vehicleFuel.classList.contains('dying') == false) { vehicleFuel.classList.add('dying'); } + } + else { vehicleFuel.classList.remove('dying'); } + + } + else { + if (vehicleInfo.classList.contains('active')) { + vehicleSeatbelt.classList.remove('on'); + vehicleCruiser.classList.remove('on'); + + vehicleInfo.classList.remove('active'); + vehicleInfo.classList.add('inactive', 'fadeOut'); + + eventCallback.sound(); + } + + } + + }, + + toggleUi: function(data) { + var uiID = document.querySelector('#ui'); + if (data.value == true) { + uiID.style.display = 'block'; + } + else { + uiID.style.display = 'none'; + } + }, + + sound: function(file = null, args = null) { + var sound = document.querySelector('#sounds'); + var soundFile = file; + var args = args; + + for (i = 0; i < sound.attributes.length; i++) { + if (sound.attributes[i].name != 'id') { sound.removeAttribute(sound.attributes[i].name); } + } + + if (soundFile == null) { sound.setAttribute('src', ''); } + else { + if (args == null) { } + else { + for (var key in args) { + if (key != 'addMultiListener') { + if (key == 'volume') { sound.volume = args[key]; } + else { sound.setAttribute(key, args[key]); } + } + } + } + + sound.setAttribute('src', soundFile); + sound.play(); + } + + + }, + + + + + + + + + + + + + + + + + + + + + + + + + + }; + + document.querySelectorAll('.icon i').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { this.parentElement.classList.remove('pulse'); this.parentElement.classList.remove('shooting'); }); + + document.querySelectorAll('.info.vehicle').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { + this.classList.remove('fadeOut', 'fadeIn'); + }); + + + + window.addEventListener('message', function(event) { + eventCallback[event.data.action](event.data); + }); + } \ No newline at end of file diff --git a/ESX/trew_hud_ui/html/img/vehicle-gear.png b/ESX/esx_trew_hud/html/img/vehicle-gear.png similarity index 100% rename from ESX/trew_hud_ui/html/img/vehicle-gear.png rename to ESX/esx_trew_hud/html/img/vehicle-gear.png diff --git a/ESX/trew_hud_ui/html/img/vehicle-lights-high.png b/ESX/esx_trew_hud/html/img/vehicle-lights-high.png similarity index 100% rename from ESX/trew_hud_ui/html/img/vehicle-lights-high.png rename to ESX/esx_trew_hud/html/img/vehicle-lights-high.png diff --git a/ESX/trew_hud_ui/html/img/vehicle-lights.png b/ESX/esx_trew_hud/html/img/vehicle-lights.png similarity index 100% rename from ESX/trew_hud_ui/html/img/vehicle-lights.png rename to ESX/esx_trew_hud/html/img/vehicle-lights.png diff --git a/ESX/trew_hud_ui/html/img/vehicle-seatbelt.png b/ESX/esx_trew_hud/html/img/vehicle-seatbelt.png similarity index 100% rename from ESX/trew_hud_ui/html/img/vehicle-seatbelt.png rename to ESX/esx_trew_hud/html/img/vehicle-seatbelt.png diff --git a/ESX/trew_hud_ui/html/img/weapon-bullets.png b/ESX/esx_trew_hud/html/img/weapon-bullets.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapon-bullets.png rename to ESX/esx_trew_hud/html/img/weapon-bullets.png diff --git a/ESX/trew_hud_ui/html/img/weapons/advancedrifle.png b/ESX/esx_trew_hud/html/img/weapons/advancedrifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/advancedrifle.png rename to ESX/esx_trew_hud/html/img/weapons/advancedrifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/appistol.png b/ESX/esx_trew_hud/html/img/weapons/appistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/appistol.png rename to ESX/esx_trew_hud/html/img/weapons/appistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/assaultrifle.png b/ESX/esx_trew_hud/html/img/weapons/assaultrifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/assaultrifle.png rename to ESX/esx_trew_hud/html/img/weapons/assaultrifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png b/ESX/esx_trew_hud/html/img/weapons/assaultrifle_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/assaultrifle_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/assaultshotgun.png b/ESX/esx_trew_hud/html/img/weapons/assaultshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/assaultshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/assaultshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/assaultsmg.png b/ESX/esx_trew_hud/html/img/weapons/assaultsmg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/assaultsmg.png rename to ESX/esx_trew_hud/html/img/weapons/assaultsmg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/autoshotgun.png b/ESX/esx_trew_hud/html/img/weapons/autoshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/autoshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/autoshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/ball.png b/ESX/esx_trew_hud/html/img/weapons/ball.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/ball.png rename to ESX/esx_trew_hud/html/img/weapons/ball.png diff --git a/ESX/trew_hud_ui/html/img/weapons/bat.png b/ESX/esx_trew_hud/html/img/weapons/bat.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/bat.png rename to ESX/esx_trew_hud/html/img/weapons/bat.png diff --git a/ESX/trew_hud_ui/html/img/weapons/battleaxe.png b/ESX/esx_trew_hud/html/img/weapons/battleaxe.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/battleaxe.png rename to ESX/esx_trew_hud/html/img/weapons/battleaxe.png diff --git a/ESX/trew_hud_ui/html/img/weapons/bottle.png b/ESX/esx_trew_hud/html/img/weapons/bottle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/bottle.png rename to ESX/esx_trew_hud/html/img/weapons/bottle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/bullpuprifle.png b/ESX/esx_trew_hud/html/img/weapons/bullpuprifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/bullpuprifle.png rename to ESX/esx_trew_hud/html/img/weapons/bullpuprifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png b/ESX/esx_trew_hud/html/img/weapons/bullpuprifle_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/bullpuprifle_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/bullpupshotgun.png b/ESX/esx_trew_hud/html/img/weapons/bullpupshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/bullpupshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/bullpupshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/bzgas.png b/ESX/esx_trew_hud/html/img/weapons/bzgas.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/bzgas.png rename to ESX/esx_trew_hud/html/img/weapons/bzgas.png diff --git a/ESX/trew_hud_ui/html/img/weapons/carbinerifle.png b/ESX/esx_trew_hud/html/img/weapons/carbinerifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/carbinerifle.png rename to ESX/esx_trew_hud/html/img/weapons/carbinerifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png b/ESX/esx_trew_hud/html/img/weapons/carbinerifle_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/carbinerifle_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/combatmg.png b/ESX/esx_trew_hud/html/img/weapons/combatmg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/combatmg.png rename to ESX/esx_trew_hud/html/img/weapons/combatmg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/combatmg_mk2.png b/ESX/esx_trew_hud/html/img/weapons/combatmg_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/combatmg_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/combatmg_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/combatpdw.png b/ESX/esx_trew_hud/html/img/weapons/combatpdw.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/combatpdw.png rename to ESX/esx_trew_hud/html/img/weapons/combatpdw.png diff --git a/ESX/trew_hud_ui/html/img/weapons/combatpistol.png b/ESX/esx_trew_hud/html/img/weapons/combatpistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/combatpistol.png rename to ESX/esx_trew_hud/html/img/weapons/combatpistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/compactlauncher.png b/ESX/esx_trew_hud/html/img/weapons/compactlauncher.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/compactlauncher.png rename to ESX/esx_trew_hud/html/img/weapons/compactlauncher.png diff --git a/ESX/trew_hud_ui/html/img/weapons/compactrifle.png b/ESX/esx_trew_hud/html/img/weapons/compactrifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/compactrifle.png rename to ESX/esx_trew_hud/html/img/weapons/compactrifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/crowbar.png b/ESX/esx_trew_hud/html/img/weapons/crowbar.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/crowbar.png rename to ESX/esx_trew_hud/html/img/weapons/crowbar.png diff --git a/ESX/trew_hud_ui/html/img/weapons/dagger.png b/ESX/esx_trew_hud/html/img/weapons/dagger.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/dagger.png rename to ESX/esx_trew_hud/html/img/weapons/dagger.png diff --git a/ESX/trew_hud_ui/html/img/weapons/dbshotgun.png b/ESX/esx_trew_hud/html/img/weapons/dbshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/dbshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/dbshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/doubleaction.png b/ESX/esx_trew_hud/html/img/weapons/doubleaction.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/doubleaction.png rename to ESX/esx_trew_hud/html/img/weapons/doubleaction.png diff --git a/ESX/trew_hud_ui/html/img/weapons/firework.png b/ESX/esx_trew_hud/html/img/weapons/firework.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/firework.png rename to ESX/esx_trew_hud/html/img/weapons/firework.png diff --git a/ESX/trew_hud_ui/html/img/weapons/flare.png b/ESX/esx_trew_hud/html/img/weapons/flare.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/flare.png rename to ESX/esx_trew_hud/html/img/weapons/flare.png diff --git a/ESX/trew_hud_ui/html/img/weapons/flaregun.png b/ESX/esx_trew_hud/html/img/weapons/flaregun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/flaregun.png rename to ESX/esx_trew_hud/html/img/weapons/flaregun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/flashlight.png b/ESX/esx_trew_hud/html/img/weapons/flashlight.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/flashlight.png rename to ESX/esx_trew_hud/html/img/weapons/flashlight.png diff --git a/ESX/trew_hud_ui/html/img/weapons/golfclub.png b/ESX/esx_trew_hud/html/img/weapons/golfclub.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/golfclub.png rename to ESX/esx_trew_hud/html/img/weapons/golfclub.png diff --git a/ESX/trew_hud_ui/html/img/weapons/grenade.png b/ESX/esx_trew_hud/html/img/weapons/grenade.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/grenade.png rename to ESX/esx_trew_hud/html/img/weapons/grenade.png diff --git a/ESX/trew_hud_ui/html/img/weapons/grenadelauncher.png b/ESX/esx_trew_hud/html/img/weapons/grenadelauncher.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/grenadelauncher.png rename to ESX/esx_trew_hud/html/img/weapons/grenadelauncher.png diff --git a/ESX/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png b/ESX/esx_trew_hud/html/img/weapons/grenadelauncher_smoke.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png rename to ESX/esx_trew_hud/html/img/weapons/grenadelauncher_smoke.png diff --git a/ESX/trew_hud_ui/html/img/weapons/gusenberg.png b/ESX/esx_trew_hud/html/img/weapons/gusenberg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/gusenberg.png rename to ESX/esx_trew_hud/html/img/weapons/gusenberg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/hammer.png b/ESX/esx_trew_hud/html/img/weapons/hammer.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/hammer.png rename to ESX/esx_trew_hud/html/img/weapons/hammer.png diff --git a/ESX/trew_hud_ui/html/img/weapons/hatchet.png b/ESX/esx_trew_hud/html/img/weapons/hatchet.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/hatchet.png rename to ESX/esx_trew_hud/html/img/weapons/hatchet.png diff --git a/ESX/trew_hud_ui/html/img/weapons/heavypistol.png b/ESX/esx_trew_hud/html/img/weapons/heavypistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/heavypistol.png rename to ESX/esx_trew_hud/html/img/weapons/heavypistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/heavyshotgun.png b/ESX/esx_trew_hud/html/img/weapons/heavyshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/heavyshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/heavyshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/heavysniper.png b/ESX/esx_trew_hud/html/img/weapons/heavysniper.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/heavysniper.png rename to ESX/esx_trew_hud/html/img/weapons/heavysniper.png diff --git a/ESX/trew_hud_ui/html/img/weapons/heavysniper_mk2.png b/ESX/esx_trew_hud/html/img/weapons/heavysniper_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/heavysniper_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/heavysniper_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/hominglauncher.png b/ESX/esx_trew_hud/html/img/weapons/hominglauncher.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/hominglauncher.png rename to ESX/esx_trew_hud/html/img/weapons/hominglauncher.png diff --git a/ESX/trew_hud_ui/html/img/weapons/knife.png b/ESX/esx_trew_hud/html/img/weapons/knife.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/knife.png rename to ESX/esx_trew_hud/html/img/weapons/knife.png diff --git a/ESX/trew_hud_ui/html/img/weapons/knuckle.png b/ESX/esx_trew_hud/html/img/weapons/knuckle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/knuckle.png rename to ESX/esx_trew_hud/html/img/weapons/knuckle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/machete.png b/ESX/esx_trew_hud/html/img/weapons/machete.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/machete.png rename to ESX/esx_trew_hud/html/img/weapons/machete.png diff --git a/ESX/trew_hud_ui/html/img/weapons/machinepistol.png b/ESX/esx_trew_hud/html/img/weapons/machinepistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/machinepistol.png rename to ESX/esx_trew_hud/html/img/weapons/machinepistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/marksmanpistol.png b/ESX/esx_trew_hud/html/img/weapons/marksmanpistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/marksmanpistol.png rename to ESX/esx_trew_hud/html/img/weapons/marksmanpistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/marksmanrifle.png b/ESX/esx_trew_hud/html/img/weapons/marksmanrifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/marksmanrifle.png rename to ESX/esx_trew_hud/html/img/weapons/marksmanrifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png b/ESX/esx_trew_hud/html/img/weapons/marksmanrifle_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/marksmanrifle_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/mg.png b/ESX/esx_trew_hud/html/img/weapons/mg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/mg.png rename to ESX/esx_trew_hud/html/img/weapons/mg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/microsmg.png b/ESX/esx_trew_hud/html/img/weapons/microsmg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/microsmg.png rename to ESX/esx_trew_hud/html/img/weapons/microsmg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/minigun.png b/ESX/esx_trew_hud/html/img/weapons/minigun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/minigun.png rename to ESX/esx_trew_hud/html/img/weapons/minigun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/minismg.png b/ESX/esx_trew_hud/html/img/weapons/minismg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/minismg.png rename to ESX/esx_trew_hud/html/img/weapons/minismg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/molotov.png b/ESX/esx_trew_hud/html/img/weapons/molotov.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/molotov.png rename to ESX/esx_trew_hud/html/img/weapons/molotov.png diff --git a/ESX/trew_hud_ui/html/img/weapons/musket.png b/ESX/esx_trew_hud/html/img/weapons/musket.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/musket.png rename to ESX/esx_trew_hud/html/img/weapons/musket.png diff --git a/ESX/trew_hud_ui/html/img/weapons/nightstick.png b/ESX/esx_trew_hud/html/img/weapons/nightstick.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/nightstick.png rename to ESX/esx_trew_hud/html/img/weapons/nightstick.png diff --git a/ESX/trew_hud_ui/html/img/weapons/petrolcan.png b/ESX/esx_trew_hud/html/img/weapons/petrolcan.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/petrolcan.png rename to ESX/esx_trew_hud/html/img/weapons/petrolcan.png diff --git a/ESX/trew_hud_ui/html/img/weapons/pipebomb.png b/ESX/esx_trew_hud/html/img/weapons/pipebomb.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/pipebomb.png rename to ESX/esx_trew_hud/html/img/weapons/pipebomb.png diff --git a/ESX/trew_hud_ui/html/img/weapons/pistol.png b/ESX/esx_trew_hud/html/img/weapons/pistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/pistol.png rename to ESX/esx_trew_hud/html/img/weapons/pistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/pistol50.png b/ESX/esx_trew_hud/html/img/weapons/pistol50.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/pistol50.png rename to ESX/esx_trew_hud/html/img/weapons/pistol50.png diff --git a/ESX/trew_hud_ui/html/img/weapons/pistol_mk2.png b/ESX/esx_trew_hud/html/img/weapons/pistol_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/pistol_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/pistol_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/poolcue.png b/ESX/esx_trew_hud/html/img/weapons/poolcue.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/poolcue.png rename to ESX/esx_trew_hud/html/img/weapons/poolcue.png diff --git a/ESX/trew_hud_ui/html/img/weapons/proxmine.png b/ESX/esx_trew_hud/html/img/weapons/proxmine.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/proxmine.png rename to ESX/esx_trew_hud/html/img/weapons/proxmine.png diff --git a/ESX/trew_hud_ui/html/img/weapons/pumpshotgun.png b/ESX/esx_trew_hud/html/img/weapons/pumpshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/pumpshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/pumpshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png b/ESX/esx_trew_hud/html/img/weapons/pumpshotgun_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/pumpshotgun_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/railgun.png b/ESX/esx_trew_hud/html/img/weapons/railgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/railgun.png rename to ESX/esx_trew_hud/html/img/weapons/railgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/raycarbine.png b/ESX/esx_trew_hud/html/img/weapons/raycarbine.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/raycarbine.png rename to ESX/esx_trew_hud/html/img/weapons/raycarbine.png diff --git a/ESX/trew_hud_ui/html/img/weapons/rayminigun.png b/ESX/esx_trew_hud/html/img/weapons/rayminigun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/rayminigun.png rename to ESX/esx_trew_hud/html/img/weapons/rayminigun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/raypistol.png b/ESX/esx_trew_hud/html/img/weapons/raypistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/raypistol.png rename to ESX/esx_trew_hud/html/img/weapons/raypistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/revolver.png b/ESX/esx_trew_hud/html/img/weapons/revolver.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/revolver.png rename to ESX/esx_trew_hud/html/img/weapons/revolver.png diff --git a/ESX/trew_hud_ui/html/img/weapons/revolver_mk2.png b/ESX/esx_trew_hud/html/img/weapons/revolver_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/revolver_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/revolver_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/rpg.png b/ESX/esx_trew_hud/html/img/weapons/rpg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/rpg.png rename to ESX/esx_trew_hud/html/img/weapons/rpg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/sawnoffshotgun.png b/ESX/esx_trew_hud/html/img/weapons/sawnoffshotgun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/sawnoffshotgun.png rename to ESX/esx_trew_hud/html/img/weapons/sawnoffshotgun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/smg.png b/ESX/esx_trew_hud/html/img/weapons/smg.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/smg.png rename to ESX/esx_trew_hud/html/img/weapons/smg.png diff --git a/ESX/trew_hud_ui/html/img/weapons/smg_mk2.png b/ESX/esx_trew_hud/html/img/weapons/smg_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/smg_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/smg_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/smokegrenade.png b/ESX/esx_trew_hud/html/img/weapons/smokegrenade.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/smokegrenade.png rename to ESX/esx_trew_hud/html/img/weapons/smokegrenade.png diff --git a/ESX/trew_hud_ui/html/img/weapons/sniperrifle.png b/ESX/esx_trew_hud/html/img/weapons/sniperrifle.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/sniperrifle.png rename to ESX/esx_trew_hud/html/img/weapons/sniperrifle.png diff --git a/ESX/trew_hud_ui/html/img/weapons/snowball.png b/ESX/esx_trew_hud/html/img/weapons/snowball.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/snowball.png rename to ESX/esx_trew_hud/html/img/weapons/snowball.png diff --git a/ESX/trew_hud_ui/html/img/weapons/snspistol.png b/ESX/esx_trew_hud/html/img/weapons/snspistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/snspistol.png rename to ESX/esx_trew_hud/html/img/weapons/snspistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/snspistol_mk2.png b/ESX/esx_trew_hud/html/img/weapons/snspistol_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/snspistol_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/snspistol_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/specialcarbine.png b/ESX/esx_trew_hud/html/img/weapons/specialcarbine.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/specialcarbine.png rename to ESX/esx_trew_hud/html/img/weapons/specialcarbine.png diff --git a/ESX/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png b/ESX/esx_trew_hud/html/img/weapons/specialcarbine_mk2.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png rename to ESX/esx_trew_hud/html/img/weapons/specialcarbine_mk2.png diff --git a/ESX/trew_hud_ui/html/img/weapons/stickybomb.png b/ESX/esx_trew_hud/html/img/weapons/stickybomb.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/stickybomb.png rename to ESX/esx_trew_hud/html/img/weapons/stickybomb.png diff --git a/ESX/trew_hud_ui/html/img/weapons/stone_hatchet.png b/ESX/esx_trew_hud/html/img/weapons/stone_hatchet.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/stone_hatchet.png rename to ESX/esx_trew_hud/html/img/weapons/stone_hatchet.png diff --git a/ESX/trew_hud_ui/html/img/weapons/stungun.png b/ESX/esx_trew_hud/html/img/weapons/stungun.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/stungun.png rename to ESX/esx_trew_hud/html/img/weapons/stungun.png diff --git a/ESX/trew_hud_ui/html/img/weapons/switchblade.png b/ESX/esx_trew_hud/html/img/weapons/switchblade.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/switchblade.png rename to ESX/esx_trew_hud/html/img/weapons/switchblade.png diff --git a/ESX/trew_hud_ui/html/img/weapons/unarmed.png b/ESX/esx_trew_hud/html/img/weapons/unarmed.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/unarmed.png rename to ESX/esx_trew_hud/html/img/weapons/unarmed.png diff --git a/ESX/trew_hud_ui/html/img/weapons/vintagepistol.png b/ESX/esx_trew_hud/html/img/weapons/vintagepistol.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/vintagepistol.png rename to ESX/esx_trew_hud/html/img/weapons/vintagepistol.png diff --git a/ESX/trew_hud_ui/html/img/weapons/wrench.png b/ESX/esx_trew_hud/html/img/weapons/wrench.png similarity index 100% rename from ESX/trew_hud_ui/html/img/weapons/wrench.png rename to ESX/esx_trew_hud/html/img/weapons/wrench.png diff --git a/VRP2/trew_hud_ui/html/main.css b/ESX/esx_trew_hud/html/main.css similarity index 98% rename from VRP2/trew_hud_ui/html/main.css rename to ESX/esx_trew_hud/html/main.css index 599a7e2..c1f7c8b 100644 --- a/VRP2/trew_hud_ui/html/main.css +++ b/ESX/esx_trew_hud/html/main.css @@ -68,7 +68,7 @@ div.separator { display: block; clear: both; width: 100%; } .info.player #money #blackMoney i { background: linear-gradient(180deg, #474747 0%, #252525 100%); } .info.player #money #bank i { background: linear-gradient(180deg, #c70a0a 0%, #960505 100%); } .info.player #money #society i { background: linear-gradient(180deg, #874c14 0%, #6a3c10 100%); } - +.info.player #money #plyId i { background: linear-gradient(180deg, #635ebd 0%, #3776ff 100%); } /*.info.player #money #wallet i:before { content: '\f153'; }*/ @@ -171,7 +171,7 @@ div.separator { display: block; clear: both; width: 100%; } .info.radio #voice.whisper { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } .info.radio #voice.normal { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.radio #voice.shout { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } +.info.radio #voice.shouting { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } .info.radio #voice i.fas { font-size: 18px; color: #FFF; } .info.radio #voice.speak { animation: trew-soundwave 1s infinite; } @@ -231,4 +231,4 @@ div.separator { display: block; clear: both; width: 100%; } 75%{ background: rgba(127,0,255,0.70); } 83%{ background: rgba(255,0,255,0.70); } 91%{ background: rgba(255,0,127,0.70); } -} \ No newline at end of file +} diff --git a/ESX/trew_hud_ui/html/sounds/car-indicators.ogg b/ESX/esx_trew_hud/html/sounds/car-indicators.ogg similarity index 100% rename from ESX/trew_hud_ui/html/sounds/car-indicators.ogg rename to ESX/esx_trew_hud/html/sounds/car-indicators.ogg diff --git a/ESX/trew_hud_ui/html/sounds/seatbelt-buckle.ogg b/ESX/esx_trew_hud/html/sounds/seatbelt-buckle.ogg similarity index 100% rename from ESX/trew_hud_ui/html/sounds/seatbelt-buckle.ogg rename to ESX/esx_trew_hud/html/sounds/seatbelt-buckle.ogg diff --git a/ESX/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg b/ESX/esx_trew_hud/html/sounds/seatbelt-unbuckle.ogg similarity index 100% rename from ESX/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg rename to ESX/esx_trew_hud/html/sounds/seatbelt-unbuckle.ogg diff --git a/ESX/esx_trew_hud/html/ui.html b/ESX/esx_trew_hud/html/ui.html new file mode 100644 index 0000000..36e90fb --- /dev/null +++ b/ESX/esx_trew_hud/html/ui.html @@ -0,0 +1,177 @@ + + + + + + + + + + + + TREW UI + + + +
+ + + + + +
+ + +
+
    + + + + + +
+
+ +
+ + + + + +
+ + +
+ + + + + + + +
+ +
+ + +
+ + + + +
+ + + +
+ 999 + KM/H +
+ + + +
+ N +
+ + + + + +
+
    +
  • +
  • +
+
+ + +
+
    +
  • +
  • +
+
+ + + +
+ + + + + +
+ + + + + + + + +
+ +
+ + + + + + + +
+
+ + +
+
+ + + +
+ + + + + diff --git a/ESX/trew_hud_ui/locales/br.lua b/ESX/esx_trew_hud/locales/br.lua similarity index 100% rename from ESX/trew_hud_ui/locales/br.lua rename to ESX/esx_trew_hud/locales/br.lua diff --git a/ESX/trew_hud_ui/locales/en.lua b/ESX/esx_trew_hud/locales/en.lua similarity index 100% rename from ESX/trew_hud_ui/locales/en.lua rename to ESX/esx_trew_hud/locales/en.lua diff --git a/ESX/trew_hud_ui/locales/es.lua b/ESX/esx_trew_hud/locales/es.lua similarity index 100% rename from ESX/trew_hud_ui/locales/es.lua rename to ESX/esx_trew_hud/locales/es.lua diff --git a/ESX/trew_hud_ui/client/client.lua b/ESX/trew_hud_ui/client/client.lua deleted file mode 100644 index 1a48909..0000000 --- a/ESX/trew_hud_ui/client/client.lua +++ /dev/null @@ -1,795 +0,0 @@ -ESX = nil - -CreateThread(function() - while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Wait(0) end - while ESX.GetPlayerData().job == nil do Wait(100) end - ESX.PlayerData = ESX.GetPlayerData() -end) - -RegisterNetEvent('esx:playerLoaded') -AddEventHandler('esx:playerLoaded', function(xPlayer) - ESX.PlayerData = xPlayer - PlayerLoaded = true -end) - -RegisterNetEvent('esx:setJob') -AddEventHandler('esx:setJob', function(job) - ESX.PlayerData.job = job -end) - -local zones = { ['AIRP'] = "Los Santos International Airport", ['ALAMO'] = "Alamo Sea", ['ALTA'] = "Alta", ['ARMYB'] = "Fort Zancudo", ['BANHAMC'] = "Banham Canyon Dr", ['BANNING'] = "Banning", ['BEACH'] = "Vespucci Beach", ['BHAMCA'] = "Banham Canyon", ['BRADP'] = "Braddock Pass", ['BRADT'] = "Braddock Tunnel", ['BURTON'] = "Burton", ['CALAFB'] = "Calafia Bridge", ['CANNY'] = "Raton Canyon", ['CCREAK'] = "Cassidy Creek", ['CHAMH'] = "Chamberlain Hills", ['CHIL'] = "Vinewood Hills", ['CHU'] = "Chumash", ['CMSW'] = "Chiliad Mountain State Wilderness", ['CYPRE'] = "Cypress Flats", ['DAVIS'] = "Davis", ['DELBE'] = "Del Perro Beach", ['DELPE'] = "Del Perro", ['DELSOL'] = "La Puerta", ['DESRT'] = "Grand Senora Desert", ['DOWNT'] = "Downtown", ['DTVINE'] = "Downtown Vinewood", ['EAST_V'] = "East Vinewood", ['EBURO'] = "El Burro Heights", ['ELGORL'] = "El Gordo Lighthouse", ['ELYSIAN'] = "Elysian Island", ['GALFISH'] = "Galilee", ['GOLF'] = "GWC and Golfing Society", ['GRAPES'] = "Grapeseed", ['GREATC'] = "Great Chaparral", ['HARMO'] = "Harmony", ['HAWICK'] = "Hawick", ['HORS'] = "Vinewood Racetrack", ['HUMLAB'] = "Humane Labs and Research", ['JAIL'] = "Bolingbroke Penitentiary", ['KOREAT'] = "Little Seoul", ['LACT'] = "Land Act Reservoir", ['LAGO'] = "Lago Zancudo", ['LDAM'] = "Land Act Dam", ['LEGSQU'] = "Legion Square", ['LMESA'] = "La Mesa", ['LOSPUER'] = "La Puerta", ['MIRR'] = "Mirror Park", ['MORN'] = "Morningwood", ['MOVIE'] = "Richards Majestic", ['MTCHIL'] = "Mount Chiliad", ['MTGORDO'] = "Mount Gordo", ['MTJOSE'] = "Mount Josiah", ['MURRI'] = "Murrieta Heights", ['NCHU'] = "North Chumash", ['NOOSE'] = "N.O.O.S.E", ['OCEANA'] = "Pacific Ocean", ['PALCOV'] = "Paleto Cove", ['PALETO'] = "Paleto Bay", ['PALFOR'] = "Paleto Forest", ['PALHIGH'] = "Palomino Highlands", ['PALMPOW'] = "Palmer-Taylor Power Station", ['PBLUFF'] = "Pacific Bluffs", ['PBOX'] = "Pillbox Hill", ['PROCOB'] = "Procopio Beach", ['RANCHO'] = "Rancho", ['RGLEN'] = "Richman Glen", ['RICHM'] = "Richman", ['ROCKF'] = "Rockford Hills", ['RTRAK'] = "Redwood Lights Track", ['SANAND'] = "San Andreas", ['SANCHIA'] = "San Chianski Mountain Range", ['SANDY'] = "Sandy Shores", ['SKID'] = "Mission Row", ['SLAB'] = "Stab City", ['STAD'] = "Maze Bank Arena", ['STRAW'] = "Strawberry", ['TATAMO'] = "Tataviam Mountains", ['TERMINA'] = "Terminal", ['TEXTI'] = "Textile City", ['TONGVAH'] = "Tongva Hills", ['TONGVAV'] = "Tongva Valley", ['VCANA'] = "Vespucci Canals", ['VESP'] = "Vespucci", ['VINE'] = "Vinewood", ['WINDF'] = "Ron Alternates Wind Farm", ['WVINE'] = "West Vinewood", ['ZANCUDO'] = "Zancudo River", ['ZP_ORT'] = "Port of South Los Santos", ['ZQ_UAR'] = "Davis Quartz" } -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} - -local AllWeapons = json.decode('{"melee":{"dagger":"0x92A27487","bat":"0x958A4A8F","bottle":"0xF9E6AA4B","crowbar":"0x84BD7BFD","unarmed":"0xA2719263","flashlight":"0x8BB05FD7","golfclub":"0x440E4788","hammer":"0x4E875F73","hatchet":"0xF9DCBF2D","knuckle":"0xD8DF3C3C","knife":"0x99B507EA","machete":"0xDD5DF8D9","switchblade":"0xDFE37640","nightstick":"0x678B81B1","wrench":"0x19044EE0","battleaxe":"0xCD274149","poolcue":"0x94117305","stone_hatchet":"0x3813FC08"},"handguns":{"pistol":"0x1B06D571","pistol_mk2":"0xBFE256D4","combatpistol":"0x5EF9FEC4","appistol":"0x22D8FE39","stungun":"0x3656C8C1","pistol50":"0x99AEEB3B","snspistol":"0xBFD21232","snspistol_mk2":"0x88374054","heavypistol":"0xD205520E","vintagepistol":"0x83839C4","flaregun":"0x47757124","marksmanpistol":"0xDC4DB296","revolver":"0xC1B3C3D1","revolver_mk2":"0xCB96392F","doubleaction":"0x97EA20B8","raypistol":"0xAF3696A1"},"smg":{"microsmg":"0x13532244","smg":"0x2BE6766B","smg_mk2":"0x78A97CD0","assaultsmg":"0xEFE7E2DF","combatpdw":"0xA3D4D34","machinepistol":"0xDB1AA450","minismg":"0xBD248B55","raycarbine":"0x476BF155"},"shotguns":{"pumpshotgun":"0x1D073A89","pumpshotgun_mk2":"0x555AF99A","sawnoffshotgun":"0x7846A318","assaultshotgun":"0xE284C527","bullpupshotgun":"0x9D61E50F","musket":"0xA89CB99E","heavyshotgun":"0x3AABBBAA","dbshotgun":"0xEF951FBB","autoshotgun":"0x12E82D3D"},"assault_rifles":{"assaultrifle":"0xBFEFFF6D","assaultrifle_mk2":"0x394F415C","carbinerifle":"0x83BF0278","carbinerifle_mk2":"0xFAD1F1C9","advancedrifle":"0xAF113F99","specialcarbine":"0xC0A3098D","specialcarbine_mk2":"0x969C3D67","bullpuprifle":"0x7F229F94","bullpuprifle_mk2":"0x84D6FAFD","compactrifle":"0x624FE830"},"machine_guns":{"mg":"0x9D07F764","combatmg":"0x7FD62962","combatmg_mk2":"0xDBBD7280","gusenberg":"0x61012683"},"sniper_rifles":{"sniperrifle":"0x5FC3C11","heavysniper":"0xC472FE2","heavysniper_mk2":"0xA914799","marksmanrifle":"0xC734385A","marksmanrifle_mk2":"0x6A6C02E0"},"heavy_weapons":{"rpg":"0xB1CA77B1","grenadelauncher":"0xA284510B","grenadelauncher_smoke":"0x4DD2DC56","minigun":"0x42BF8A85","firework":"0x7F7497E5","railgun":"0x6D544C99","hominglauncher":"0x63AB0442","compactlauncher":"0x781FE4A","rayminigun":"0xB62D1F67"},"throwables":{"grenade":"0x93E220BD","bzgas":"0xA0973D5E","smokegrenade":"0xFDBC8A50","flare":"0x497FACC3","molotov":"0x24B17070","stickybomb":"0x2C3731D9","proxmine":"0xAB564B93","snowball":"0x787F0BB","pipebomb":"0xBA45E8B8","ball":"0x23C9F95C"},"misc":{"petrolcan":"0x34A67B97","fireextinguisher":"0x60EC506","parachute":"0xFBAB5776"}}') -local vehiclesCars = {0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20}; - --- Hides TREW UI when it's on Pause Menu -Citizen.CreateThread(function() - - local isPauseMenu = false - - while true do - Citizen.Wait(300) - - if IsPauseMenuActive() then -- ESC Key - if not isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = false }) - end - else - if isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = true }) - end - - HideHudComponentThisFrame(1) -- Wanted Stars - HideHudComponentThisFrame(2) -- Weapon Icon - HideHudComponentThisFrame(3) -- Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(6) -- Vehicle Name - HideHudComponentThisFrame(7) -- Area Name - HideHudComponentThisFrame(8) -- Vehicle Class - HideHudComponentThisFrame(9) -- Street Name - HideHudComponentThisFrame(13) -- Cash Change - HideHudComponentThisFrame(17) -- Save Game - HideHudComponentThisFrame(20) -- Weapon Stats - end - - - end -end) - - --- Date and time update -Citizen.CreateThread(function() - while Config.ui.showDate do - Wait(2000) - SendNUIMessage({ action = 'setText', id = 'date', value = trewDate() }) - end -end) - --- Location update -Citizen.CreateThread(function() - - while Config.ui.showLocation do - Citizen.Wait(200) - local player = PlayerPedId() - local position = GetEntityCoords(player) - local zoneNameFull = zones[GetNameOfZone(position.x, position.y, position.z)] - local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(position.x, position.y, position.z)) - - local locationMessage = nil - - if zoneNameFull then - locationMessage = streetName .. ', ' .. zoneNameFull - else - locationMessage = streetName - end - - locationMessage = string.format( - Locales[Config.Locale]['you_are_on_location'], - locationMessage - ) - - SendNUIMessage({ action = 'setText', id = 'location', value = locationMessage }) - end -end) - - --- Vehicle Info -local vehicleCruiser -local vehicleSignalIndicator = 'off' -local seatbeltEjectSpeed = 45.0 -local seatbeltEjectAccel = 100.0 -local seatbeltIsOn = false -local currSpeed = 0.0 -local prevVelocity = {x = 0.0, y = 0.0, z = 0.0} - -Citizen.CreateThread(function() - while true do - Wait(200) - local player = PlayerPedId() - local vehicle = GetVehiclePedIsIn(player, false) - local position = GetEntityCoords(player) - local vehicleIsOn = GetIsVehicleEngineRunning(vehicle) - local vehicleInfo - if IsPedInAnyVehicle(player, false) and vehicleIsOn then - local vehicleClass = GetVehicleClass(vehicle) - - if not Config.ui.showMinimap then - DisplayRadar(true) - end - - -- Vehicle Speed - local vehicleSpeedSource = GetEntitySpeed(vehicle) - local vehicleSpeed - if Config.vehicle.speedUnit == 'MPH' then - vehicleSpeed = math.ceil(vehicleSpeedSource * 2.237) - else - vehicleSpeed = math.ceil(vehicleSpeedSource * 3.6) - end - - -- Vehicle Gradient Speed - local vehicleNailSpeed - - if vehicleSpeed > Config.vehicle.maxSpeed then - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(Config.vehicle.maxSpeed * 205) / Config.vehicle.maxSpeed) ) - else - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(vehicleSpeed * 205) / Config.vehicle.maxSpeed) ) - end - - -- Vehicle Fuel and Gear - local vehicleFuel - vehicleFuel = GetVehicleFuelLevel(vehicle) - - local vehicleGear = GetVehicleCurrentGear(vehicle) - - if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then - vehicleGear = 'N' - elseif vehicleSpeed > 0 and vehicleGear == 0 then - vehicleGear = 'R' - end - - -- Vehicle Lights - local vehicleVal,vehicleLights,vehicleHighlights = GetVehicleLightsState(vehicle) - local vehicleIsLightsOn - if vehicleLights == 1 and vehicleHighlights == 0 then - vehicleIsLightsOn = 'normal' - elseif (vehicleLights == 1 and vehicleHighlights == 1) or (vehicleLights == 0 and vehicleHighlights == 1) then - vehicleIsLightsOn = 'high' - else - vehicleIsLightsOn = 'off' - end - - -- Vehicle Siren - local vehicleSiren - - if IsVehicleSirenOn(vehicle) then - vehicleSiren = true - else - vehicleSiren = false - end - - -- Vehicle Seatbelt - if has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8 then - - local prevSpeed = currSpeed - currSpeed = vehicleSpeedSource - - SetPedConfigFlag(PlayerPedId(), 32, true) - - if not seatbeltIsOn then - local vehIsMovingFwd = GetEntitySpeedVector(vehicle, true).y > 1.0 - local vehAcc = (prevSpeed - currSpeed) / GetFrameTime() - if (vehIsMovingFwd and (prevSpeed > (seatbeltEjectSpeed/2.237)) and (vehAcc > (seatbeltEjectAccel*9.81))) then - - SetEntityCoords(player, position.x, position.y, position.z - 0.47, true, true, true) - SetEntityVelocity(player, prevVelocity.x, prevVelocity.y, prevVelocity.z) - SetPedToRagdoll(player, 1000, 1000, 0, 0, 0, 0) - else - -- Update previous velocity for ejecting player - prevVelocity = GetEntityVelocity(vehicle) - end - - else - - DisableControlAction(0, 75) - - end - end - - vehicleInfo = { - action = 'updateVehicle', - status = true, - speed = vehicleSpeed, - nail = vehicleNailSpeed, - gear = vehicleGear, - fuel = vehicleFuel, - lights = vehicleIsLightsOn, - signals = vehicleSignalIndicator, - cruiser = vehicleCruiser, - type = vehicleClass, - siren = vehicleSiren, - seatbelt = {}, - - config = { - speedUnit = Config.vehicle.speedUnit, - maxSpeed = Config.vehicle.maxSpeed - } - } - - vehicleInfo['seatbelt']['status'] = seatbeltIsOn - else - vehicleCruiser = false - vehicleNailSpeed = 0 - vehicleSignalIndicator = 'off' - - seatbeltIsOn = false - - vehicleInfo = { - action = 'updateVehicle', - - status = false, - nail = vehicleNailSpeed, - seatbelt = { status = seatbeltIsOn }, - cruiser = vehicleCruiser, - signals = vehicleSignalIndicator, - type = 0, - } - - if Config.ui.showMinimap == false then - DisplayRadar(false) - end - - end - - SendNUIMessage(vehicleInfo) - end -end) - - - - --- Player status -Citizen.CreateThread(function() - - while true do - Citizen.Wait(5000) - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - - if Config.ui.showHealth then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['isdead'] = false - - playerStatus['status'][showPlayerStatus] = { - name = 'health', - value = GetEntityHealth(GetPlayerPed(-1)) - 100 - } - - if IsEntityDead(GetPlayerPed(-1)) then - playerStatus.isdead = true - end - end - - if Config.ui.showArmor then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'armor', - value = GetPedArmour(GetPlayerPed(-1)), - } - end - - if Config.ui.showStamina then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'stamina', - value = 100 - GetPlayerSprintStaminaRemaining(PlayerId()), - } - end - - - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - - TriggerEvent('esx:getSharedObject', function(obj) - ESX = obj - ESX.PlayerData = ESX.GetPlayerData() - end) - - - if ESX.PlayerData.job then - local job - local blackMoney - local bank - local money - - if ESX.PlayerData.job.label == ESX.PlayerData.job.grade_label then - job = ESX.PlayerData.job.grade_label - else - job = ESX.PlayerData.job.label .. ': ' .. ESX.PlayerData.job.grade_label - end - - - for i=1, #ESX.PlayerData.accounts, 1 do - if ESX.PlayerData.accounts[i].name == 'black_money' then - blackMoney = ESX.PlayerData.accounts[i].money - elseif ESX.PlayerData.accounts[i].name == 'bank' then - bank = ESX.PlayerData.accounts[i].money - elseif ESX.PlayerData.accounts[i].name == 'money' then - money = ESX.PlayerData.accounts[i].money - end - end - - SendNUIMessage({ action = 'setText', id = 'job', value = job }) - SendNUIMessage({ action = 'setMoney', id = 'wallet', value = money }) - SendNUIMessage({ action = 'setMoney', id = 'bank', value = bank }) - SendNUIMessage({ action = 'setMoney', id = 'blackMoney', value = blackMoney }) - - if ESX.PlayerData.job.grade_name ~= nil and ESX.PlayerData.job.grade_name == 'boss' then - if (Config.ui.showSocietyMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) - end - ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(money) - SendNUIMessage({ action = 'setMoney', id = 'society', value = money }) - end, ESX.PlayerData.job.name) - else - SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) - end - end - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - - - if Config.ui.showHunger then - showPlayerStatus = (showPlayerStatus+1) - - TriggerEvent('esx_status:getStatus', 'hunger', function(status) - playerStatus['status'][showPlayerStatus] = { - name = 'hunger', - value = math.floor(100-status.getPercent()) - } - end) - - end - - if Config.ui.showThirst then - showPlayerStatus = (showPlayerStatus+1) - - TriggerEvent('esx_status:getStatus', 'thirst', function(status) - playerStatus['status'][showPlayerStatus] = { - name = 'thirst', - value = math.floor(100-status.getPercent()) - } - end) - end - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - end -end) - - --- Voice detection and distance -Citizen.CreateThread(function() - - if Config.ui.showVoice then - - RequestAnimDict('facials@gen_male@variations@normal') - RequestAnimDict('mp_facial') - - while true do - Citizen.Wait(300) - local playerID = PlayerId() - - for _,player in ipairs(GetActivePlayers()) do - local boolTalking = NetworkIsPlayerTalking(player) - - if player ~= playerID then - if boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mic_chatter', 'mp_facial') - elseif not boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mood_normal_1', 'facials@gen_male@variations@normal') - end - end - end - end - - end -end) - - - -Citizen.CreateThread(function() - if Config.ui.showVoice then - local isTalking = false - local voiceDistance = nil - - while true do - Citizen.Wait(1) - - if NetworkIsPlayerTalking(PlayerId()) and not isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - elseif not NetworkIsPlayerTalking(PlayerId()) and isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - end - - - if IsControlJustPressed(1, Keys[Config.voice.keys.distance]) then - Config.voice.levels.current = (Config.voice.levels.current + 1) % 3 - - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - voiceDistance = 'whisper' - end - - SendNUIMessage({ action = 'setVoiceDistance', value = voiceDistance }) - end - - if Config.voice.levels.current == 0 then - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - voiceDistance = 'whisper' - end - end - end -end) - --- Weapons -Citizen.CreateThread(function() - if Config.ui.showWeapons then - while true do - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - local status = {} - - if IsPedArmed(player, 7) then - local weapon = GetSelectedPedWeapon(player) - local ammoTotal = GetAmmoInPedWeapon(player,weapon) - local bool,ammoClip = GetAmmoInClip(player,weapon) - local ammoRemaining = math.floor(ammoTotal - ammoClip) - - status['armed'] = true - - for key,value in pairs(AllWeapons) do - - for keyTwo,valueTwo in pairs(AllWeapons[key]) do - if weapon == GetHashKey('weapon_'..keyTwo) then - status['weapon'] = keyTwo - - - if key == 'melee' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - if keyTwo == 'stungun' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - SendNUIMessage({ action = 'element', task = 'enable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'enable', value = 'bullets' }) - end - end - - end - end - - end - - SendNUIMessage({ action = 'setText', id = 'weapon_clip', value = ammoClip }) - SendNUIMessage({ action = 'setText', id = 'weapon_ammo', value = ammoRemaining }) - - else - status['armed'] = false - end - - SendNUIMessage({ action = 'updateWeapon', status = status }) - - end - end -end) --- Everything that neededs to be at WAIT 0 -Citizen.CreateThread(function() - while true do - Citizen.Wait(0) - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local vehicleClass = GetVehicleClass(vehicle) - - -- Vehicle Seatbelt - if IsPedInAnyVehicle(player, false) and GetIsVehicleEngineRunning(vehicle) then - if IsControlJustReleased(0, Keys[Config.vehicle.keys.seatbelt]) and (has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8) then - seatbeltIsOn = not seatbeltIsOn - end - end - - -- Vehicle Cruiser - if IsControlJustPressed(1, Keys[Config.vehicle.keys.cruiser]) and GetPedInVehicleSeat(vehicle, -1) == player and (has_value(vehiclesCars, vehicleClass) == true) then - - local vehicleSpeedSource = GetEntitySpeed(vehicle) - - if vehicleCruiser == 'on' then - vehicleCruiser = 'off' - SetEntityMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle,"CHandlingData","fInitialDriveMaxFlatVel")) - - else - vehicleCruiser = 'on' - SetEntityMaxSpeed(vehicle, vehicleSpeedSource) - end - end - - -- Vehicle Signal Lights - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalLeft]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'left' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalRight]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'right' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalBoth]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'both' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - end -end) - -AddEventHandler('esx:onPlayerSpawn', function() - SendNUIMessage({ action = 'ui', config = Config.ui }) - SendNUIMessage({ action = 'setFont', url = Config.font.url, name = Config.font.name }) - SendNUIMessage({ action = 'setLogo', value = Config.serverLogo }) - if Config.ui.showVoice then - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - end - end -end) - -AddEventHandler('playerSpawned', function() - if Config.ui.showVoice == true then - NetworkSetTalkerProximity(5.0) - end - HideHudComponentThisFrame(7) -- Area - HideHudComponentThisFrame(9) -- Street - HideHudComponentThisFrame(6) -- Vehicle - HideHudComponentThisFrame(3) -- SP Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(13) -- Cash changes! -end) - -AddEventHandler('trew_hud_ui:setCarSignalLights', function(status) - local driver = GetVehiclePedIsIn(GetPlayerPed(-1), false) - local hasTrailer,vehicleTrailer = GetVehicleTrailerVehicle(driver,vehicleTrailer) - local leftLight - local rightLight - - if status == 'left' then - leftLight = false - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'right' then - leftLight = true - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'both' then - leftLight = true - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - else - leftLight = false - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - end - - TriggerServerEvent('trew_hud_ui:syncCarLights', status) - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) -end) - - - -RegisterNetEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(driver, status) - if GetPlayerFromServerId(driver) ~= PlayerId() then - local driver = GetVehiclePedIsIn(GetPlayerPed(GetPlayerFromServerId(driver)), false) - - if status == 'left' then - leftLight = false - rightLight = true - - elseif status == 'right' then - leftLight = true - rightLight = false - - elseif status == 'both' then - leftLight = true - rightLight = true - - else - leftLight = false - rightLight = false - end - - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) - - end -end) - -function trewDate() - local timeString = nil - local day = _U('day_' .. GetClockDayOfMonth()) - local weekDay = _U('weekDay_' .. GetClockDayOfWeek()) - local month = _U('month_' .. GetClockMonth()) - local day = _U('day_' .. GetClockDayOfMonth()) - local year = GetClockYear() - local hour = GetClockHours() - local minutes = GetClockMinutes() - local time = nil - local AmPm = '' - - - if Config.date.AmPm then - if hour >= 13 and hour <= 24 then - hour = hour - 12 - AmPm = 'PM' - else - if hour == 0 or hour == 24 then - hour = 12 - end - AmPm = 'AM' - end - - end - - if hour <= 9 then - hour = '0' .. hour - end - if minutes <= 9 then - minutes = '0' .. minutes - end - - time = hour .. ':' .. minutes .. ' ' .. AmPm - - - - - local date_format = Locales[Config.Locale]['date_format'][Config.date.format] - - if Config.date.format == 'default' then - timeString = string.format( - date_format, - day, month, year - ) - elseif Config.date.format == 'simple' then - timeString = string.format( - date_format, - day, month - ) - - elseif Config.date.format == 'simpleWithHours' then - timeString = string.format( - date_format, - time, day, month - ) - elseif Config.date.format == 'withWeekday' then - timeString = string.format( - date_format, - weekDay, day, month, year - ) - elseif Config.date.format == 'withHours' then - timeString = string.format( - date_format, - time, day, month, year - ) - elseif Config.date.format == 'withWeekdayAndHours' then - timeString = string.format( - date_format, - time, weekDay, day, month, year - ) - end - - - - - return timeString -end - -function has_value(tab, val) - for index, value in ipairs(tab) do - if value == val then - return true - end - end - - return false -end - -local toggleui = false -RegisterCommand('toggleui', function() - if not toggleui then - SendNUIMessage({ action = 'element', task = 'disable', value = 'job' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bank' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'blackMoney' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'wallet' }) - else - if (Config.ui.showJob == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'job' }) - end - if (Config.ui.showSocietyMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) - end - if (Config.ui.showBankMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'bank' }) - end - if (Config.ui.showBlackMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'blackMoney' }) - end - if (Config.ui.showWalletMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'wallet' }) - end - end - - toggleui = not toggleui -end) - -exports('createStatus', function(args) - local statusCreation = { action = 'createStatus', status = args['status'], color = args['color'], icon = args['icon'] } - SendNUIMessage(statusCreation) -end) - -exports('setStatus', function(args) - local playerStatus = { action = 'setStatus', status = { - { name = args['name'], value = args['value'] } - }} - SendNUIMessage(playerStatus) -end) diff --git a/ESX/trew_hud_ui/client/hansolo.lua b/ESX/trew_hud_ui/client/hansolo.lua deleted file mode 100644 index d3e85c3..0000000 --- a/ESX/trew_hud_ui/client/hansolo.lua +++ /dev/null @@ -1,8 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- - -AddEventHandler('onClientMapStart', function() -end) \ No newline at end of file diff --git a/ESX/trew_hud_ui/html/ui.html b/ESX/trew_hud_ui/html/ui.html deleted file mode 100644 index c1e7b7a..0000000 --- a/ESX/trew_hud_ui/html/ui.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - TREW UI - - - -
- - - - - -
- - -
-
    - - - - - -
-
- -
- - - - -
- - -
- - - - - - - -
- -
- - -
- - - - -
- - - -
- 999 - KM/H -
- - - -
- N -
- - - - - -
-
    -
  • -
  • -
-
- - -
-
    -
  • -
  • -
-
- - - -
- - - - - -
- - - - - - - - - - - - - - -
- -
- - - - - - - -
-
- - -
-
- - - -
- - - - - diff --git a/ESX/trew_hud_ui/readme-en.html b/ESX/trew_hud_ui/readme-en.html deleted file mode 100644 index 9dabd21..0000000 --- a/ESX/trew_hud_ui/readme-en.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - TREW HUD UI - - - - -
-

Trew HUD UI

- -

User Interface created originally for ESX and then adapted for VRP/VRPEX.

- -

Demo

-

- - -

Installation

-
    -
  1. Extract the .zip or Open the .zip.
  2. -
  3. Place trew_hud_ui in your resources directory.
  4. -
  5. Add start trew_hud_ui to your server.cfg
  6. -
- -

Special Instructions for the ESX version

-

Requirements

- - -

Optional

- - -

What you can disable

- - -

Post Installation

-
    -
  • Go to es_extended config.lua and turn Config.EnableHud to false
  • -
  • If needed, go to esx_basicneeds main.lua and replace this code
  • -
-
-			
-	TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
-		return true
-	end, function(status)
-		status.remove(1000)
-	end)
-	
-	TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
-		return true
-	end, function(status)
-		status.remove(750)
-	end)
-			
-		
- -

for this one

- -
-			
-	TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
-		return false
-	end, function(status)
-		status.remove(1000)
-	end)
-	
-	TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
-		return false
-	end, function(status)
-		status.remove(750)
-	end)
-			
-		
- - -

Special Instructions for the VRP/VRPEX versions

- -

- Inside config.lua you will see a Config.vRP with certain items needed to set up properly, like black money. Since black money is considered an item on VRP/VRPEX versions, you need to put the ID of said item on this configuration. On most VRP versions, the ID is dirty_money. -

- -

- Config.vRP
- Special settings for vRP/vRPEX -

-
    -
  • items -
      -
    • blackMoney: The item ID for Black Money.
    • -
    -
  • -
- - -

Config.lua settings

- -

- Config.Locale
- The language. Default is en. -

- -

- Config.serverLogo
- Logo for your server. It’s suggested that you upload a PNG file to websites like imgur.com and then paste the link there. -

- -

- Config.font
- Font configuration for the UI. Default is Montserrat and the link points up to Google Fonts. It’s suggested that you look up for a font there and place the name and the link on it’s location. -

- -
    -
  • name: The name of the font
  • -
  • link: CSS Stylesheet file link for the font
  • -
- -

- Config.date
- Date format for the GPS location. -

- -
    -
  • -

    format:

    -
      -
    • default: It’s the default format;
    • -
    • withWeekDay: Format that shows week day names, like monday, tuesday, wednesday, etc;
    • -
    • withHours: Format that shows the current time in game;
    • -
    • withWeekAndHours: A mix of withWeekDay and withHours.
    • -
    • simple: Format that shows only day and month;
    • -
    • simpleWithHours: Same as simple, but also showing the time.
    • -
    -
  • -
  • -

    AmPm: set it to true if you want to use AM/PM time format, false if you don’t.

    -
  • -
- -

- Config.voice
- Voice settings for the UI. OneSync compatible -

- - -
    -
  • -

    levels:

    -
      -
    • default: Distance in meters for a default distance. Default is 5.0;
    • -
    • shout: Distance in meters for a shout distance. Default is 12.0;
    • -
    • whisper: Distance in meters for a whisper distance. Default is 1.0;
    • -
    • current: It’s important that this is left unchanged.
    • -
    -
  • -
  • -

    keys:

    -
      -
    • distance: Distance in meters for a default distance. Default is HOME.
    • -
    -
  • -
- - -

- Config.vehicle
- Vehicle and speedometer settings -

- -
    -
  • speedUnit: It should be set either KMH or MPH. Default is KMH;
  • -
  • maxSpeed: The top speed the Speedometer is allowed to go. Default is 240;
  • -
  • keys: -
      -
    • seatbelt: Buckle/unbuckle seatbelt. Default is K;
    • -
    • cruiser: Activate/deactivate cruiser speed. Default is CAPS;
    • -
    • signalLeft: Activate/deactivate car left signal. Default is LEFT;
    • -
    • signalRight: Activate/deactivate car right signal. Default is RIGHT;
    • -
    • signalBoth: Activate/deactivate car danger signal. Default is DOWN;
    • -
    -
  • -
- -

- Config.ui
- Display or hide elements of the HUD -

- -
    -
  • showJob: Displays the job name. Default is true;
  • -
  • showWalletMoney: Displays the money on your wallet. Default is true;
  • -
  • showBankMoney: Displays the money on your bank account. Default is true;
  • -
  • showBlackMoney: Displays the black money you have. Default is true;
  • -
  • showSocietyMoney: If you are the boss of a job, it displays the money you have in the society vault. Default is true; (Society money only works on ESX)
  • -
  • showDate: Displays the date. Default is true;
  • -
  • showLocation: Displays the location. Default is true;
  • -
  • showHealth: Displays your health. Default is true;
  • -
  • showArmor: Displays your armor. Default is true;
  • -
  • showStamina: Displays your stamina. Default is true;
  • -
  • showHunger: Displays hunger. Default is true;
  • -
  • showThirst: Displays thirst. Default is true;
  • -
  • showMinimap: Displays the minimap while off the vehicle. Default is false;
  • -
  • showVoice: Displays/use the voice controller. Default is true;
  • -
  • showWeapons: Displays the weapons you have on your hand, with ammo. Default is true;
  • -
- - - -

Adding Custom Status

-

-

- Check by the thirst indicator -

-

- You can create custom indicators for status you already have, like stress status, drunken, shit, piss, you name it! You would just have to use the new exports functions. I would recommend you create a new script with the code and load it below trew_hud_ui on your server.cfg. -

- -


- -

- exports.trew_hud_ui.createStatus
- Creates a new indicator after the existing ones. -

- -

Example:

-
-			
-	local STRESS_ACTIVE = false
-
-	AddEventHandler('playerSpawned', function()
-		
-		if STRESS_ACTIVE == false then
-			exports.trew_hud_ui:createStatus({
-			    status = 'stress',
-			    color = '#FF0090',
-			    icon = '<i class="fas fa-brain"></i>'
-			});
-			STRESS_ACTIVE = true
-		end
-
-	end)
-			
-		
- -

Usage:

-
    -
  • status: The status ID. It's purely to identify it;
  • -
  • color: The color you want for the status;
  • -
  • icon: The HTML code for the icon. You can search on FontAwesome for an icon and when you find one of your liking, change it there.
  • -
- - -


- -

- exports.trew_hud_ui.setStatus
- It is what makes the status update. It should be set on a Wait() timer to update on whenever your custom status is. The example below ticks while getting from a custom status registered on esx_status. -

- -

Example:

-
-			
-	Citizen.CreateThread(function()
-		while true do
-			Citizen.Wait(1000)
-			
-			local STRESS_STATUS
-	
-			TriggerEvent('esx_status:getStatus', 'stress', function(status)
-			    STRESS_STATUS = status.getPercent()
-			end)
-	
-			exports.trew_hud_ui:setStatus({
-			    name = 'stress',
-			    value = STRESS_STATUS
-			});
-		end
-	end)
-			
-		
- -

Usage:

-
    -
  • name: The name of the status. It should be correspondent with the ID when you created it;
  • -
  • value: The percentage value for the status, from 0 to 100.
  • -
- - -

Chat commands

-

- /toggleui
- Enables/Disables HUD information elements, like and job all types money. Useful for streamers. -

-

Usage example: /toggleui

- - -

Donate

-

This HUD is the product of 4 months of work, craft and creativity. While now I'm giving it for free, if you want to help, consider donating any ammount you want to. It will be really appreciated. :)

-
- - - - - -
- -
- - - - - \ No newline at end of file diff --git a/ESX/trew_hud_ui/server/milleniumfalcon.lua b/ESX/trew_hud_ui/server/milleniumfalcon.lua deleted file mode 100644 index 5752dc4..0000000 --- a/ESX/trew_hud_ui/server/milleniumfalcon.lua +++ /dev/null @@ -1,5 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- \ No newline at end of file diff --git a/ESX/trew_hud_ui/server/server.lua b/ESX/trew_hud_ui/server/server.lua deleted file mode 100644 index ea74b70..0000000 --- a/ESX/trew_hud_ui/server/server.lua +++ /dev/null @@ -1,4 +0,0 @@ -RegisterServerEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(status) - TriggerClientEvent('trew_hud_ui:syncCarLights', -1, source, status) -end) diff --git a/LICENSE b/QBCore/qb_trew_hud/LICENSE similarity index 100% rename from LICENSE rename to QBCore/qb_trew_hud/LICENSE diff --git a/QBCore/qb_trew_hud/README.md b/QBCore/qb_trew_hud/README.md new file mode 100644 index 0000000..967ec79 --- /dev/null +++ b/QBCore/qb_trew_hud/README.md @@ -0,0 +1,56 @@ +

[ESX/QB] Trew Hud

2023 Remaster By Mycroft

+ +One of the most, if not **the most**, popular hud for FiveM brought back with a new life - running with 0.03-0.05ms resmon and 2023 Resource support! + +## Major Changes + +```diff ++ PMA Voice Support ++ ESX Legacy Support ++ Rewrote major sections ++ Completely Optimised ++ Better Font ++ Completely Client-Sided ++ Added Player Id to HUD ++ Added QBCore Support (Including Stress and Crypto!) +- Removed Unused Code +- Removed Unused Files +- Removed vRP support +``` + +# Preview + +[![Preview](https://i.imgur.com/kerhT5C.png)](https://streamable.com/rhrrn6) + +## Installation + +1. Extract/Open the .zip. +2. Place `trew_hud-remastered` in your resources directory. +3. Add `ensure trew_hud-remastered` to your server.cfg + +### ESX + +#### Requirements + +- [ESX Legacy](https://github.com/esx-framework/esx_core) +- [ESX Society](https://github.com/esx-framework/esx_society) +- [ESX Addon Account](https://github.com/esx-framework/esx_addonaccount) + +#### Optional + +- [esx_basicneeds](https://github.com/esx-framework/esx_basicneeds) +- [esx_status](https://github.com/esx-framework/esx_status) + +### QBCore + +#### Requirements + +- [QBCore](https://github.com/qbcore-framework/qb-core) +- [qb-management](https://github.com/qbcore-framework/qb-management) + +## Commands + +**/toggleui** +Enables/Disables HUD information elements, like _and job all types money_. Useful for streamers. + +_**Usage example:**_ /toggleui diff --git a/QBCore/qb_trew_hud/client/client.lua b/QBCore/qb_trew_hud/client/client.lua new file mode 100644 index 0000000..4f3a93f --- /dev/null +++ b/QBCore/qb_trew_hud/client/client.lua @@ -0,0 +1,656 @@ +local zones = json.decode('{"HAWICK":"Hawick","ELYSIAN":"Elysian Island","SANDY":"Sandy Shores","DESRT":"Grand Senora Desert","LEGSQU":"Legion Square","MTCHIL":"Mount Chiliad","PALMPOW":"Palmer-Taylor Power Station","CCREAK":"Cassidy Creek","PROL":"North Yankton","PBLUFF":"Pacific Bluffs","MIRR":"Mirror Park","RICHM":"Richman","ZQ_UAR":"Davis Quartz","EAST_V":"East Vinewood","LAGO":"Lago Zancudo","BRADT":"Braddock Tunnel","NCHU":"North Chumash","CYPRE":"Cypress Flats","GALFISH":"Galilee","ZP_ORT":"Port of South Los Santos","PALETO":"Paleto Bay","BURTON":"Burton","GRAPES":"Grapeseed","DELSOL":"La Puerta","ALAMO":"Alamo Sea","DELPE":"Del Perro","ARMYB":"Fort Zancudo","STAD":"Maze Bank Arena","MORN":"Morningwood","CANNY":"Raton Canyon","ISHeist":"Cayo Perico Island","TEXTI":"Textile City","ALTA":"Alta","DTVINE":"Downtown Vinewood","HARMO":"Harmony","MURRI":"Murrieta Heights","KOREAT":"Little Seoul","GALLI":"Galileo Park","DOWNT":"Downtown","ZANCUDO":"Zancudo River","WVINE":"West Vinewood","BAYTRE":"Baytree Canyon","WINDF":"Ron Alternates Wind Farm","VINE":"Vinewood","EBURO":"El Burro Heights","DAVIS":"Davis","STRAW":"Strawberry","TONGVAV":"Tongva Valley","PALHIGH":"Palomino Highlands","TONGVAH":"Tongva Hills","CALAFB":"Calafia Bridge","CHAMH":"Chamberlain Hills","PBOX":"Pillbox Hill","MTJOSE":"Mount Josiah","TERMINA":"Terminal","HUMLAB":"Humane Labs and Research","PALFOR":"Paleto Forest","PALCOV":"Paleto Cove","TATAMO":"Tataviam Mountains","LDAM":"Land Act Dam","MOVIE":"Richards Majestic","VCANA":"Vespucci Canals","HORS":"Vinewood Racetrack","SKID":"Mission Row","CHU":"Chumash","SANCHIA":"San Chianski Mountain Range","CHIL":"Vinewood Hills","ROCKF":"Rockford Hills","RTRAK":"Redwood Lights Track","RGLEN":"Richman Glen","CMSW":"Chiliad Mountain State Wilderness","PROCOB":"Procopio Beach","RANCHO":"Rancho","GREATC":"Great Chaparral","BRADP":"Braddock Pass","ELGORL":"El Gordo Lighthouse","VESP":"Vespucci","OCEANA":"Pacific Ocean","JAIL":"Bolingbroke Penitentiary","OBSERV":"Galileo Observatory","BEACH":"Vespucci Beach","BHAMCA":"Banham Canyon","GOLF":"GWC and Golfing Society","SLAB":"Stab City","LACT":"Land Act Reservoir","LMESA":"La Mesa","DELBE":"Del Perro Beach","BANNING":"Banning","MTGORDO":"Mount Gordo","LOSPUER":"La Puerta","NOOSE":"N.O.O.S.E","AIRP":"Los Santos International Airport"}') +local QBCore = exports['qb-core']:GetCoreObject() +local AllWeapons = json.decode('{"melee":{"dagger":"0x92A27487","bat":"0x958A4A8F","bottle":"0xF9E6AA4B","crowbar":"0x84BD7BFD","unarmed":"0xA2719263","flashlight":"0x8BB05FD7","golfclub":"0x440E4788","hammer":"0x4E875F73","hatchet":"0xF9DCBF2D","knuckle":"0xD8DF3C3C","knife":"0x99B507EA","machete":"0xDD5DF8D9","switchblade":"0xDFE37640","nightstick":"0x678B81B1","wrench":"0x19044EE0","battleaxe":"0xCD274149","poolcue":"0x94117305","stone_hatchet":"0x3813FC08"},"handguns":{"pistol":"0x1B06D571","pistol_mk2":"0xBFE256D4","combatpistol":"0x5EF9FEC4","appistol":"0x22D8FE39","stungun":"0x3656C8C1","pistol50":"0x99AEEB3B","snspistol":"0xBFD21232","snspistol_mk2":"0x88374054","heavypistol":"0xD205520E","vintagepistol":"0x83839C4","flaregun":"0x47757124","marksmanpistol":"0xDC4DB296","revolver":"0xC1B3C3D1","revolver_mk2":"0xCB96392F","doubleaction":"0x97EA20B8","raypistol":"0xAF3696A1"},"smg":{"microsmg":"0x13532244","smg":"0x2BE6766B","smg_mk2":"0x78A97CD0","assaultsmg":"0xEFE7E2DF","combatpdw":"0xA3D4D34","machinepistol":"0xDB1AA450","minismg":"0xBD248B55","raycarbine":"0x476BF155"},"shotguns":{"pumpshotgun":"0x1D073A89","pumpshotgun_mk2":"0x555AF99A","sawnoffshotgun":"0x7846A318","assaultshotgun":"0xE284C527","bullpupshotgun":"0x9D61E50F","musket":"0xA89CB99E","heavyshotgun":"0x3AABBBAA","dbshotgun":"0xEF951FBB","autoshotgun":"0x12E82D3D"},"assault_rifles":{"assaultrifle":"0xBFEFFF6D","assaultrifle_mk2":"0x394F415C","carbinerifle":"0x83BF0278","carbinerifle_mk2":"0xFAD1F1C9","advancedrifle":"0xAF113F99","specialcarbine":"0xC0A3098D","specialcarbine_mk2":"0x969C3D67","bullpuprifle":"0x7F229F94","bullpuprifle_mk2":"0x84D6FAFD","compactrifle":"0x624FE830"},"machine_guns":{"mg":"0x9D07F764","combatmg":"0x7FD62962","combatmg_mk2":"0xDBBD7280","gusenberg":"0x61012683"},"sniper_rifles":{"sniperrifle":"0x5FC3C11","heavysniper":"0xC472FE2","heavysniper_mk2":"0xA914799","marksmanrifle":"0xC734385A","marksmanrifle_mk2":"0x6A6C02E0"},"heavy_weapons":{"rpg":"0xB1CA77B1","grenadelauncher":"0xA284510B","grenadelauncher_smoke":"0x4DD2DC56","minigun":"0x42BF8A85","firework":"0x7F7497E5","railgun":"0x6D544C99","hominglauncher":"0x63AB0442","compactlauncher":"0x781FE4A","rayminigun":"0xB62D1F67"},"throwables":{"grenade":"0x93E220BD","bzgas":"0xA0973D5E","smokegrenade":"0xFDBC8A50","flare":"0x497FACC3","molotov":"0x24B17070","stickybomb":"0x2C3731D9","proxmine":"0xAB564B93","snowball":"0x787F0BB","pipebomb":"0xBA45E8B8","ball":"0x23C9F95C"},"misc":{"petrolcan":"0x34A67B97","fireextinguisher":"0x60EC506","parachute":"0xFBAB5776"}}') +local vehiclesCars = {0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20}; +local isTalking = false +local Playerid = PlayerId() +local ServerId = 0 +function Startup() + ServerId = GetPlayerServerId(Playerid) + SendNUIMessage({ action = 'ui', config = Config.ui }) + SendNUIMessage({ action = 'setFont', url = Config.font.url, name = Config.font.name }) + SendNUIMessage({ action = 'setLogo', value = Config.serverLogo }) + SendNUIMessage({ action = 'setVoiceDistance', value = LocalPlayer.state.proximity and LocalPlayer.state.proximity.mode or "Normal" }) + SendNUIMessage({ action = 'setMoney', id = 'plyId', value = tostring(ServerId) }) +end + +function trewDate() + local timeString = nil + local weekDay = Translate('weekDay_' .. GetClockDayOfWeek()) + local month = Translate('month_' .. GetClockMonth()) + local day = Translate('day_' .. GetClockDayOfMonth()) + local year = GetClockYear() + local hour = GetClockHours() + local minutes = GetClockMinutes() + local time = nil + local AmPm = '' + + + if Config.date.AmPm then + if hour >= 13 and hour <= 24 then + hour = hour - 12 + AmPm = 'PM' + else + if hour == 0 or hour == 24 then + hour = 12 + end + AmPm = 'AM' + end + + end + + if hour <= 9 then + hour = '0' .. hour + end + if minutes <= 9 then + minutes = '0' .. minutes + end + + time = hour .. ':' .. minutes .. ' ' .. AmPm + + local date_format = Locales[Config.Locale]['date_format'][Config.date.format] + + if Config.date.format == 'default' then + timeString = string.format( + date_format, + day, month, year + ) + elseif Config.date.format == 'simple' then + timeString = string.format( + date_format, + day, month + ) + + elseif Config.date.format == 'simpleWithHours' then + timeString = string.format( + date_format, + time, day, month + ) + elseif Config.date.format == 'withWeekday' then + timeString = string.format( + date_format, + weekDay, day, month, year + ) + elseif Config.date.format == 'withHours' then + timeString = string.format( + date_format, + time, day, month, year + ) + elseif Config.date.format == 'withWeekdayAndHours' then + timeString = string.format( + date_format, + time, weekDay, day, month, year + ) + end + + return timeString +end + +function has_value(tab, val) + for index, value in ipairs(tab) do + if value == val then + return true + end + end + + return false +end + + +RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() + Startup() +end) + +-- Vehicle Info +local vehicleCruiser +local vehicleSignalIndicator = 'off' +local seatbeltEjectSpeed = 45.0 +local seatbeltEjectAccel = 100.0 +local seatbeltIsOn = false +local currSpeed = 0.0 +local prevVelocity = {x = 0.0, y = 0.0, z = 0.0} + +-- From ESX Legacy/ESX Infinity +function RegisterInput(command_name, label, input_group, key, on_press) + RegisterCommand(command_name, on_press) + RegisterKeyMapping(command_name, label, input_group, key) + TriggerEvent('chat:removeSuggestion', '/'.. command_name) +end + +CreateThread(function() + Startup() + while not LocalPlayer.state.isLoggedIn do + Wait(0) + end + while true do + Wait(200) + local player = PlayerPedId() + local vehicle = GetVehiclePedIsIn(player, false) + local position = GetEntityCoords(player) + local vehicleIsOn = GetIsVehicleEngineRunning(vehicle) + local vehicleInfo + + if IsPauseMenuActive() then -- ESC Key + if not isPauseMenu then + isPauseMenu = not isPauseMenu + SendNUIMessage({ action = 'toggleUi', value = false }) + end + else + if isPauseMenu then + isPauseMenu = not isPauseMenu + SendNUIMessage({ action = 'toggleUi', value = true }) + end + end + if IsPedInAnyVehicle(player, false) and vehicleIsOn then + local vehicleClass = GetVehicleClass(vehicle) + + if not Config.ui.showMinimapOnFoot and Config.ui.showMinimapInVehicle then + DisplayRadar(true) + end + + -- Vehicle Speed + local vehicleSpeedSource = GetEntitySpeed(vehicle) + local vehicleSpeed + if Config.vehicle.speedUnit == 'MPH' then + vehicleSpeed = math.ceil(vehicleSpeedSource * 2.237) + else + vehicleSpeed = math.ceil(vehicleSpeedSource * 3.6) + end + + -- Vehicle Gradient Speed + local vehicleNailSpeed + + if vehicleSpeed > Config.vehicle.maxSpeed then + vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(Config.vehicle.maxSpeed * 205) / Config.vehicle.maxSpeed) ) + else + vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(vehicleSpeed * 205) / Config.vehicle.maxSpeed) ) + end + + -- Vehicle Fuel and Gear + local vehicleFuel + vehicleFuel = GetVehicleFuelLevel(vehicle) + + local vehicleGear = GetVehicleCurrentGear(vehicle) + + if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then + vehicleGear = 'N' + elseif vehicleSpeed > 0 and vehicleGear == 0 then + vehicleGear = 'R' + end + + -- Vehicle Lights + local vehicleVal,vehicleLights,vehicleHighlights = GetVehicleLightsState(vehicle) + local vehicleIsLightsOn + if vehicleLights == 1 and vehicleHighlights == 0 then + vehicleIsLightsOn = 'normal' + elseif (vehicleLights == 1 and vehicleHighlights == 1) or (vehicleLights == 0 and vehicleHighlights == 1) then + vehicleIsLightsOn = 'high' + else + vehicleIsLightsOn = 'off' + end + + -- Vehicle Siren + local vehicleSiren + + if IsVehicleSirenOn(vehicle) then + vehicleSiren = true + else + vehicleSiren = false + end + + -- Vehicle Seatbelt + if has_value(vehiclesCars, vehicleClass) and vehicleClass ~= 8 then + + local prevSpeed = currSpeed + currSpeed = vehicleSpeedSource + + SetPedConfigFlag(PlayerPedId(), 32, true) + + if not seatbeltIsOn then + local vehIsMovingFwd = GetEntitySpeedVector(vehicle, true).y > 1.0 + local vehAcc = (prevSpeed - currSpeed) / GetFrameTime() + if (vehIsMovingFwd and (prevSpeed > (seatbeltEjectSpeed/2.237)) and (vehAcc > (seatbeltEjectAccel*9.81))) then + + SetEntityCoords(player, position.x, position.y, position.z - 0.47, true, true, true) + SetEntityVelocity(player, prevVelocity.x, prevVelocity.y, prevVelocity.z) + SetPedToRagdoll(player, 1000, 1000, 0, 0, 0, 0) + else + -- Update previous velocity for ejecting player + prevVelocity = GetEntityVelocity(vehicle) + end + + else + + DisableControlAction(0, 75) + + end + end + + vehicleInfo = { + action = 'updateVehicle', + status = true, + speed = vehicleSpeed, + nail = vehicleNailSpeed, + gear = vehicleGear, + fuel = vehicleFuel, + lights = vehicleIsLightsOn, + signals = vehicleSignalIndicator, + cruiser = vehicleCruiser, + type = vehicleClass, + siren = vehicleSiren, + seatbelt = {}, + + config = { + speedUnit = Config.vehicle.speedUnit, + maxSpeed = Config.vehicle.maxSpeed + } + } + + vehicleInfo['seatbelt']['status'] = seatbeltIsOn + else + vehicleCruiser = false + vehicleNailSpeed = 0 + vehicleSignalIndicator = 'off' + + seatbeltIsOn = false + + vehicleInfo = { + action = 'updateVehicle', + + status = false, + nail = vehicleNailSpeed, + seatbelt = { status = seatbeltIsOn }, + cruiser = vehicleCruiser, + signals = vehicleSignalIndicator, + type = 0, + } + + if not Config.ui.showMinimapOnFoot then + DisplayRadar(false) + end + + end + + SendNUIMessage(vehicleInfo) + + if Config.ui.showLocation then + local player = PlayerPedId() + local position = GetEntityCoords(player) + local zoneNameFull = zones[GetNameOfZone(position.x, position.y, position.z)] + local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(position.x, position.y, position.z)) + + local locationMessage = nil + + if zoneNameFull then + locationMessage = streetName .. ', ' .. zoneNameFull + else + locationMessage = streetName + end + + locationMessage = string.format( + Locales[Config.Locale]['you_are_on_location'], + locationMessage + ) + + SendNUIMessage({ action = 'setText', id = 'location', value = locationMessage }) + end + + if Config.ui.showVoice then + if NetworkIsPlayerTalking(Playerid) and not isTalking then + isTalking = not isTalking + SendNUIMessage({ action = 'isTalking', value = isTalking }) + elseif not NetworkIsPlayerTalking(Playerid) and isTalking then + isTalking = not isTalking + SendNUIMessage({ action = 'isTalking', value = isTalking }) + end + end + end +end) + +CreateThread(function() + while not LocalPlayer.state.isLoggedIn do + Wait(0) + end + while true do + Wait(2000) + local PlayerData = QBCore.Functions.GetPlayerData() + local playerStatus + local showPlayerStatus = 0 + playerStatus = { action = 'setStatus', status = {} } + + if Config.ui.showHealth then + showPlayerStatus = (showPlayerStatus+1) + + playerStatus.isdead = IsPedDeadOrDying(PlayerPedId(), true) + + playerStatus['status'][showPlayerStatus] = { + name = 'health', + value = GetEntityHealth(PlayerPedId()) - 100 + } + + end + + if Config.ui.showDate then + SendNUIMessage({ action = 'setText', id = 'date', value = trewDate() }) + end + + if Config.ui.showArmor then + showPlayerStatus = (showPlayerStatus+1) + + playerStatus['status'][showPlayerStatus] = { + name = 'armor', + value = GetPedArmour(PlayerPedId()), + } + end + + if Config.ui.showStamina then + showPlayerStatus = (showPlayerStatus+1) + + playerStatus['status'][showPlayerStatus] = { + name = 'stamina', + value = 100 - GetPlayerSprintStaminaRemaining(Playerid), + } + end + + if showPlayerStatus > 0 then + SendNUIMessage(playerStatus) + end + + if PlayerData and PlayerData.job then + local job + local Crypto = PlayerData.money.crypto + local bank = PlayerData.money.bank + local money = PlayerData.money.cash + + if PlayerData.job.label == PlayerData.job.grade.name then + job = PlayerData.job.grade.name + else + job = PlayerData.job.label .. ': ' .. PlayerData.job.grade.name + end + + SendNUIMessage({ action = 'setText', id = 'job', value = job }) + SendNUIMessage({ action = 'setMoney', id = 'wallet', value = money }) + SendNUIMessage({ action = 'setMoney', id = 'bank', value = bank }) + SendNUIMessage({ action = 'setMoney', id = 'blackMoney', value = Crypto }) + + if PlayerData.job.isboss then + if (Config.ui.showSocietyMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) + end + QBCore.Functions.TriggerCallback('qb-bossmenu:server:GetAccount', function(cb) + SendNUIMessage({ action = 'setMoney', id = 'society', value = tostring(cb) }) + end, PlayerData.job.name) + else + SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) + end + end + + local playerStatus + local showPlayerStatus = 0 + playerStatus = { action = 'setStatus', status = {} } + + if Config.ui.showHunger then + showPlayerStatus = (showPlayerStatus+1) + playerStatus['status'][showPlayerStatus] = { + name = 'hunger', + value = math.floor(PlayerData.metadata["hunger"]) + } + end + + if Config.ui.showThirst then + showPlayerStatus = (showPlayerStatus+1) + playerStatus['status'][showPlayerStatus] = { + name = 'thirst', + value = math.floor(PlayerData.metadata["thirst"]) + } + end + + if Config.ui.showStress then + showPlayerStatus = (showPlayerStatus+1) + playerStatus['status'][showPlayerStatus] = { + name = 'stress', + value = math.floor(PlayerData.metadata["stress"] > 1 and (PlayerData.metadata["stress"] / PlayerData.metadata["stress"]) * 100 or 1) + } + end + + if showPlayerStatus > 0 then + SendNUIMessage(playerStatus) + end + + if Config.ui.showVoice then + AddEventHandler('pma-voice:setTalkingMode', function() + SendNUIMessage({ action = 'setVoiceDistance', value = LocalPlayer.state.proximity and LocalPlayer.state.proximity.mode or "Normal" }) + end) + end + end +end) + +-- Weapons +if Config.ui.showWeapons then + CreateThread(function() + while not LocalPlayer.state.isLoggedIn do + Wait(0) + end + while true do + local Sleep = 800 + + local player = PlayerPedId() + local status = {} + + if IsPedArmed(player, 7) then + Sleep = 100 + local weapon = GetSelectedPedWeapon(player) + local ammoTotal = GetAmmoInPedWeapon(player,weapon) + local bool,ammoClip = GetAmmoInClip(player,weapon) + local ammoRemaining = math.floor(ammoTotal - ammoClip) + + status['armed'] = true + + for key,value in pairs(AllWeapons) do + + for keyTwo,valueTwo in pairs(AllWeapons[key]) do + if weapon == joaat('weapon_'..keyTwo) then + status['weapon'] = keyTwo + + + if key == 'melee' then + SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) + else + if keyTwo == 'stungun' then + SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) + else + SendNUIMessage({ action = 'element', task = 'enable', value = 'weapon_bullets' }) + SendNUIMessage({ action = 'element', task = 'enable', value = 'bullets' }) + end + end + + end + end + + end + + SendNUIMessage({ action = 'setText', id = 'weapon_clip', value = ammoClip }) + SendNUIMessage({ action = 'setText', id = 'weapon_ammo', value = ammoRemaining }) + + else + if status['armed'] then + status['armed'] = false + SendNUIMessage({ action = 'updateWeapon', status = status }) + end + end + + SendNUIMessage({ action = 'updateWeapon', status = status }) + Wait(Sleep) + end + end) +end + +RegisterInput("cruise", "Cruise Control", "keyboard", Config.vehicle.keys.cruiser, function() + local player = PlayerPedId() + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleSpeedSource = GetEntitySpeed(vehicle) + if GetPedInVehicleSeat(vehicle, -1) ~= player then + return + end + if vehicleCruiser == 'on' then + vehicleCruiser = 'off' + SetEntityMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle,"CHandlingData","fInitialDriveMaxFlatVel")) + + else + vehicleCruiser = 'on' + SetEntityMaxSpeed(vehicle, vehicleSpeedSource) + end +end) + +RegisterInput("seatbelt", "Seatbelt", "keyboard", Config.vehicle.keys.seatbelt, function() + local player = PlayerPedId() + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if not (IsPedInAnyVehicle(player, false) and GetIsVehicleEngineRunning(vehicle)) then + return + end + if has_value(vehiclesCars, vehicleClass) ~= true and vehicleClass == 8 then + return + end + seatbeltIsOn = not seatbeltIsOn +end) + +RegisterInput("leftindicator", "Left Indicator", "keyboard", Config.vehicle.keys.signalLeft, function() + local player = PlayerPedId() + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if has_value(vehiclesCars, vehicleClass) ~= true then + return + end + if vehicleSignalIndicator == 'off' then + vehicleSignalIndicator = 'left' + else + vehicleSignalIndicator = 'off' + end + + TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) +end) + +RegisterInput("rightindicator", "Right Indicator", "keyboard", Config.vehicle.keys.signalRight, function() + local player = PlayerPedId() + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if has_value(vehiclesCars, vehicleClass) ~= true then + return + end + if vehicleSignalIndicator == 'off' then + vehicleSignalIndicator = 'right' + else + vehicleSignalIndicator = 'off' + end + + TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) +end) + +RegisterInput("bothindicator", "Both Indicators", "keyboard", Config.vehicle.keys.signalBoth, function() + local player = PlayerPedId() + local vehicle = GetVehiclePedIsIn(player, false) + local vehicleClass = GetVehicleClass(vehicle) + if has_value(vehiclesCars, vehicleClass) ~= true then + return + end + if vehicleSignalIndicator == 'off' then + vehicleSignalIndicator = 'both' + else + vehicleSignalIndicator = 'off' + end + + TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) +end) + +AddEventHandler('trew_hud_ui:setCarSignalLights', function(status) + local driver = GetVehiclePedIsIn(PlayerPedId(), false) + local hasTrailer,vehicleTrailer = GetVehicleTrailerVehicle(driver) + local leftLight + local rightLight + + if status == 'left' then + leftLight = false + rightLight = true + if hasTrailer then driver = vehicleTrailer end + elseif status == 'right' then + leftLight = true + rightLight = false + if hasTrailer then driver = vehicleTrailer end + + elseif status == 'both' then + leftLight = true + rightLight = true + if hasTrailer then driver = vehicleTrailer end + else + leftLight = false + rightLight = false + if hasTrailer then driver = vehicleTrailer end + end + + SetVehicleIndicatorLights(driver, 0, leftLight) + SetVehicleIndicatorLights(driver, 1, rightLight) +end) + +local toggleui = false +RegisterCommand('toggleui', function() + if not toggleui then + SendNUIMessage({ action = 'element', task = 'disable', value = 'job' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'bank' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'blackMoney' }) + SendNUIMessage({ action = 'element', task = 'disable', value = 'wallet' }) + else + if (Config.ui.showJob) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'job' }) + end + if (Config.ui.showSocietyMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) + end + if (Config.ui.showBankMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'bank' }) + end + if (Config.ui.showCrypto) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'blackMoney' }) + end + if (Config.ui.showWalletMoney) then + SendNUIMessage({ action = 'element', task = 'enable', value = 'wallet' }) + end + end + + toggleui = not toggleui +end) + +exports('createStatus', function(args) + local statusCreation = { action = 'createStatus', status = args['status'], color = args['color'], icon = args['icon'] } + SendNUIMessage(statusCreation) +end) + +exports('setStatus', function(args) + local playerStatus = { action = 'setStatus', status = { + { name = args['name'], value = args['value'] } + }} + SendNUIMessage(playerStatus) +end) + +if Config.ui.showMinimapHealth then + Citizen.CreateThread(function() + local minimap = RequestScaleformMovie("minimap") + SetBigmapActive(true, false) + Wait(0) + SetBigmapActive(false, false) + while true do + local Sleep = 500 + if not IsRadarHidden() then + Sleep = 0 + BeginScaleformMovieMethod(minimap, "SETUP_HEALTH_ARMOUR") + ScaleformMovieMethodAddParamInt(3) + EndScaleformMovieMethod() + end + Wait(Sleep) + end + + end) +end \ No newline at end of file diff --git a/ESX/trew_hud_ui/config.lua b/QBCore/qb_trew_hud/config.lua similarity index 56% rename from ESX/trew_hud_ui/config.lua rename to QBCore/qb_trew_hud/config.lua index ae1c909..d807abb 100644 --- a/ESX/trew_hud_ui/config.lua +++ b/QBCore/qb_trew_hud/config.lua @@ -1,12 +1,12 @@ Config = {} -Config.Locale = 'br' +Config.Locale = 'en' -Config.serverLogo = 'https://i.imgur.com/AcgDL9f.png' +Config.serverLogo = 'https://i.imgur.com/9a3Tj94.png' Config.font = { - name = 'Montserrat', - url = 'https://fonts.googleapis.com/css?family=Montserrat:300,400,700,900&display=swap' + name = 'Signika Negative', + url = 'https://fonts.googleapis.com/css2?family=Signika+Negative&display=swap' } Config.date = { @@ -14,24 +14,9 @@ Config.date = { AmPm = false } -Config.voice = { - - levels = { - default = 5.0, - shout = 12.0, - whisper = 1.0, - current = 0 - }, - - keys = { - distance = '~', - } -} - - Config.vehicle = { - speedUnit = 'KMH', - maxSpeed = 240, + speedUnit = 'MPH', + maxSpeed = 180, keys = { seatbelt = 'K', @@ -43,13 +28,13 @@ Config.vehicle = { } Config.ui = { - showServerLogo = true, + showServerLogo = false, showJob = true, showWalletMoney = true, showBankMoney = true, - showBlackMoney = true, + showCrypto = false, showSocietyMoney = true, showDate = true, @@ -61,8 +46,12 @@ Config.ui = { showStamina = true, showHunger = true, showThirst = true, + showStress = true, + showID = true, - showMinimap = false, + showMinimapOnFoot = false, + showMinimapInVehicle = true, + showMinimapHealth = false, showWeapons = true, } \ No newline at end of file diff --git a/ESX/trew_hud_ui/fxmanifest.lua b/QBCore/qb_trew_hud/fxmanifest.lua similarity index 92% rename from ESX/trew_hud_ui/fxmanifest.lua rename to QBCore/qb_trew_hud/fxmanifest.lua index 8bc556f..bb02edb 100644 --- a/ESX/trew_hud_ui/fxmanifest.lua +++ b/QBCore/qb_trew_hud/fxmanifest.lua @@ -4,7 +4,8 @@ game 'gta5' description 'Trew HUD UI' -version '1.3.0' +version '2.0.1' +lua54 'yes' ui_page 'html/ui.html' @@ -119,26 +120,17 @@ files { 'html/sounds/car-indicators.ogg', } -client_scripts { - '@es_extended/locale.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/es.lua', +shared_scripts { + 'translation.lua', + 'locales/*.lua', 'config.lua', - 'client/client.lua', - 'client/hansolo.lua' } -server_scripts { - '@es_extended/locale.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/es.lua', - 'config.lua', - 'server/server.lua', - 'server/milleniumfalcon.lua' +client_scripts { + 'client/client.lua', } dependencies { - 'es_extended' + 'qb-core', + 'qb-management' } diff --git a/ESX/trew_hud_ui/html/app.js b/QBCore/qb_trew_hud/html/app.js similarity index 96% rename from ESX/trew_hud_ui/html/app.js rename to QBCore/qb_trew_hud/html/app.js index bd90754..8a2235e 100644 --- a/ESX/trew_hud_ui/html/app.js +++ b/QBCore/qb_trew_hud/html/app.js @@ -1,496 +1,498 @@ -function rgba(hex,opacity){ - hex = hex.replace('#',''); - redColor = parseInt(hex.substring(0,2), 16); - greenColor = parseInt(hex.substring(2,4), 16); - blueColor = parseInt(hex.substring(4,6), 16); - - result = 'rgba('+redColor+','+greenColor+','+blueColor+','+opacity/100+')'; - return result; -} - -var loadJS = function(url, implementationCode, location) { - var scriptTag = document.createElement('script'); - scriptTag.src = url; - - scriptTag.onload = implementationCode; - scriptTag.onreadystatechange = implementationCode; - - location.appendChild(scriptTag); -}; - - - -function ajaxio(method,url,type=null,data=null) { - return new Promise((resolve, reject) => { - const req = new XMLHttpRequest(); - req.open(method, url, true); - - if (method == 'POST') { - if (type == 'json' && data != null) { - req.setRequestHeader('Content-Type', 'application/json'); - var data = JSON.stringify(data); - } - else { req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } - } - - req.onload = () => req.status === 200 ? resolve(req.response) : reject(Error(req.statusText)); - req.onerror = (e) => reject(Error(`Network Error: ${e}`)); - - if (method == 'POST') { req.send(data); } - else { req.send(); } - }); -} - - -Object.prototype.addMultiListener = function(eventNames, listener) { - var events = eventNames.split(' '); - - if (NodeList.prototype.isPrototypeOf(this) == true) { - for (var x=0, xLen=this.length; x'; - - - if (document.getElementById(statusID)) { } - else { - var newStatus = document.createElement('li'); - newStatus.classList.add('icon', 'customstatus'); - newStatus.id = statusID; - - motherStatus.insertBefore(newStatus, motherStatus.firstChild); - - saferInnerHTML(document.getElementById(statusID), statusIcon); - } - }, - - - setStatus: function(data) { - - if (data.isdead == true) { - if (document.querySelector('#health').classList.contains('dead') == false) { - document.querySelector('#health').classList.add('dead'); - for (i = 0; i < data.status.length; i++) { document.querySelector('#'+data.status[i].name+' span').style.height = '0'; } - } - } - else { - for (i = 0; i < data.status.length; i++) { - if ((data.status[i].name == 'hunger') || (data.status[i].name == 'thirst')) { var statusValue = Math.floor(100 - data.status[i].value); } - else { var statusValue = Math.floor(data.status[i].value); } - if (document.querySelector('#'+data.status[i].name+' span')) { document.querySelector('#'+data.status[i].name+' span').style.height = statusValue+'%'; } - if (statusValue <= 35) { - if (document.querySelector('#'+data.status[i].name)) { - if (document.querySelector('#'+data.status[i].name).classList.contains('dying') == false) { - document.querySelector('#'+data.status[i].name).classList.add('dying'); - } - } - } - else { - if (document.querySelector('#'+data.status[i].name)) { document.querySelector('#'+data.status[i].name).classList.remove('dying'); } - - } - } - if (document.querySelector('#health').classList.contains('dead')) { document.querySelector('#health').classList.remove('dead'); } - } - }, - - - updateWeapon: function(data) { - var weaponContainer = document.querySelector('#weapon'); - var bulletsContainer = document.querySelector('#bullets'); - - if (data.status.armed == true) { - - var oldWeapon = document.querySelector('#weapon_image img').src; - var newWeapon = 'img/weapons/'+data.status.weapon+'.png'; - if (oldWeapon != newWeapon) { document.querySelector('#weapon_image img').src = newWeapon; } - - if (weaponContainer.classList.contains('armed') == false) { - weaponContainer.classList.remove('unarmed', 'fadeOut'); - weaponContainer.classList.add('armed', 'fadeIn'); - } - - } - else { - - if (weaponContainer.classList.contains('unarmed') == false) { - weaponContainer.classList.remove('armed', 'fadeIn'); - weaponContainer.classList.add('unarmed', 'fadeOut'); - } - - } - }, - - - - - - - updateVehicle: function(data) { - - var vehicleInfo = document.querySelector('.info.vehicle'); - var vehicleSeatbelt = document.querySelector('#seatbelt'); - var vehicleLights = document.querySelector('#lights'); - var vehicleSignals = document.querySelector('#signals'); - var vehicleFuel = document.querySelector('#fuel'); - var vehicleCruiser = document.querySelector('#vehicle-speed strong'); - var vehiclesCars = [0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20]; - - if (data.status == true) { - if (vehicleInfo.classList.contains('inactive')) { - - vehicleSeatbelt.style.display = 'none'; - vehicleLights.style.display = 'none'; - vehicleSignals.style.display = 'none'; - vehicleFuel.style.display = 'none'; - - if (vehiclesCars.indexOf(data.type) > -1) { - document.querySelector('#vehicle-others').style.display = 'none'; - document.querySelector('#vehicle-gear').style.display = 'block'; - - vehicleSeatbelt.style.display = 'block'; - vehicleLights.style.display = 'block'; - vehicleSignals.style.display = 'block'; - vehicleFuel.style.display = 'block'; - - document.querySelector('#vehicle-gear').style.display = 'block'; - } - - else { - document.querySelector('#vehicle-others').style.display = 'block'; - document.querySelector('#vehicle-gear').style.display = 'none'; - document.querySelector('#vehicle-others i').classList.remove('fa-biking', 'fa-helicopter', 'fa-ship'); - - if (data.type == 13) { document.querySelector('#vehicle-others i').classList.add('fa-biking'); } - else if (data.type == 14) { document.querySelector('#vehicle-others i').classList.add('fa-ship'); } - else if (data.type == 15) { document.querySelector('#vehicle-others i').classList.add('fa-helicopter'); } - else if (data.type == 16) { document.querySelector('#vehicle-others i').classList.add('fa-plane'); } - else if (data.type == 21) { document.querySelector('#vehicle-others i').classList.add('fa-train'); } - } - - vehicleInfo.classList.remove('inactive'); - vehicleInfo.classList.add('active', 'fadeIn'); - } - - if (vehicleInfo.classList.contains('updated') == false) { - - var vehicleSpeedUnit = data.config.speedUnit.slice(0,2)+'/'+data.config.speedUnit.slice(-1); - var vehicleAverageSpeed = Math.ceil(data.config.maxSpeed / 6); - - vehicleInfo.classList.add('updated'); - saferInnerHTML(vehicleCruiser,vehicleSpeedUnit); - - } - - - - - var previousGear = document.querySelector('#vehicle-gear span').innerHTML; - var currentGear = data.gear; - if (previousGear != currentGear) { document.querySelector('#vehicle-gear').classList.add('pulse') } - saferInnerHTML(document.querySelector('#vehicle-gear span'), data.gear); - - - - - - - var speedometerCircle = document.querySelector('#progress-speed svg circle.speed'); - var speedPercentage = Math.floor(Math.floor(data.speed*100)/data.config.maxSpeed); - - speedometerCircle.classList.remove('zero'); - speedometerCircle.classList.remove('twentyfive'); - speedometerCircle.classList.remove('fifty'); - speedometerCircle.classList.remove('seventyfive'); - - if (speedPercentage >= 0 && speedPercentage <= 25) { speedometerCircle.classList.add('zero'); } - else if (speedPercentage > 25 && speedPercentage <= 50) { speedometerCircle.classList.add('twentyfive'); } - else if (speedPercentage > 50 && speedPercentage <= 75) { speedometerCircle.classList.add('fifty'); } - else if (speedPercentage > 75) { speedometerCircle.classList.add('seventyfive'); } - - document.querySelector('#progress-speed svg circle.speed').style.strokeDashoffset = data.nail; - saferInnerHTML(document.querySelector('#vehicle-speed span'), data.speed); - - - - - - - - - if ( (data.seatbelt.status == true) && (vehicleSeatbelt.classList.contains('on') == false) ) { - vehicleSeatbelt.classList.remove('off'); - vehicleSeatbelt.classList.add('on'); - - eventCallback.sound('sounds/seatbelt-buckle.ogg', { volume: '0.50' }); - } - else if ( (data.seatbelt.status == false) && (vehicleSeatbelt.classList.contains('off') == false) ) { - vehicleSeatbelt.classList.remove('on'); - vehicleSeatbelt.classList.add('off'); - - eventCallback.sound('sounds/seatbelt-unbuckle.ogg', { volume: '0.50' }); - } - - - - - - - - - - - if (vehicleCruiser.classList.contains(data.cruiser) == false) { - vehicleCruiser.classList.remove('on','off'); - vehicleCruiser.classList.add(data.cruiser); - } - - - - - if (data.siren == true) { document.querySelector('#vehicle-gear').classList.add('pulsing'); } - else { document.querySelector('#vehicle-gear').classList.remove('pulsing'); } - - - - - - - if (vehicleLights.classList.contains(data.lights) == false) { - vehicleLights.classList.remove('normal','high','off'); - vehicleLights.classList.add(data.lights); - - if (data.lights == 'high') { vehicleLights.querySelector('i img').src = 'img/vehicle-lights-high.png'; } - else { vehicleLights.querySelector('i img').src = 'img/vehicle-lights.png'; } - } - - - - - - - - - - - if (vehicleSignals.classList.contains(data.signals) == false) { - - vehicleSignals.querySelector('i').className = 'fa fa-arrows-alt-h'; - vehicleSignals.classList.remove('left','right','both','off'); - - if ( (data.signals == 'left') || (data.signals == 'right') || (data.signals == 'both') ) { - - var classSignal = 'fa-long-arrow-alt-'+data.signals; - if (data.signals == 'both') { classSignal = 'fa-arrows-alt-h'; } - - vehicleSignals.querySelector('i').classList.add('fas',classSignal); - vehicleSignals.classList.add(data.signals, 'dying'); - - eventCallback.sound('sounds/car-indicators.ogg', { loop: 'loop' }); - } - - else if (data.signals == 'off') { - vehicleSignals.querySelector('i').classList.add('fas','fa-arrows-alt-h'); - vehicleSignals.classList.remove('dying'); - vehicleSignals.classList.add(data.signals); - - eventCallback.sound(); - } - - - } - - - - - - - - - - - - - vehicleFuel.querySelector('span').style.height = data.fuel+'%'; - - if (data.fuel <= 35) { - if (vehicleFuel.classList.contains('dying') == false) { vehicleFuel.classList.add('dying'); } - } - else { vehicleFuel.classList.remove('dying'); } - - } - else { - if (vehicleInfo.classList.contains('active')) { - vehicleSeatbelt.classList.remove('on'); - vehicleCruiser.classList.remove('on'); - - vehicleInfo.classList.remove('active'); - vehicleInfo.classList.add('inactive', 'fadeOut'); - - eventCallback.sound(); - } - - } - - }, - - toggleUi: function(data) { - var uiID = document.querySelector('#ui'); - if (data.value == true) { - uiID.style.display = 'block'; - } - else { - uiID.style.display = 'none'; - } - }, - - sound: function(file = null, args = null) { - var sound = document.querySelector('#sounds'); - var soundFile = file; - var args = args; - - for (i = 0; i < sound.attributes.length; i++) { - if (sound.attributes[i].name != 'id') { sound.removeAttribute(sound.attributes[i].name); } - } - - if (soundFile == null) { sound.setAttribute('src', ''); } - else { - if (args == null) { } - else { - for (var key in args) { - if (key != 'addMultiListener') { - if (key == 'volume') { sound.volume = args[key]; } - else { sound.setAttribute(key, args[key]); } - } - } - } - - sound.setAttribute('src', soundFile); - sound.play(); - } - - - }, - - - - - - - - - - - - - - - - - - - - - - - - - - }; - - document.querySelectorAll('.icon i').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { this.parentElement.classList.remove('pulse'); this.parentElement.classList.remove('shooting'); }); - - document.querySelectorAll('.info.vehicle').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { - this.classList.remove('fadeOut', 'fadeIn'); - }); - - - - window.addEventListener('message', function(event) { - eventCallback[event.data.action](event.data); - }); - +function rgba(hex,opacity){ + hex = hex.replace('#',''); + redColor = parseInt(hex.substring(0,2), 16); + greenColor = parseInt(hex.substring(2,4), 16); + blueColor = parseInt(hex.substring(4,6), 16); + + result = 'rgba('+redColor+','+greenColor+','+blueColor+','+opacity/100+')'; + return result; +} + +var loadJS = function(url, implementationCode, location) { + var scriptTag = document.createElement('script'); + scriptTag.src = url; + + scriptTag.onload = implementationCode; + scriptTag.onreadystatechange = implementationCode; + + location.appendChild(scriptTag); +}; + + + +function ajaxio(method,url,type=null,data=null) { + return new Promise((resolve, reject) => { + const req = new XMLHttpRequest(); + req.open(method, url, true); + + if (method == 'POST') { + if (type == 'json' && data != null) { + req.setRequestHeader('Content-Type', 'application/json'); + var data = JSON.stringify(data); + } + else { req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } + } + + req.onload = () => req.status === 200 ? resolve(req.response) : reject(Error(req.statusText)); + req.onerror = (e) => reject(Error(`Network Error: ${e}`)); + + if (method == 'POST') { req.send(data); } + else { req.send(); } + }); +} + + +Object.prototype.addMultiListener = function(eventNames, listener) { + var events = eventNames.split(' '); + + if (NodeList.prototype.isPrototypeOf(this) == true) { + for (var x=0, xLen=this.length; x'; + + + if (document.getElementById(statusID)) { } + else { + var newStatus = document.createElement('li'); + newStatus.classList.add('icon', 'customstatus'); + newStatus.id = statusID; + + motherStatus.insertBefore(newStatus, motherStatus.firstChild); + + saferInnerHTML(document.getElementById(statusID), statusIcon); + } + }, + + + setStatus: function(data) { + + if (data.isdead == true) { + if (document.querySelector('#health').classList.contains('dead') == false) { + document.querySelector('#health').classList.add('dead'); + for (i = 0; i < data.status.length; i++) { document.querySelector('#'+data.status[i].name+' span').style.height = '0'; } + } + } + else { + for (i = 0; i < data.status.length; i++) { + if ((data.status[i].name == 'hunger') || (data.status[i].name == 'thirst')) { var statusValue = Math.floor(100 - data.status[i].value); } + else { var statusValue = Math.floor(data.status[i].value); } + if (document.querySelector('#'+data.status[i].name+' span')) { document.querySelector('#'+data.status[i].name+' span').style.height = statusValue+'%'; } + if (statusValue <= 35) { + if (document.querySelector('#'+data.status[i].name)) { + if (document.querySelector('#'+data.status[i].name).classList.contains('dying') == false) { + document.querySelector('#'+data.status[i].name).classList.add('dying'); + } + } + } + else { + if (document.querySelector('#'+data.status[i].name)) { document.querySelector('#'+data.status[i].name).classList.remove('dying'); } + + } + } + if (document.querySelector('#health').classList.contains('dead')) { document.querySelector('#health').classList.remove('dead'); } + } + }, + + + updateWeapon: function(data) { + var weaponContainer = document.querySelector('#weapon'); + var bulletsContainer = document.querySelector('#bullets'); + + if (data.status.armed == true) { + + var oldWeapon = document.querySelector('#weapon_image img').src; + var newWeapon = 'img/weapons/'+data.status.weapon+'.png'; + if (oldWeapon != newWeapon) { document.querySelector('#weapon_image img').src = newWeapon; } + + if (weaponContainer.classList.contains('armed') == false) { + weaponContainer.classList.remove('unarmed', 'fadeOut'); + weaponContainer.classList.add('armed', 'fadeIn'); + } + + } + else { + + if (weaponContainer.classList.contains('unarmed') == false) { + weaponContainer.classList.remove('armed', 'fadeIn'); + weaponContainer.classList.add('unarmed', 'fadeOut'); + } + + } + }, + + + + + + + updateVehicle: function(data) { + + var vehicleInfo = document.querySelector('.info.vehicle'); + var vehicleSeatbelt = document.querySelector('#seatbelt'); + var vehicleLights = document.querySelector('#lights'); + var vehicleSignals = document.querySelector('#signals'); + var vehicleFuel = document.querySelector('#fuel'); + var vehicleCruiser = document.querySelector('#vehicle-speed strong'); + var vehiclesCars = [0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20]; + + if (data.status == true) { + if (vehicleInfo.classList.contains('inactive')) { + + vehicleSeatbelt.style.display = 'none'; + vehicleLights.style.display = 'none'; + vehicleSignals.style.display = 'none'; + vehicleFuel.style.display = 'none'; + + if (vehiclesCars.indexOf(data.type) > -1) { + document.querySelector('#vehicle-others').style.display = 'none'; + document.querySelector('#vehicle-gear').style.display = 'block'; + + vehicleSeatbelt.style.display = 'block'; + vehicleLights.style.display = 'block'; + vehicleSignals.style.display = 'block'; + vehicleFuel.style.display = 'block'; + + document.querySelector('#vehicle-gear').style.display = 'block'; + } + + else { + document.querySelector('#vehicle-others').style.display = 'block'; + document.querySelector('#vehicle-gear').style.display = 'none'; + document.querySelector('#vehicle-others i').classList.remove('fa-biking', 'fa-helicopter', 'fa-ship'); + + if (data.type == 13) { document.querySelector('#vehicle-others i').classList.add('fa-biking'); } + else if (data.type == 14) { document.querySelector('#vehicle-others i').classList.add('fa-ship'); } + else if (data.type == 15) { document.querySelector('#vehicle-others i').classList.add('fa-helicopter'); } + else if (data.type == 16) { document.querySelector('#vehicle-others i').classList.add('fa-plane'); } + else if (data.type == 21) { document.querySelector('#vehicle-others i').classList.add('fa-train'); } + } + + vehicleInfo.classList.remove('inactive'); + vehicleInfo.classList.add('active', 'fadeIn'); + } + + if (vehicleInfo.classList.contains('updated') == false) { + + var vehicleSpeedUnit = data.config.speedUnit.slice(0,2)+'/'+data.config.speedUnit.slice(-1); + var vehicleAverageSpeed = Math.ceil(data.config.maxSpeed / 6); + + vehicleInfo.classList.add('updated'); + saferInnerHTML(vehicleCruiser,vehicleSpeedUnit); + + } + + + + + var previousGear = document.querySelector('#vehicle-gear span').innerHTML; + var currentGear = data.gear; + if (previousGear != currentGear) { document.querySelector('#vehicle-gear').classList.add('pulse') } + saferInnerHTML(document.querySelector('#vehicle-gear span'), data.gear); + + + + + + + var speedometerCircle = document.querySelector('#progress-speed svg circle.speed'); + var speedPercentage = Math.floor(Math.floor(data.speed*100)/data.config.maxSpeed); + + speedometerCircle.classList.remove('zero'); + speedometerCircle.classList.remove('twentyfive'); + speedometerCircle.classList.remove('fifty'); + speedometerCircle.classList.remove('seventyfive'); + + if (speedPercentage >= 0 && speedPercentage <= 25) { speedometerCircle.classList.add('zero'); } + else if (speedPercentage > 25 && speedPercentage <= 50) { speedometerCircle.classList.add('twentyfive'); } + else if (speedPercentage > 50 && speedPercentage <= 75) { speedometerCircle.classList.add('fifty'); } + else if (speedPercentage > 75) { speedometerCircle.classList.add('seventyfive'); } + + document.querySelector('#progress-speed svg circle.speed').style.strokeDashoffset = data.nail; + saferInnerHTML(document.querySelector('#vehicle-speed span'), data.speed); + + + + + + + + + if ( (data.seatbelt.status == true) && (vehicleSeatbelt.classList.contains('on') == false) ) { + vehicleSeatbelt.classList.remove('off'); + vehicleSeatbelt.classList.add('on'); + + eventCallback.sound('sounds/seatbelt-buckle.ogg', { volume: '0.50' }); + } + else if ( (data.seatbelt.status == false) && (vehicleSeatbelt.classList.contains('off') == false) ) { + vehicleSeatbelt.classList.remove('on'); + vehicleSeatbelt.classList.add('off'); + + eventCallback.sound('sounds/seatbelt-unbuckle.ogg', { volume: '0.50' }); + } + + + + + + + + + + + if (vehicleCruiser.classList.contains(data.cruiser) == false) { + vehicleCruiser.classList.remove('on','off'); + vehicleCruiser.classList.add(data.cruiser); + } + + + + + if (data.siren == true) { document.querySelector('#vehicle-gear').classList.add('pulsing'); } + else { document.querySelector('#vehicle-gear').classList.remove('pulsing'); } + + + + + + + if (vehicleLights.classList.contains(data.lights) == false) { + vehicleLights.classList.remove('normal','high','off'); + vehicleLights.classList.add(data.lights); + + if (data.lights == 'high') { vehicleLights.querySelector('i img').src = 'img/vehicle-lights-high.png'; } + else { vehicleLights.querySelector('i img').src = 'img/vehicle-lights.png'; } + } + + + + + + + + + + + if (vehicleSignals.classList.contains(data.signals) == false) { + + vehicleSignals.querySelector('i').className = 'fa fa-arrows-alt-h'; + vehicleSignals.classList.remove('left','right','both','off'); + + if ( (data.signals == 'left') || (data.signals == 'right') || (data.signals == 'both') ) { + + var classSignal = 'fa-long-arrow-alt-'+data.signals; + if (data.signals == 'both') { classSignal = 'fa-arrows-alt-h'; } + + vehicleSignals.querySelector('i').classList.add('fas',classSignal); + vehicleSignals.classList.add(data.signals, 'dying'); + + eventCallback.sound('sounds/car-indicators.ogg', { loop: 'loop' }); + } + + else if (data.signals == 'off') { + vehicleSignals.querySelector('i').classList.add('fas','fa-arrows-alt-h'); + vehicleSignals.classList.remove('dying'); + vehicleSignals.classList.add(data.signals); + + eventCallback.sound(); + } + + + } + + + + + + + + + + + + + vehicleFuel.querySelector('span').style.height = data.fuel+'%'; + + if (data.fuel <= 35) { + if (vehicleFuel.classList.contains('dying') == false) { vehicleFuel.classList.add('dying'); } + } + else { vehicleFuel.classList.remove('dying'); } + + } + else { + if (vehicleInfo.classList.contains('active')) { + vehicleSeatbelt.classList.remove('on'); + vehicleCruiser.classList.remove('on'); + + vehicleInfo.classList.remove('active'); + vehicleInfo.classList.add('inactive', 'fadeOut'); + + eventCallback.sound(); + } + + } + + }, + + toggleUi: function(data) { + var uiID = document.querySelector('#ui'); + if (data.value == true) { + uiID.style.display = 'block'; + } + else { + uiID.style.display = 'none'; + } + }, + + sound: function(file = null, args = null) { + var sound = document.querySelector('#sounds'); + var soundFile = file; + var args = args; + + for (i = 0; i < sound.attributes.length; i++) { + if (sound.attributes[i].name != 'id') { sound.removeAttribute(sound.attributes[i].name); } + } + + if (soundFile == null) { sound.setAttribute('src', ''); } + else { + if (args == null) { } + else { + for (var key in args) { + if (key != 'addMultiListener') { + if (key == 'volume') { sound.volume = args[key]; } + else { sound.setAttribute(key, args[key]); } + } + } + } + + sound.setAttribute('src', soundFile); + sound.play(); + } + + + }, + + + + + + + + + + + + + + + + + + + + + + + + + + }; + + document.querySelectorAll('.icon i').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { this.parentElement.classList.remove('pulse'); this.parentElement.classList.remove('shooting'); }); + + document.querySelectorAll('.info.vehicle').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { + this.classList.remove('fadeOut', 'fadeIn'); + }); + + + + window.addEventListener('message', function(event) { + eventCallback[event.data.action](event.data); + }); + } \ No newline at end of file diff --git a/VRP/trew_hud_ui/html/img/vehicle-gear.png b/QBCore/qb_trew_hud/html/img/vehicle-gear.png similarity index 100% rename from VRP/trew_hud_ui/html/img/vehicle-gear.png rename to QBCore/qb_trew_hud/html/img/vehicle-gear.png diff --git a/VRP/trew_hud_ui/html/img/vehicle-lights-high.png b/QBCore/qb_trew_hud/html/img/vehicle-lights-high.png similarity index 100% rename from VRP/trew_hud_ui/html/img/vehicle-lights-high.png rename to QBCore/qb_trew_hud/html/img/vehicle-lights-high.png diff --git a/VRP/trew_hud_ui/html/img/vehicle-lights.png b/QBCore/qb_trew_hud/html/img/vehicle-lights.png similarity index 100% rename from VRP/trew_hud_ui/html/img/vehicle-lights.png rename to QBCore/qb_trew_hud/html/img/vehicle-lights.png diff --git a/VRP/trew_hud_ui/html/img/vehicle-seatbelt.png b/QBCore/qb_trew_hud/html/img/vehicle-seatbelt.png similarity index 100% rename from VRP/trew_hud_ui/html/img/vehicle-seatbelt.png rename to QBCore/qb_trew_hud/html/img/vehicle-seatbelt.png diff --git a/VRP/trew_hud_ui/html/img/weapon-bullets.png b/QBCore/qb_trew_hud/html/img/weapon-bullets.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapon-bullets.png rename to QBCore/qb_trew_hud/html/img/weapon-bullets.png diff --git a/VRP/trew_hud_ui/html/img/weapons/advancedrifle.png b/QBCore/qb_trew_hud/html/img/weapons/advancedrifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/advancedrifle.png rename to QBCore/qb_trew_hud/html/img/weapons/advancedrifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/appistol.png b/QBCore/qb_trew_hud/html/img/weapons/appistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/appistol.png rename to QBCore/qb_trew_hud/html/img/weapons/appistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/assaultrifle.png b/QBCore/qb_trew_hud/html/img/weapons/assaultrifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/assaultrifle.png rename to QBCore/qb_trew_hud/html/img/weapons/assaultrifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/assaultrifle_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/assaultrifle_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/assaultshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/assaultshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/assaultshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/assaultshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/assaultsmg.png b/QBCore/qb_trew_hud/html/img/weapons/assaultsmg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/assaultsmg.png rename to QBCore/qb_trew_hud/html/img/weapons/assaultsmg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/autoshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/autoshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/autoshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/autoshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/ball.png b/QBCore/qb_trew_hud/html/img/weapons/ball.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/ball.png rename to QBCore/qb_trew_hud/html/img/weapons/ball.png diff --git a/VRP/trew_hud_ui/html/img/weapons/bat.png b/QBCore/qb_trew_hud/html/img/weapons/bat.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/bat.png rename to QBCore/qb_trew_hud/html/img/weapons/bat.png diff --git a/VRP/trew_hud_ui/html/img/weapons/battleaxe.png b/QBCore/qb_trew_hud/html/img/weapons/battleaxe.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/battleaxe.png rename to QBCore/qb_trew_hud/html/img/weapons/battleaxe.png diff --git a/VRP/trew_hud_ui/html/img/weapons/bottle.png b/QBCore/qb_trew_hud/html/img/weapons/bottle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/bottle.png rename to QBCore/qb_trew_hud/html/img/weapons/bottle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/bullpuprifle.png b/QBCore/qb_trew_hud/html/img/weapons/bullpuprifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/bullpuprifle.png rename to QBCore/qb_trew_hud/html/img/weapons/bullpuprifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/bullpuprifle_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/bullpuprifle_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/bullpupshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/bullpupshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/bullpupshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/bullpupshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/bzgas.png b/QBCore/qb_trew_hud/html/img/weapons/bzgas.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/bzgas.png rename to QBCore/qb_trew_hud/html/img/weapons/bzgas.png diff --git a/VRP/trew_hud_ui/html/img/weapons/carbinerifle.png b/QBCore/qb_trew_hud/html/img/weapons/carbinerifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/carbinerifle.png rename to QBCore/qb_trew_hud/html/img/weapons/carbinerifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/carbinerifle_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/carbinerifle_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/combatmg.png b/QBCore/qb_trew_hud/html/img/weapons/combatmg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/combatmg.png rename to QBCore/qb_trew_hud/html/img/weapons/combatmg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/combatmg_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/combatmg_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/combatmg_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/combatmg_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/combatpdw.png b/QBCore/qb_trew_hud/html/img/weapons/combatpdw.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/combatpdw.png rename to QBCore/qb_trew_hud/html/img/weapons/combatpdw.png diff --git a/VRP/trew_hud_ui/html/img/weapons/combatpistol.png b/QBCore/qb_trew_hud/html/img/weapons/combatpistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/combatpistol.png rename to QBCore/qb_trew_hud/html/img/weapons/combatpistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/compactlauncher.png b/QBCore/qb_trew_hud/html/img/weapons/compactlauncher.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/compactlauncher.png rename to QBCore/qb_trew_hud/html/img/weapons/compactlauncher.png diff --git a/VRP/trew_hud_ui/html/img/weapons/compactrifle.png b/QBCore/qb_trew_hud/html/img/weapons/compactrifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/compactrifle.png rename to QBCore/qb_trew_hud/html/img/weapons/compactrifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/crowbar.png b/QBCore/qb_trew_hud/html/img/weapons/crowbar.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/crowbar.png rename to QBCore/qb_trew_hud/html/img/weapons/crowbar.png diff --git a/VRP/trew_hud_ui/html/img/weapons/dagger.png b/QBCore/qb_trew_hud/html/img/weapons/dagger.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/dagger.png rename to QBCore/qb_trew_hud/html/img/weapons/dagger.png diff --git a/VRP/trew_hud_ui/html/img/weapons/dbshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/dbshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/dbshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/dbshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/doubleaction.png b/QBCore/qb_trew_hud/html/img/weapons/doubleaction.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/doubleaction.png rename to QBCore/qb_trew_hud/html/img/weapons/doubleaction.png diff --git a/VRP/trew_hud_ui/html/img/weapons/firework.png b/QBCore/qb_trew_hud/html/img/weapons/firework.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/firework.png rename to QBCore/qb_trew_hud/html/img/weapons/firework.png diff --git a/VRP/trew_hud_ui/html/img/weapons/flare.png b/QBCore/qb_trew_hud/html/img/weapons/flare.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/flare.png rename to QBCore/qb_trew_hud/html/img/weapons/flare.png diff --git a/VRP/trew_hud_ui/html/img/weapons/flaregun.png b/QBCore/qb_trew_hud/html/img/weapons/flaregun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/flaregun.png rename to QBCore/qb_trew_hud/html/img/weapons/flaregun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/flashlight.png b/QBCore/qb_trew_hud/html/img/weapons/flashlight.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/flashlight.png rename to QBCore/qb_trew_hud/html/img/weapons/flashlight.png diff --git a/VRP/trew_hud_ui/html/img/weapons/golfclub.png b/QBCore/qb_trew_hud/html/img/weapons/golfclub.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/golfclub.png rename to QBCore/qb_trew_hud/html/img/weapons/golfclub.png diff --git a/VRP/trew_hud_ui/html/img/weapons/grenade.png b/QBCore/qb_trew_hud/html/img/weapons/grenade.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/grenade.png rename to QBCore/qb_trew_hud/html/img/weapons/grenade.png diff --git a/VRP/trew_hud_ui/html/img/weapons/grenadelauncher.png b/QBCore/qb_trew_hud/html/img/weapons/grenadelauncher.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/grenadelauncher.png rename to QBCore/qb_trew_hud/html/img/weapons/grenadelauncher.png diff --git a/VRP/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png b/QBCore/qb_trew_hud/html/img/weapons/grenadelauncher_smoke.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png rename to QBCore/qb_trew_hud/html/img/weapons/grenadelauncher_smoke.png diff --git a/VRP/trew_hud_ui/html/img/weapons/gusenberg.png b/QBCore/qb_trew_hud/html/img/weapons/gusenberg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/gusenberg.png rename to QBCore/qb_trew_hud/html/img/weapons/gusenberg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/hammer.png b/QBCore/qb_trew_hud/html/img/weapons/hammer.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/hammer.png rename to QBCore/qb_trew_hud/html/img/weapons/hammer.png diff --git a/VRP/trew_hud_ui/html/img/weapons/hatchet.png b/QBCore/qb_trew_hud/html/img/weapons/hatchet.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/hatchet.png rename to QBCore/qb_trew_hud/html/img/weapons/hatchet.png diff --git a/VRP/trew_hud_ui/html/img/weapons/heavypistol.png b/QBCore/qb_trew_hud/html/img/weapons/heavypistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/heavypistol.png rename to QBCore/qb_trew_hud/html/img/weapons/heavypistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/heavyshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/heavyshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/heavyshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/heavyshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/heavysniper.png b/QBCore/qb_trew_hud/html/img/weapons/heavysniper.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/heavysniper.png rename to QBCore/qb_trew_hud/html/img/weapons/heavysniper.png diff --git a/VRP/trew_hud_ui/html/img/weapons/heavysniper_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/heavysniper_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/heavysniper_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/heavysniper_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/hominglauncher.png b/QBCore/qb_trew_hud/html/img/weapons/hominglauncher.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/hominglauncher.png rename to QBCore/qb_trew_hud/html/img/weapons/hominglauncher.png diff --git a/VRP/trew_hud_ui/html/img/weapons/knife.png b/QBCore/qb_trew_hud/html/img/weapons/knife.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/knife.png rename to QBCore/qb_trew_hud/html/img/weapons/knife.png diff --git a/VRP/trew_hud_ui/html/img/weapons/knuckle.png b/QBCore/qb_trew_hud/html/img/weapons/knuckle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/knuckle.png rename to QBCore/qb_trew_hud/html/img/weapons/knuckle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/machete.png b/QBCore/qb_trew_hud/html/img/weapons/machete.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/machete.png rename to QBCore/qb_trew_hud/html/img/weapons/machete.png diff --git a/VRP/trew_hud_ui/html/img/weapons/machinepistol.png b/QBCore/qb_trew_hud/html/img/weapons/machinepistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/machinepistol.png rename to QBCore/qb_trew_hud/html/img/weapons/machinepistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/marksmanpistol.png b/QBCore/qb_trew_hud/html/img/weapons/marksmanpistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/marksmanpistol.png rename to QBCore/qb_trew_hud/html/img/weapons/marksmanpistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/marksmanrifle.png b/QBCore/qb_trew_hud/html/img/weapons/marksmanrifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/marksmanrifle.png rename to QBCore/qb_trew_hud/html/img/weapons/marksmanrifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/marksmanrifle_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/marksmanrifle_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/mg.png b/QBCore/qb_trew_hud/html/img/weapons/mg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/mg.png rename to QBCore/qb_trew_hud/html/img/weapons/mg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/microsmg.png b/QBCore/qb_trew_hud/html/img/weapons/microsmg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/microsmg.png rename to QBCore/qb_trew_hud/html/img/weapons/microsmg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/minigun.png b/QBCore/qb_trew_hud/html/img/weapons/minigun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/minigun.png rename to QBCore/qb_trew_hud/html/img/weapons/minigun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/minismg.png b/QBCore/qb_trew_hud/html/img/weapons/minismg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/minismg.png rename to QBCore/qb_trew_hud/html/img/weapons/minismg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/molotov.png b/QBCore/qb_trew_hud/html/img/weapons/molotov.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/molotov.png rename to QBCore/qb_trew_hud/html/img/weapons/molotov.png diff --git a/VRP/trew_hud_ui/html/img/weapons/musket.png b/QBCore/qb_trew_hud/html/img/weapons/musket.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/musket.png rename to QBCore/qb_trew_hud/html/img/weapons/musket.png diff --git a/VRP/trew_hud_ui/html/img/weapons/nightstick.png b/QBCore/qb_trew_hud/html/img/weapons/nightstick.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/nightstick.png rename to QBCore/qb_trew_hud/html/img/weapons/nightstick.png diff --git a/VRP/trew_hud_ui/html/img/weapons/petrolcan.png b/QBCore/qb_trew_hud/html/img/weapons/petrolcan.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/petrolcan.png rename to QBCore/qb_trew_hud/html/img/weapons/petrolcan.png diff --git a/VRP/trew_hud_ui/html/img/weapons/pipebomb.png b/QBCore/qb_trew_hud/html/img/weapons/pipebomb.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/pipebomb.png rename to QBCore/qb_trew_hud/html/img/weapons/pipebomb.png diff --git a/VRP/trew_hud_ui/html/img/weapons/pistol.png b/QBCore/qb_trew_hud/html/img/weapons/pistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/pistol.png rename to QBCore/qb_trew_hud/html/img/weapons/pistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/pistol50.png b/QBCore/qb_trew_hud/html/img/weapons/pistol50.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/pistol50.png rename to QBCore/qb_trew_hud/html/img/weapons/pistol50.png diff --git a/VRP/trew_hud_ui/html/img/weapons/pistol_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/pistol_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/pistol_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/pistol_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/poolcue.png b/QBCore/qb_trew_hud/html/img/weapons/poolcue.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/poolcue.png rename to QBCore/qb_trew_hud/html/img/weapons/poolcue.png diff --git a/VRP/trew_hud_ui/html/img/weapons/proxmine.png b/QBCore/qb_trew_hud/html/img/weapons/proxmine.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/proxmine.png rename to QBCore/qb_trew_hud/html/img/weapons/proxmine.png diff --git a/VRP/trew_hud_ui/html/img/weapons/pumpshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/pumpshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/pumpshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/pumpshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/pumpshotgun_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/pumpshotgun_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/railgun.png b/QBCore/qb_trew_hud/html/img/weapons/railgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/railgun.png rename to QBCore/qb_trew_hud/html/img/weapons/railgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/raycarbine.png b/QBCore/qb_trew_hud/html/img/weapons/raycarbine.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/raycarbine.png rename to QBCore/qb_trew_hud/html/img/weapons/raycarbine.png diff --git a/VRP/trew_hud_ui/html/img/weapons/rayminigun.png b/QBCore/qb_trew_hud/html/img/weapons/rayminigun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/rayminigun.png rename to QBCore/qb_trew_hud/html/img/weapons/rayminigun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/raypistol.png b/QBCore/qb_trew_hud/html/img/weapons/raypistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/raypistol.png rename to QBCore/qb_trew_hud/html/img/weapons/raypistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/revolver.png b/QBCore/qb_trew_hud/html/img/weapons/revolver.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/revolver.png rename to QBCore/qb_trew_hud/html/img/weapons/revolver.png diff --git a/VRP/trew_hud_ui/html/img/weapons/revolver_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/revolver_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/revolver_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/revolver_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/rpg.png b/QBCore/qb_trew_hud/html/img/weapons/rpg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/rpg.png rename to QBCore/qb_trew_hud/html/img/weapons/rpg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/sawnoffshotgun.png b/QBCore/qb_trew_hud/html/img/weapons/sawnoffshotgun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/sawnoffshotgun.png rename to QBCore/qb_trew_hud/html/img/weapons/sawnoffshotgun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/smg.png b/QBCore/qb_trew_hud/html/img/weapons/smg.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/smg.png rename to QBCore/qb_trew_hud/html/img/weapons/smg.png diff --git a/VRP/trew_hud_ui/html/img/weapons/smg_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/smg_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/smg_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/smg_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/smokegrenade.png b/QBCore/qb_trew_hud/html/img/weapons/smokegrenade.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/smokegrenade.png rename to QBCore/qb_trew_hud/html/img/weapons/smokegrenade.png diff --git a/VRP/trew_hud_ui/html/img/weapons/sniperrifle.png b/QBCore/qb_trew_hud/html/img/weapons/sniperrifle.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/sniperrifle.png rename to QBCore/qb_trew_hud/html/img/weapons/sniperrifle.png diff --git a/VRP/trew_hud_ui/html/img/weapons/snowball.png b/QBCore/qb_trew_hud/html/img/weapons/snowball.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/snowball.png rename to QBCore/qb_trew_hud/html/img/weapons/snowball.png diff --git a/VRP/trew_hud_ui/html/img/weapons/snspistol.png b/QBCore/qb_trew_hud/html/img/weapons/snspistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/snspistol.png rename to QBCore/qb_trew_hud/html/img/weapons/snspistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/snspistol_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/snspistol_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/snspistol_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/snspistol_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/specialcarbine.png b/QBCore/qb_trew_hud/html/img/weapons/specialcarbine.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/specialcarbine.png rename to QBCore/qb_trew_hud/html/img/weapons/specialcarbine.png diff --git a/VRP/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png b/QBCore/qb_trew_hud/html/img/weapons/specialcarbine_mk2.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png rename to QBCore/qb_trew_hud/html/img/weapons/specialcarbine_mk2.png diff --git a/VRP/trew_hud_ui/html/img/weapons/stickybomb.png b/QBCore/qb_trew_hud/html/img/weapons/stickybomb.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/stickybomb.png rename to QBCore/qb_trew_hud/html/img/weapons/stickybomb.png diff --git a/VRP/trew_hud_ui/html/img/weapons/stone_hatchet.png b/QBCore/qb_trew_hud/html/img/weapons/stone_hatchet.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/stone_hatchet.png rename to QBCore/qb_trew_hud/html/img/weapons/stone_hatchet.png diff --git a/VRP/trew_hud_ui/html/img/weapons/stungun.png b/QBCore/qb_trew_hud/html/img/weapons/stungun.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/stungun.png rename to QBCore/qb_trew_hud/html/img/weapons/stungun.png diff --git a/VRP/trew_hud_ui/html/img/weapons/switchblade.png b/QBCore/qb_trew_hud/html/img/weapons/switchblade.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/switchblade.png rename to QBCore/qb_trew_hud/html/img/weapons/switchblade.png diff --git a/VRP/trew_hud_ui/html/img/weapons/unarmed.png b/QBCore/qb_trew_hud/html/img/weapons/unarmed.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/unarmed.png rename to QBCore/qb_trew_hud/html/img/weapons/unarmed.png diff --git a/VRP/trew_hud_ui/html/img/weapons/vintagepistol.png b/QBCore/qb_trew_hud/html/img/weapons/vintagepistol.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/vintagepistol.png rename to QBCore/qb_trew_hud/html/img/weapons/vintagepistol.png diff --git a/VRP/trew_hud_ui/html/img/weapons/wrench.png b/QBCore/qb_trew_hud/html/img/weapons/wrench.png similarity index 100% rename from VRP/trew_hud_ui/html/img/weapons/wrench.png rename to QBCore/qb_trew_hud/html/img/weapons/wrench.png diff --git a/ESX/trew_hud_ui/html/main.css b/QBCore/qb_trew_hud/html/main.css similarity index 97% rename from ESX/trew_hud_ui/html/main.css rename to QBCore/qb_trew_hud/html/main.css index 0f9bb65..ab9e045 100644 --- a/ESX/trew_hud_ui/html/main.css +++ b/QBCore/qb_trew_hud/html/main.css @@ -1,234 +1,235 @@ -*, *:before, *:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - - margin: 0; - padding: 0; -} - -body,html { width: 100%; height: 100%; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - -} - -body { /*background: url('https://i.imgur.com/MoYBh1e.jpg') center center no-repeat; background-size: cover;*/ } - -#ui { position: relative; width: 100%; height: 100%; overflow: hidden; } -div.separator { display: block; clear: both; width: 100%; } - - - - -.icon { display: block; position: relative; padding: 10px 8px; margin: 10px 5px 0 5px; width: 30px; height: 30px; border-radius: 100px; overflow: hidden; background: rgba(0,0,0,0.35); } - -.icon i { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #FFF; z-index: 11; font-size: 15px; } -.icon img { width: 16px; margin: -3px 0 0 0; } -.icon span { display: block; position: absolute; left: 50%; bottom: 0; transform: translate(-50%,0); width: 100%; height: 100%; } - -.icon.text { display: inline-block; overflow: visible; width: auto; padding: 0; } -.icon.text i { display: inline-block; float: left; transform: translate(0%,0%); left: 0; top: 0; position: relative; padding: 10px 8px; width: 30px; height: 30px; border-radius: 100px; color: #FFF; } -.icon.text i:before { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); } -.icon.text span { position: relative; width: auto; height: auto; left: 0; transform: translate(0,0); display: inline-block; font-size: 12px; padding: 7px 15px 0 10px; font-weight: 700; color: #FFF; } - - -.icon.dying:not(.customstatus) span { animation: trew-status-blink 500ms infinite; } -.icon.pulse i { animation: trew-pulse 500ms 1; } - - - - -.info { position: absolute; } - -.info.server { top: 45px; right: 26px; width: 90px; height: 90px; } -.info.server #server img { max-width: 100%; opacity: 0.75; } - -.info.player { top: 140px; right: 25px; text-align: right;} -.info.player #job span { font-size: 24px; color: #FFF; font-weight: 900; text-transform: uppercase; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } - - - - - -.info.player #money div[id] { float: right; } - -.info.player #money { clear: both; } -.info.player #money #wallet i { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.player #money #blackMoney i { background: linear-gradient(180deg, #474747 0%, #252525 100%); } -.info.player #money #bank i { background: linear-gradient(180deg, #c70a0a 0%, #960505 100%); } -.info.player #money #society i { background: linear-gradient(180deg, #874c14 0%, #6a3c10 100%); } - -/*.info.player #money #wallet i:before { content: '\f153'; }*/ - - -.info.player #status { clear: both; } -.info.player #status ul { margin: 10px 0 0 0; } -.info.player #status ul li { float: right;} -.info.player #status ul li#health span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.player #status ul li#armor span { background: linear-gradient(180deg, #0bcfe6 0%, #0aa3b5 100%); } -.info.player #status ul li#stamina span { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } -.info.player #status ul li#hunger span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } -.info.player #status ul li#thirst span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } -.info.player #status ul li#health.dead { animation: trew-pulse 500ms infinite; } -.info.player #status ul li#health.dead span { height: 0 !important; } -.info.player #status ul li#health.dead i.fas:before { content: '\f714'; } - -.info.vehicle { bottom: 20px; left: 50%; transform: translate(-50%,0); z-index: 11; } -.info.vehicle.active { opacity: 1; } -.info.vehicle.inactive { opacity: 0; } - - -.info.vehicle #speedometer { position: relative; width: 270px; height: 130px; } -.info.vehicle #speedometer svg { position: absolute; top: 0; left: 50%; transform: translate(-50%,0) rotate(138deg); width: 130px; } - -.info.vehicle #speedometer svg circle { display: block; fill: transparent; stroke-width: 5px; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 75; transform-origin: 50% 50%; } -.info.vehicle #speedometer svg circle.mask { stroke: rgba(0,0,0,0.35); } -.info.vehicle #speedometer svg circle.speed { stroke: url(#speed-gradient); stroke-dashoffset: 180; } -.info.vehicle #speedometer svg:first-child { z-index: 11; } - - -.info.vehicle #speedometer svg circle { transition: all 250ms linear; } -.info.vehicle #speedometer svg circle.zero { stroke: #00c3ff; stroke-dashoffset: 235; } -.info.vehicle #speedometer svg circle.twentyfive { stroke: #18b70b; stroke-dashoffset: 180; } -.info.vehicle #speedometer svg circle.fifty { stroke: #ff8000; stroke-dashoffset: 125; } -.info.vehicle #speedometer svg circle.seventyfive { stroke: #ff0000; stroke-dashoffset: 75; } - - -.info.vehicle #speedometer #vehicle-speed { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; color: #FFF;} -.info.vehicle #speedometer #vehicle-speed span { display: block; font-weight: 900; font-size: 30px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } - - .info.vehicle #speedometer #vehicle-speed strong { display: inline-block; font-size: 10px; font-weight: 900; padding: 2px 5px; border-radius: 100px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); transition: all 150ms linear; } - .info.vehicle #speedometer #vehicle-speed strong.on { background: #18b70b; } - -.info.vehicle #speedometer #vehicle-gear, -.info.vehicle #speedometer #vehicle-others { position: absolute; bottom: 0; left: 50%; width: 69px; transform: translate(-50%,0); margin: auto; border: 2px solid transparent; } - -.info.vehicle #speedometer #vehicle-gear.pulsing { animation: trew-siren 1s infinite; } - -.info.vehicle #speedometer #vehicle-gear i { top: -2px; } -.info.vehicle #speedometer #vehicle-gear span { padding: 5px 15px 0 10px; } - - -.info.vehicle #speedometer #vehicle-status-left { position: absolute; bottom: 0; left: 0; } -.info.vehicle #speedometer #vehicle-status-left ul li { float: left; } - -.info.vehicle #speedometer #vehicle-status-right { position: absolute; bottom: 0; right: 0; } -.info.vehicle #speedometer #vehicle-status-right ul li { float: left; } - -.info.vehicle #speedometer li#seatbelt span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.vehicle #speedometer li#seatbelt.on span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } - -.info.vehicle #speedometer li#fuel span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } - -.info.vehicle #speedometer li#lights.normal span, -.info.vehicle #speedometer li#lights.high span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } - -.info.vehicle #speedometer li#signals.dying span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); animation: trew-status-blink 750ms infinite; } - - - - - - - - -.info.weapon { bottom: 85px; right: 25px; } -.info.weapon.armed { display: block; opacity: 1; } -.info.weapon.unarmed { display: none; opacity: 0; } - -.info.weapon #weapon_image { float: left; width: 200px; height: 40px; text-align: left; position: relative; } -.info.weapon #weapon_image img { position: absolute; top: 50%; right: 25px; transform: translateY(-50%); height: 40px; } - -.info.weapon #weapon_bullets { color: #FFF; float: left; width: 35px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); line-height: 1; } -.info.weapon #weapon_bullets .clip { font-weight: 900; font-size: 22px; } -.info.weapon #weapon_bullets .ammo { font-weight: 700; font-size: 16px; opacity: 0.7;} - - -.info.weapon #bullets { margin: 0; float: left; margin: 5px 0 0 20px; overflow: visible; transform: scale(1.1); } -.info.weapon #bullets i { color: #FFF; float: right; height: 34px; width: 34px; border-radius: 100px; } -.info.weapon #bullets i.clone { background: none; position: absolute; float: none; top: 15px; left: inherit; left: 10px; opacity: 0; } -.info.weapon #bullets.shooting i.clone { animation: trew-bullets 250ms 1; } -.info.weapon #bullets i img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-35%); } - - - - - - -.info.radio { bottom: 19px; right: 25px; z-index: 11; } -.info.radio #voice { width: 35px; height: 35px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); text-align: center; padding: 7px 0 0 0; transition: all 0.1s linear; } - -.info.radio #voice.whisper { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } -.info.radio #voice.normal { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.radio #voice.shout { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.radio #voice i.fas { font-size: 18px; color: #FFF; } -.info.radio #voice.speak { animation: trew-soundwave 1s infinite; } - -.info.time-and-place { position: absolute; bottom: 18px; right: 65px; height: 38px; font-size: 11px; color: #FFF; background: rgba(0,0,0,0.35); border-radius: 100px; text-align: right; } - -.info.time-and-place .data { position: relative; top: 50%; transform: translate(0,-50%); } -.info.time-and-place .data div { padding: 0 25px; } - - - -@keyframes trew-siren { - 0% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } - 50% { border-color: rgba(255,0,0,1); box-shadow: 0 0 10px 10px rgba(255,0,0,0.50); } - 100% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } -} - -@keyframes trew-soundwave { - 0% { box-shadow: 0 0 0 0px rgba(255,255,255,0.75); } - 100% { box-shadow: 0 0 0 25px rgba(255,255,255,0); } -} - -@keyframes trew-status-blink { - 0% { opacity: 0; } - 50% { opacity: 1; } - 100% { opacity: 0; } -} - -@keyframes trew-pulse { - 0% { transform: scale(1); } - 25% { transform: scale(1.5); } - 100% { transform: scale(1); } -} - -@keyframes trew-speed { - 0% { stroke-dashoffset: 280; } - 50% { stroke-dashoffset: 75; } - 100% { stroke-dashoffset: 280; } -} - -@keyframes trew-bullets { - 0% { opacity: 0; } - 25% { opacity: 1; } - 100% { transform: translate(30px,-60px) rotate(90deg); opacity: 0;} -} - -@keyframes trew-rainbow{ - 100%, - 0%{ background: rgba(255,0,0,0.70); } - 8%{ background: rgba(255,127,0,0.70); } - 16%{ background: rgba(230,205,23,0.70); } - 25%{ background: rgba(127,255,0,0.70); } - 33%{ background: rgba(0,255,0,0.70); } - 41%{ background: rgba(0,255,127,0.70); } - 50%{ background: rgba(0,255,255,0.70); } - 58%{ background: rgba(0,127,255,0.70); } - 66%{ background: rgba(0,0,255,0.70); } - 75%{ background: rgba(127,0,255,0.70); } - 83%{ background: rgba(255,0,255,0.70); } - 91%{ background: rgba(255,0,127,0.70); } +*, *:before, *:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + margin: 0; + padding: 0; +} + +body,html { width: 100%; height: 100%; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + +} + +body { /*background: url('https://i.imgur.com/MoYBh1e.jpg') center center no-repeat; background-size: cover;*/ } + +#ui { position: relative; width: 100%; height: 100%; overflow: hidden; } +div.separator { display: block; clear: both; width: 100%; } + + + + +.icon { display: block; position: relative; padding: 10px 8px; margin: 10px 5px 0 5px; width: 30px; height: 30px; border-radius: 100px; overflow: hidden; background: rgba(0,0,0,0.35); } + +.icon i { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #FFF; z-index: 11; font-size: 15px; } +.icon img { width: 16px; margin: -3px 0 0 0; } +.icon span { display: block; position: absolute; left: 50%; bottom: 0; transform: translate(-50%,0); width: 100%; height: 100%; } + +.icon.text { display: inline-block; overflow: visible; width: auto; padding: 0; } +.icon.text i { display: inline-block; float: left; transform: translate(0%,0%); left: 0; top: 0; position: relative; padding: 10px 8px; width: 30px; height: 30px; border-radius: 100px; color: #FFF; } +.icon.text i:before { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); } +.icon.text span { position: relative; width: auto; height: auto; left: 0; transform: translate(0,0); display: inline-block; font-size: 12px; padding: 7px 15px 0 10px; font-weight: 700; color: #FFF; } + + +.icon.dying:not(.customstatus) span { animation: trew-status-blink 500ms infinite; } +.icon.pulse i { animation: trew-pulse 500ms 1; } + + + + +.info { position: absolute; } + +.info.server { top: 45px; right: 26px; width: 90px; height: 90px; } +.info.server #server img { max-width: 100%; opacity: 0.75; } + +.info.player { top: 140px; right: 25px; text-align: right;} +.info.player #job span { font-size: 24px; color: #FFF; font-weight: 900; text-transform: uppercase; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } + + + + + +.info.player #money div[id] { float: right; } + +.info.player #money { clear: both; } +.info.player #money #wallet i { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } +.info.player #money #blackMoney i { background: linear-gradient(180deg, #474747 0%, #252525 100%); } +.info.player #money #bank i { background: linear-gradient(180deg, #c70a0a 0%, #960505 100%); } +.info.player #money #society i { background: linear-gradient(180deg, #874c14 0%, #6a3c10 100%); } +.info.player #money #plyId i { background: linear-gradient(180deg, #635ebd 0%, #3776ff 100%); } +/*.info.player #money #wallet i:before { content: '\f153'; }*/ + + +.info.player #status { clear: both; } +.info.player #status ul { margin: 10px 0 0 0; } +.info.player #status ul li { float: right;} +.info.player #status ul li#health span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } +.info.player #status ul li#armor span { background: linear-gradient(180deg, #0bcfe6 0%, #0aa3b5 100%); } +.info.player #status ul li#stamina span { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } +.info.player #status ul li#stress span { background: linear-gradient(180deg, #aa4daa 0%, rgb(150, 0, 167) 100%); } +.info.player #status ul li#hunger span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } +.info.player #status ul li#thirst span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } +.info.player #status ul li#health.dead { animation: trew-pulse 500ms infinite; } +.info.player #status ul li#health.dead span { height: 0 !important; } +.info.player #status ul li#health.dead i.fas:before { content: '\f714'; } + +.info.vehicle { bottom: 20px; left: 50%; transform: translate(-50%,0); z-index: 11; } +.info.vehicle.active { opacity: 1; } +.info.vehicle.inactive { opacity: 0; } + + +.info.vehicle #speedometer { position: relative; width: 270px; height: 130px; } +.info.vehicle #speedometer svg { position: absolute; top: 0; left: 50%; transform: translate(-50%,0) rotate(138deg); width: 130px; } + +.info.vehicle #speedometer svg circle { display: block; fill: transparent; stroke-width: 5px; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 75; transform-origin: 50% 50%; } +.info.vehicle #speedometer svg circle.mask { stroke: rgba(0,0,0,0.35); } +.info.vehicle #speedometer svg circle.speed { stroke: url(#speed-gradient); stroke-dashoffset: 180; } +.info.vehicle #speedometer svg:first-child { z-index: 11; } + + +.info.vehicle #speedometer svg circle { transition: all 250ms linear; } +.info.vehicle #speedometer svg circle.zero { stroke: #00c3ff; stroke-dashoffset: 235; } +.info.vehicle #speedometer svg circle.twentyfive { stroke: #18b70b; stroke-dashoffset: 180; } +.info.vehicle #speedometer svg circle.fifty { stroke: #ff8000; stroke-dashoffset: 125; } +.info.vehicle #speedometer svg circle.seventyfive { stroke: #ff0000; stroke-dashoffset: 75; } + + +.info.vehicle #speedometer #vehicle-speed { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; color: #FFF;} +.info.vehicle #speedometer #vehicle-speed span { display: block; font-weight: 900; font-size: 30px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } + + .info.vehicle #speedometer #vehicle-speed strong { display: inline-block; font-size: 10px; font-weight: 900; padding: 2px 5px; border-radius: 100px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); transition: all 150ms linear; } + .info.vehicle #speedometer #vehicle-speed strong.on { background: #18b70b; } + +.info.vehicle #speedometer #vehicle-gear, +.info.vehicle #speedometer #vehicle-others { position: absolute; bottom: 0; left: 50%; width: 69px; transform: translate(-50%,0); margin: auto; border: 2px solid transparent; } + +.info.vehicle #speedometer #vehicle-gear.pulsing { animation: trew-siren 1s infinite; } + +.info.vehicle #speedometer #vehicle-gear i { top: -2px; } +.info.vehicle #speedometer #vehicle-gear span { padding: 5px 15px 0 10px; } + + +.info.vehicle #speedometer #vehicle-status-left { position: absolute; bottom: 0; left: 0; } +.info.vehicle #speedometer #vehicle-status-left ul li { float: left; } + +.info.vehicle #speedometer #vehicle-status-right { position: absolute; bottom: 0; right: 0; } +.info.vehicle #speedometer #vehicle-status-right ul li { float: left; } + +.info.vehicle #speedometer li#seatbelt span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } +.info.vehicle #speedometer li#seatbelt.on span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } + +.info.vehicle #speedometer li#fuel span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } + +.info.vehicle #speedometer li#lights.normal span, +.info.vehicle #speedometer li#lights.high span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } + +.info.vehicle #speedometer li#signals.dying span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); animation: trew-status-blink 750ms infinite; } + + + + + + + + +.info.weapon { bottom: 85px; right: 25px; } +.info.weapon.armed { display: block; opacity: 1; } +.info.weapon.unarmed { display: none; opacity: 0; } + +.info.weapon #weapon_image { float: left; width: 200px; height: 40px; text-align: left; position: relative; } +.info.weapon #weapon_image img { position: absolute; top: 50%; right: 25px; transform: translateY(-50%); height: 40px; } + +.info.weapon #weapon_bullets { color: #FFF; float: left; width: 35px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); line-height: 1; } +.info.weapon #weapon_bullets .clip { font-weight: 900; font-size: 22px; } +.info.weapon #weapon_bullets .ammo { font-weight: 700; font-size: 16px; opacity: 0.7;} + + +.info.weapon #bullets { margin: 0; float: left; margin: 5px 0 0 20px; overflow: visible; transform: scale(1.1); } +.info.weapon #bullets i { color: #FFF; float: right; height: 34px; width: 34px; border-radius: 100px; } +.info.weapon #bullets i.clone { background: none; position: absolute; float: none; top: 15px; left: inherit; left: 10px; opacity: 0; } +.info.weapon #bullets.shooting i.clone { animation: trew-bullets 250ms 1; } +.info.weapon #bullets i img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-35%); } + + + + + + +.info.radio { bottom: 19px; right: 25px; z-index: 11; } +.info.radio #voice { width: 35px; height: 35px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); text-align: center; padding: 7px 0 0 0; transition: all 0.1s linear; } + +.info.radio #voice.whisper { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } +.info.radio #voice.normal { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } +.info.radio #voice.shout { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } +.info.radio #voice i.fas { font-size: 18px; color: #FFF; } +.info.radio #voice.speak { animation: trew-soundwave 1s infinite; } + +.info.time-and-place { position: absolute; bottom: 18px; right: 65px; height: 38px; font-size: 11px; color: #FFF; background: rgba(0,0,0,0.35); border-radius: 100px; text-align: right; } + +.info.time-and-place .data { position: relative; top: 50%; transform: translate(0,-50%); } +.info.time-and-place .data div { padding: 0 25px; } + + + +@keyframes trew-siren { + 0% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } + 50% { border-color: rgba(255,0,0,1); box-shadow: 0 0 10px 10px rgba(255,0,0,0.50); } + 100% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } +} + +@keyframes trew-soundwave { + 0% { box-shadow: 0 0 0 0px rgba(255,255,255,0.75); } + 100% { box-shadow: 0 0 0 25px rgba(255,255,255,0); } +} + +@keyframes trew-status-blink { + 0% { opacity: 0; } + 50% { opacity: 1; } + 100% { opacity: 0; } +} + +@keyframes trew-pulse { + 0% { transform: scale(1); } + 25% { transform: scale(1.5); } + 100% { transform: scale(1); } +} + +@keyframes trew-speed { + 0% { stroke-dashoffset: 280; } + 50% { stroke-dashoffset: 75; } + 100% { stroke-dashoffset: 280; } +} + +@keyframes trew-bullets { + 0% { opacity: 0; } + 25% { opacity: 1; } + 100% { transform: translate(30px,-60px) rotate(90deg); opacity: 0;} +} + +@keyframes trew-rainbow{ + 100%, + 0%{ background: rgba(255,0,0,0.70); } + 8%{ background: rgba(255,127,0,0.70); } + 16%{ background: rgba(230,205,23,0.70); } + 25%{ background: rgba(127,255,0,0.70); } + 33%{ background: rgba(0,255,0,0.70); } + 41%{ background: rgba(0,255,127,0.70); } + 50%{ background: rgba(0,255,255,0.70); } + 58%{ background: rgba(0,127,255,0.70); } + 66%{ background: rgba(0,0,255,0.70); } + 75%{ background: rgba(127,0,255,0.70); } + 83%{ background: rgba(255,0,255,0.70); } + 91%{ background: rgba(255,0,127,0.70); } } \ No newline at end of file diff --git a/VRP/trew_hud_ui/html/sounds/car-indicators.ogg b/QBCore/qb_trew_hud/html/sounds/car-indicators.ogg similarity index 100% rename from VRP/trew_hud_ui/html/sounds/car-indicators.ogg rename to QBCore/qb_trew_hud/html/sounds/car-indicators.ogg diff --git a/VRP/trew_hud_ui/html/sounds/seatbelt-buckle.ogg b/QBCore/qb_trew_hud/html/sounds/seatbelt-buckle.ogg similarity index 100% rename from VRP/trew_hud_ui/html/sounds/seatbelt-buckle.ogg rename to QBCore/qb_trew_hud/html/sounds/seatbelt-buckle.ogg diff --git a/VRP/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg b/QBCore/qb_trew_hud/html/sounds/seatbelt-unbuckle.ogg similarity index 100% rename from VRP/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg rename to QBCore/qb_trew_hud/html/sounds/seatbelt-unbuckle.ogg diff --git a/QBCore/qb_trew_hud/html/ui.html b/QBCore/qb_trew_hud/html/ui.html new file mode 100644 index 0000000..ba0ccd6 --- /dev/null +++ b/QBCore/qb_trew_hud/html/ui.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + TREW UI + + + +
+ + + + + +
+ + +
+
    + + + + + + +
+
+ +
+ + + + + +
+ + +
+ + + + + + + +
+ +
+ + +
+ + + + +
+ + + +
+ 999 + KM/H +
+ + + +
+ N +
+ + + + + +
+
    +
  • +
  • +
+
+ + +
+
    +
  • +
  • +
+
+ + + +
+ + + + + +
+ + + + + + + + +
+ +
+ + + + + + + +
+
+ + +
+
+ + + +
+ + + + + diff --git a/QBCore/qb_trew_hud/locales/br.lua b/QBCore/qb_trew_hud/locales/br.lua new file mode 100644 index 0000000..663039d --- /dev/null +++ b/QBCore/qb_trew_hud/locales/br.lua @@ -0,0 +1,71 @@ +Locales['br'] = { + ['you_are_on_location'] = 'Você está em %s', + + ['date_format'] = { + default = 'Hoje é %s de %s de %s', + simple = 'Hoje é %s de %s', + simpleWithHours = 'São %s do dia %s de %s', + withWeekday = 'Hoje é %s, %s de %s de %s', + withHours = 'São %s do dia %s de %s de %s', + withWeekdayAndHours = 'São %s de %s, %s de %s de %s' + }, + + ['weekDay_0'] = 'Domingo', + ['weekDay_1'] = 'Segunda-feira', + ['weekDay_2'] = 'Terça-feira', + ['weekDay_3'] = 'Quarta-feira', + ['weekDay_4'] = 'Quinta-feira', + ['weekDay_5'] = 'Sexta-feira', + ['weekDay_6'] = 'Sábado', + + ['day_1'] = '1', + ['day_2'] = '2', + ['day_3'] = '3', + ['day_4'] = '4', + ['day_5'] = '5', + ['day_6'] = '6', + ['day_7'] = '7', + ['day_8'] = '8', + ['day_9'] = '9', + + ['day_10'] = '10', + ['day_11'] = '11', + ['day_12'] = '12', + ['day_13'] = '13', + ['day_14'] = '14', + ['day_15'] = '15', + ['day_16'] = '16', + ['day_17'] = '17', + ['day_18'] = '18', + ['day_19'] = '19', + + ['day_20'] = '20', + ['day_21'] = '21', + ['day_22'] = '22', + ['day_23'] = '23', + ['day_24'] = '24', + ['day_25'] = '25', + ['day_26'] = '26', + ['day_27'] = '27', + ['day_28'] = '28', + ['day_29'] = '29', + + ['day_30'] = '30', + ['day_31'] = '31', + + ['month_0'] = 'Janeiro', + ['month_1'] = 'Fevereiro', + ['month_2'] = 'Março', + ['month_3'] = 'Abril', + ['month_4'] = 'Maio', + ['month_5'] = 'Junho', + ['month_6'] = 'Julho', + ['month_7'] = 'Agosto', + ['month_8'] = 'Setembro', + ['month_9'] = 'Outubro', + ['month_10'] = 'Novembro', + ['month_11'] = 'Dezembro', + + ['toggleui'] = 'Habilita/Desabilita parte da HUD', + +} \ No newline at end of file diff --git a/QBCore/qb_trew_hud/locales/en.lua b/QBCore/qb_trew_hud/locales/en.lua new file mode 100644 index 0000000..ab7290e --- /dev/null +++ b/QBCore/qb_trew_hud/locales/en.lua @@ -0,0 +1,72 @@ +-- English +Locales['en'] = { + ['you_are_on_location'] = 'You are on %s', + + ['date_format'] = { + default = 'Today is %s of %s, %s', + simple = 'Today is %s, %s', + simpleWithHours = 'It is %s, %s, %s', + withWeekday = 'Today is %s, %s of %s, %s', + withHours = 'It is %s, %s of %s, %s', + withWeekdayAndHours = 'It is %s, %s, %s of %s, %s' + }, + + ['weekDay_0'] = 'Sunday', + ['weekDay_1'] = 'Monday', + ['weekDay_2'] = 'Tuesday', + ['weekDay_3'] = 'Wednesday', + ['weekDay_4'] = 'Thursday', + ['weekDay_5'] = 'Friday', + ['weekDay_6'] = 'Saturday', + + ['day_1'] = '1st', + ['day_2'] = '2rd', + ['day_3'] = '3rd', + ['day_4'] = '4th', + ['day_5'] = '5th', + ['day_6'] = '6th', + ['day_7'] = '7th', + ['day_8'] = '8th', + ['day_9'] = '9th', + + ['day_10'] = '10th', + ['day_11'] = '11th', + ['day_12'] = '12th', + ['day_13'] = '13th', + ['day_14'] = '14th', + ['day_15'] = '15th', + ['day_16'] = '16th', + ['day_17'] = '17th', + ['day_18'] = '18th', + ['day_19'] = '19th', + + ['day_20'] = '20th', + ['day_21'] = '21th', + ['day_22'] = '22th', + ['day_23'] = '23th', + ['day_24'] = '24th', + ['day_25'] = '25th', + ['day_26'] = '26th', + ['day_27'] = '27th', + ['day_28'] = '28th', + ['day_29'] = '29th', + + ['day_30'] = '30th', + ['day_31'] = '31th', + + ['month_0'] = 'January', + ['month_1'] = 'February', + ['month_2'] = 'March', + ['month_3'] = 'April', + ['month_4'] = 'May', + ['month_5'] = 'June', + ['month_6'] = 'July', + ['month_7'] = 'August', + ['month_8'] = 'September', + ['month_9'] = 'October', + ['month_10'] = 'November', + ['month_11'] = 'December', + + ['toggleui'] = 'Enables/Disables parts of the HUD', + +} \ No newline at end of file diff --git a/QBCore/qb_trew_hud/locales/es.lua b/QBCore/qb_trew_hud/locales/es.lua new file mode 100644 index 0000000..0d6b770 --- /dev/null +++ b/QBCore/qb_trew_hud/locales/es.lua @@ -0,0 +1,72 @@ +-- Español +Locales['es'] = { + ['you_are_on_location'] = 'Estas en %s', + + ['date_format'] = { + default = 'Hoy es %s de %s, %s', + simple = 'Hoy es %s, %s', + simpleWithHours = 'Es %s, %s, %s', + withWeekday = 'Hoy es %s, %s de %s, %s', + withHours = 'Son las %s, %s de %s, %s', + withWeekdayAndHours = 'Es %s, %s, %s de %s, %s' + }, + + ['weekDay_0'] = 'Lunes', + ['weekDay_1'] = 'Martes', + ['weekDay_2'] = 'Miercoles', + ['weekDay_3'] = 'Jueves', + ['weekDay_4'] = 'Viernes', + ['weekDay_5'] = 'Sabado', + ['weekDay_6'] = 'Domingo', + + ['day_1'] = '1st', + ['day_2'] = '2rd', + ['day_3'] = '3rd', + ['day_4'] = '4th', + ['day_5'] = '5th', + ['day_6'] = '6th', + ['day_7'] = '7th', + ['day_8'] = '8th', + ['day_9'] = '9th', + + ['day_10'] = '10th', + ['day_11'] = '11th', + ['day_12'] = '12th', + ['day_13'] = '13th', + ['day_14'] = '14th', + ['day_15'] = '15th', + ['day_16'] = '16th', + ['day_17'] = '17th', + ['day_18'] = '18th', + ['day_19'] = '19th', + + ['day_20'] = '20th', + ['day_21'] = '21th', + ['day_22'] = '22th', + ['day_23'] = '23th', + ['day_24'] = '24th', + ['day_25'] = '25th', + ['day_26'] = '26th', + ['day_27'] = '27th', + ['day_28'] = '28th', + ['day_29'] = '29th', + + ['day_30'] = '30th', + ['day_31'] = '31th', + + ['month_0'] = 'Enero', + ['month_1'] = 'Febrero', + ['month_2'] = 'Marzp', + ['month_3'] = 'Abril', + ['month_4'] = 'Mayo', + ['month_5'] = 'Junio', + ['month_6'] = 'Julio', + ['month_7'] = 'Agosto', + ['month_8'] = 'Septiembre', + ['month_9'] = 'Octubre', + ['month_10'] = 'Noviembre', + ['month_11'] = 'Diciembre', + + ['toggleui'] = 'Habilita/Deshabilita parts of the HUD', + +} diff --git a/QBCore/qb_trew_hud/translation.lua b/QBCore/qb_trew_hud/translation.lua new file mode 100644 index 0000000..62847c0 --- /dev/null +++ b/QBCore/qb_trew_hud/translation.lua @@ -0,0 +1,18 @@ +-- credit: https://github.com/esx-framework/esx_core/blob/main/%5Bcore%5D/es_extended/locale.lua +Locales = {} + +function Translate(str, ...) -- Translate string + if Locales[Config.Locale] then + if Locales[Config.Locale][str] then + return string.format(Locales[Config.Locale][str], ...) + elseif Config.Locale ~= 'en' and Locales['en'] and Locales['en'][str] then + return string.format(Locales['en'][str], ...) + else + return 'Translation [' .. Config.Locale .. '][' .. str .. '] does not exist' + end + elseif Config.Locale ~= 'en' and Locales['en'] and Locales['en'][str] then + return string.format(Locales['en'][str], ...) + else + return 'Locale [' .. Config.Locale .. '] does not exist' + end +end diff --git a/README.md b/README.md index 11e3eda..967ec79 100644 --- a/README.md +++ b/README.md @@ -1,241 +1,56 @@ -# Trew HUD UI +

[ESX/QB] Trew Hud

2023 Remaster By Mycroft

-User Interface created originally for ESX and then adapted for VRP/VRPEX. +One of the most, if not **the most**, popular hud for FiveM brought back with a new life - running with 0.03-0.05ms resmon and 2023 Resource support! -# PROJECT DISCONTINUED +## Major Changes -It was nice to play GTA5 RP and learn LUA in order to code the Trew HUD UI, but after so many struggles with not only the FiveM community and with the thing itself, I decided that I will no longer improve this project. It's been 6 months since the last time I played GTA5 RP and it makes no sense to continue this. - -If you want to fork this project or send pull request, feel free to do it. It has been a nice ride. :) BALLAS FOREVER! - -## Demo - click on the image below. -[![TREW HUD UI DEMO](https://i.imgur.com/DyaZ6Jl.png)](https://youtu.be/u1QTJ5aHcGA) +```diff ++ PMA Voice Support ++ ESX Legacy Support ++ Rewrote major sections ++ Completely Optimised ++ Better Font ++ Completely Client-Sided ++ Added Player Id to HUD ++ Added QBCore Support (Including Stress and Crypto!) +- Removed Unused Code +- Removed Unused Files +- Removed vRP support +``` +# Preview +[![Preview](https://i.imgur.com/kerhT5C.png)](https://streamable.com/rhrrn6) ## Installation -1. Extract the .zip or Open the .zip. -2. Place `trew_hud_ui` in your resources directory. -3. Add `start trew_hud_ui` to your server.cfg - - - -## Special Instructions for the ESX version - -### Requirements - -- [es_extended](https://github.com/ESX-Org/es_extended) -- [esx_society](https://github.com/ESX-Org/esx_society) -- [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) - - -### Optional - -- [esx_basicneeds](https://github.com/ESX-Org/esx_basicneeds) -- [esx_status](https://github.com/ESX-Org/esx_status) -- [LegacyFuel](https://github.com/InZidiuZ/LegacyFuel) (it should be started **BEFORE** the trew\_hud\_ui) - - -### What you can disable - -- [RadarWhileDriving](https://github.com/Flatracer/RadarWhileDriving) - - -### Post Installation - -- Go to **es_extended** _config.lua_ and turn **Config.EnableHud** to _false_ -- If needed, go to **esx_basicneeds** _main.lua_ and replace this code - - - TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status) - return true - end, function(status) - status.remove(1000) - end) - TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status) - return true - end, function(status) - status.remove(750) - end) - -for this one - -- - TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status) - return false - end, function(status) - status.remove(1000) - end) - TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status) - return false - end, function(status) - status.remove(750) - end) - - - - -## Special Instructions for the VRP/VRPEX versions - -Inside **config.lua** you will see a _Config.vRP_ with certain items needed to set up properly, like black money. Since black money is considered an item on VRP/VRPEX versions, you need to put the ID of said item on this configuration. On most VRP versions, the ID is **dirty_money**. +1. Extract/Open the .zip. +2. Place `trew_hud-remastered` in your resources directory. +3. Add `ensure trew_hud-remastered` to your server.cfg -**Config.vRP** -Special settings for vRP/vRPEX +### ESX -- **items** - - _blackMoney:_ The item ID for Black Money. - - - +#### Requirements -## Config.lua settings +- [ESX Legacy](https://github.com/esx-framework/esx_core) +- [ESX Society](https://github.com/esx-framework/esx_society) +- [ESX Addon Account](https://github.com/esx-framework/esx_addonaccount) -**Config.Locale** -The language. Default is _en_. - -**Config.serverLogo** -Logo for your server. It’s suggested that you upload a **PNG** file to websites like **[imgur.com](http://imgur.com)** and then paste the link there. - -**Config.font** -Font configuration for the UI. Default is _Montserrat_ and the link points up to _Google Fonts_. It’s suggested that you look up for a font there and place the name and the link on it’s location. - -- **name**: The name of the font -- **link**: CSS Stylesheet file link for the font - -**Config.date** -Date format for the GPS location. - -- **format**: - - - _default:_ It’s the default format; - - _withWeekDay:_ Format that shows week day names, like _monday, tuesday, wednesday_, etc; - - _withHours:_ Format that shows the current time in game; - - _withWeekAndHours:_ A mix of _withWeekDay_ and _withHours_. - - _simple:_ Format that shows only day and month; - - _simpleWithHours:_ Same as _simple_, but also showing the time. -- **AmPm**: set it to _true_ if you want to use AM/PM time format, _false_ if you don’t. - - -**Config.voice** -Voice settings for the UI. OneSync compatible - -- **levels**: - - - _default:_ Distance in meters for a default distance. **Default** is _5.0_; - - _shout:_ Distance in meters for a shout distance. **Default** is _12.0_; - - _whisper:_ Distance in meters for a whisper distance. **Default** is _1.0_; - - _current:_ It’s **important** that this is left unchanged. -- **keys**: - - - _distance:_ Distance in meters for a default distance. **Default** is _HOME_. - -**Config.vehicle** -Vehicle and speedometer settings - -- **speedUnit**: It should be set either _KMH_ or _MPH_. **Default** is _KMH_; -- **maxSpeed**: The top speed the Speedometer is allowed to go. Default is _240_; -- **keys**: - - _seatbelt:_ Buckle/unbuckle seatbelt. **Default** is _K_; - - _cruiser:_ Activate/deactivate cruiser speed. **Default** is _CAPS_; - - _signalLeft:_ Activate/deactivate car left signal. **Default** is _LEFT_; - - _signalRight:_ Activate/deactivate car right signal. **Default** is _RIGHT_; - - _signalBoth:_ Activate/deactivate car danger signal. **Default** is _DOWN_; - -**Config.ui** -Display or hide elements of the HUD - -- **showJob**: Displays the job name. **Default** is _true_; -- **showWalletMoney**: Displays the money on your wallet. **Default** is _true_; -- **showBankMoney**: Displays the money on your bank account. **Default** is _true_; -- **showBlackMoney**: Displays the black money you have. **Default** is _true_; -- **showSocietyMoney**: If you are the boss of a job, it displays the money you have in the society vault. **Default** is _true_; **(Society money only works on ESX)** -- **showDate**: Displays the date. **Default** is _true_; -- **showLocation**: Displays the location. **Default** is _true_; -- **showHealth**: Displays your health. **Default** is _true_; -- **showArmor**: Displays your armor. **Default** is _true_; -- **showStamina**: Displays your stamina. **Default** is _true_; -- **showHunger**: Displays hunger. **Default** is _true_; -- **showThirst**: Displays thirst. **Default** is _true_; -- **showMinimap**: Displays the minimap while off the vehicle. **Default** is _false_; -- **showVoice**: Displays/use the voice controller. **Default** is _true_; -- **showWeapons**: Displays the weapons you have on your hand, with ammo. **Default** is _true_; - -## Adding Custom Status - click on the image below. - -[![TREW HUD UI STATUS CREATION](https://i.imgur.com/O1Cuz4I.png)](https://streamable.com/kzns5) -**Check by the thirst indicator** - -You can create custom indicators for status you already have, like stress status, drunken, shit, piss, you name it! You would just have to use the new **exports** functions. I would recommend you create a new script with the code and load it below **trew\_hud\_ui** on your server.cfg. +#### Optional +- [esx_basicneeds](https://github.com/esx-framework/esx_basicneeds) +- [esx_status](https://github.com/esx-framework/esx_status) +### QBCore -**exports.trew\_hud\_ui.createStatus** -Creates a new indicator after the existing ones. - -**Example:** - - local STRESS_ACTIVE = false - - AddEventHandler('playerSpawned', function() - - if STRESS_ACTIVE == false then - exports.trew_hud_ui:createStatus({ - status = 'stress', - color = '#FF0090', - icon = '' - }); - STRESS_ACTIVE = true - end - - end) - - -**Usage:** - -- **status**: The status ID. It's purely to identify it; -- **color**: The color you want for the status; -- **icon**: The HTML code for the icon. You can search on [FontAwesome](https://fontawesome.com/) for an icon and when you find one of your liking, change it there. +#### Requirements +- [QBCore](https://github.com/qbcore-framework/qb-core) +- [qb-management](https://github.com/qbcore-framework/qb-management) - -**exports.trew\_hud\_ui.setStatus** -It is what makes the status update. It should be set on a Wait() timer to update on whenever your custom status is. The example below ticks while getting from a custom status registered on **esx_status**. - -**Example:** - - Citizen.CreateThread(function() - while true do - Citizen.Wait(1000) - - local STRESS_STATUS - - TriggerEvent('esx_status:getStatus', 'stress', function(status) - STRESS_STATUS = status.getPercent() - end) - - exports.trew_hud_ui:setStatus({ - name = 'stress', - value = STRESS_STATUS - }); - end - end) - - -**Usage:** - -- **name**: The name of the status. It should be correspondent with the ID when you created it; -- **value**: The percentage value for the status, from 0 to 100. - -## Chat commands +## Commands **/toggleui** Enables/Disables HUD information elements, like _and job all types money_. Useful for streamers. _**Usage example:**_ /toggleui - -## Donate - -This HUD is the product of 4 months of work, craft and creativity. While now I'm giving it for free, if you want to help, consider donating any ammount you want to. It will be really appreciated. :) - -[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=S735RJA49KSJ8¤cy_code=USD&source=url) diff --git a/VRP/trew_hud_ui/LICENSE b/VRP/trew_hud_ui/LICENSE deleted file mode 100644 index f288702..0000000 --- a/VRP/trew_hud_ui/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/VRP/trew_hud_ui/__resource.lua b/VRP/trew_hud_ui/__resource.lua deleted file mode 100644 index fa9c78b..0000000 --- a/VRP/trew_hud_ui/__resource.lua +++ /dev/null @@ -1,132 +0,0 @@ -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' - -description 'Trew HUD UI' - -ui_page 'html/ui.html' - - -files { - 'html/ui.html', - 'html/main.css', - 'html/app.js', - - 'html/img/vehicle-gear.png', - 'html/img/vehicle-lights.png', - 'html/img/vehicle-lights-high.png', - 'html/img/vehicle-seatbelt.png', - - 'html/img/weapon-bullets.png', - - 'html/img/weapons/appistol.png', - 'html/img/weapons/assaultrifle.png', - 'html/img/weapons/assaultrifle_mk2.png', - 'html/img/weapons/assaultshotgun.png', - 'html/img/weapons/assaultsmg.png', - 'html/img/weapons/autoshotgun.png', - 'html/img/weapons/ball.png', - 'html/img/weapons/bat.png', - 'html/img/weapons/battleaxe.png', - 'html/img/weapons/bottle.png', - 'html/img/weapons/bullpuprifle.png', - 'html/img/weapons/bullpuprifle_mk2.png', - 'html/img/weapons/bullpupshotgun.png', - 'html/img/weapons/bzgas.png', - 'html/img/weapons/carbinerifle.png', - 'html/img/weapons/carbinerifle_mk2.png', - 'html/img/weapons/combatmg.png', - 'html/img/weapons/combatmg_mk2.png', - 'html/img/weapons/combatpdw.png', - 'html/img/weapons/combatpistol.png', - 'html/img/weapons/compactlauncher.png', - 'html/img/weapons/compactrifle.png', - 'html/img/weapons/crowbar.png', - 'html/img/weapons/dagger.png', - 'html/img/weapons/dbshotgun.png', - 'html/img/weapons/doubleaction.png', - 'html/img/weapons/firework.png', - 'html/img/weapons/flare.png', - 'html/img/weapons/flaregun.png', - 'html/img/weapons/flashlight.png', - 'html/img/weapons/golfclub.png', - 'html/img/weapons/grenade.png', - 'html/img/weapons/grenadelauncher.png', - 'html/img/weapons/grenadelauncher_smoke.png', - 'html/img/weapons/gusenberg.png', - 'html/img/weapons/hammer.png', - 'html/img/weapons/hatchet.png', - 'html/img/weapons/heavypistol.png', - 'html/img/weapons/heavyshotgun.png', - 'html/img/weapons/heavysniper.png', - 'html/img/weapons/heavysniper_mk2.png', - 'html/img/weapons/hominglauncher.png', - 'html/img/weapons/knife.png', - 'html/img/weapons/knuckle.png', - 'html/img/weapons/machete.png', - 'html/img/weapons/machinepistol.png', - 'html/img/weapons/marksmanpistol.png', - 'html/img/weapons/marksmanrifle.png', - 'html/img/weapons/marksmanrifle_mk2.png', - 'html/img/weapons/mg.png', - 'html/img/weapons/microsmg.png', - 'html/img/weapons/minigun.png', - 'html/img/weapons/minismg.png', - 'html/img/weapons/molotov.png', - 'html/img/weapons/musket.png', - 'html/img/weapons/nightstick.png', - 'html/img/weapons/petrolcan.png', - 'html/img/weapons/pipebomb.png', - 'html/img/weapons/pistol.png', - 'html/img/weapons/pistol50.png', - 'html/img/weapons/pistol_mk2.png', - 'html/img/weapons/poolcue.png', - 'html/img/weapons/proxmine.png', - 'html/img/weapons/pumpshotgun.png', - 'html/img/weapons/pumpshotgun_mk2.png', - 'html/img/weapons/railgun.png', - 'html/img/weapons/raycarbine.png', - 'html/img/weapons/rayminigun.png', - 'html/img/weapons/raypistol.png', - 'html/img/weapons/revolver.png', - 'html/img/weapons/revolver_mk2.png', - 'html/img/weapons/rpg.png', - 'html/img/weapons/sawnoffshotgun.png', - 'html/img/weapons/smg.png', - 'html/img/weapons/smg_mk2.png', - 'html/img/weapons/smokegrenade.png', - 'html/img/weapons/sniperrifle.png', - 'html/img/weapons/snowball.png', - 'html/img/weapons/snspistol.png', - 'html/img/weapons/snspistol_mk2.png', - 'html/img/weapons/specialcarbine.png', - 'html/img/weapons/specialcarbine_mk2.png', - 'html/img/weapons/stickybomb.png', - 'html/img/weapons/stone_hatchet.png', - 'html/img/weapons/stungun.png', - 'html/img/weapons/switchblade.png', - 'html/img/weapons/unarmed.png', - 'html/img/weapons/vintagepistol.png', - 'html/img/weapons/wrench.png', - - - - 'html/sounds/seatbelt-buckle.ogg', - 'html/sounds/seatbelt-unbuckle.ogg', - - 'html/sounds/car-indicators.ogg', -} - -client_scripts { - "@vrp/lib/utils.lua", - 'locales/languages.lua', - 'config.lua', - 'client/client.lua', - 'client/hansolo.lua' -} - -server_scripts { - "@vrp/lib/utils.lua", - 'locales/languages.lua', - 'config.lua', - 'server/server.lua', - 'server/milleniumfalcon.lua' -} \ No newline at end of file diff --git a/VRP/trew_hud_ui/client/client.lua b/VRP/trew_hud_ui/client/client.lua deleted file mode 100644 index c429a65..0000000 --- a/VRP/trew_hud_ui/client/client.lua +++ /dev/null @@ -1,919 +0,0 @@ -local Config = module('trew_hud_ui', 'config') -local Locales = module('trew_hud_ui', 'locales/languages') - -local zones = { ['AIRP'] = "Los Santos International Airport", ['ALAMO'] = "Alamo Sea", ['ALTA'] = "Alta", ['ARMYB'] = "Fort Zancudo", ['BANHAMC'] = "Banham Canyon Dr", ['BANNING'] = "Banning", ['BEACH'] = "Vespucci Beach", ['BHAMCA'] = "Banham Canyon", ['BRADP'] = "Braddock Pass", ['BRADT'] = "Braddock Tunnel", ['BURTON'] = "Burton", ['CALAFB'] = "Calafia Bridge", ['CANNY'] = "Raton Canyon", ['CCREAK'] = "Cassidy Creek", ['CHAMH'] = "Chamberlain Hills", ['CHIL'] = "Vinewood Hills", ['CHU'] = "Chumash", ['CMSW'] = "Chiliad Mountain State Wilderness", ['CYPRE'] = "Cypress Flats", ['DAVIS'] = "Davis", ['DELBE'] = "Del Perro Beach", ['DELPE'] = "Del Perro", ['DELSOL'] = "La Puerta", ['DESRT'] = "Grand Senora Desert", ['DOWNT'] = "Downtown", ['DTVINE'] = "Downtown Vinewood", ['EAST_V'] = "East Vinewood", ['EBURO'] = "El Burro Heights", ['ELGORL'] = "El Gordo Lighthouse", ['ELYSIAN'] = "Elysian Island", ['GALFISH'] = "Galilee", ['GOLF'] = "GWC and Golfing Society", ['GRAPES'] = "Grapeseed", ['GREATC'] = "Great Chaparral", ['HARMO'] = "Harmony", ['HAWICK'] = "Hawick", ['HORS'] = "Vinewood Racetrack", ['HUMLAB'] = "Humane Labs and Research", ['JAIL'] = "Bolingbroke Penitentiary", ['KOREAT'] = "Little Seoul", ['LACT'] = "Land Act Reservoir", ['LAGO'] = "Lago Zancudo", ['LDAM'] = "Land Act Dam", ['LEGSQU'] = "Legion Square", ['LMESA'] = "La Mesa", ['LOSPUER'] = "La Puerta", ['MIRR'] = "Mirror Park", ['MORN'] = "Morningwood", ['MOVIE'] = "Richards Majestic", ['MTCHIL'] = "Mount Chiliad", ['MTGORDO'] = "Mount Gordo", ['MTJOSE'] = "Mount Josiah", ['MURRI'] = "Murrieta Heights", ['NCHU'] = "North Chumash", ['NOOSE'] = "N.O.O.S.E", ['OCEANA'] = "Pacific Ocean", ['PALCOV'] = "Paleto Cove", ['PALETO'] = "Paleto Bay", ['PALFOR'] = "Paleto Forest", ['PALHIGH'] = "Palomino Highlands", ['PALMPOW'] = "Palmer-Taylor Power Station", ['PBLUFF'] = "Pacific Bluffs", ['PBOX'] = "Pillbox Hill", ['PROCOB'] = "Procopio Beach", ['RANCHO'] = "Rancho", ['RGLEN'] = "Richman Glen", ['RICHM'] = "Richman", ['ROCKF'] = "Rockford Hills", ['RTRAK'] = "Redwood Lights Track", ['SANAND'] = "San Andreas", ['SANCHIA'] = "San Chianski Mountain Range", ['SANDY'] = "Sandy Shores", ['SKID'] = "Mission Row", ['SLAB'] = "Stab City", ['STAD'] = "Maze Bank Arena", ['STRAW'] = "Strawberry", ['TATAMO'] = "Tataviam Mountains", ['TERMINA'] = "Terminal", ['TEXTI'] = "Textile City", ['TONGVAH'] = "Tongva Hills", ['TONGVAV'] = "Tongva Valley", ['VCANA'] = "Vespucci Canals", ['VESP'] = "Vespucci", ['VINE'] = "Vinewood", ['WINDF'] = "Ron Alternates Wind Farm", ['WVINE'] = "West Vinewood", ['ZANCUDO'] = "Zancudo River", ['ZP_ORT'] = "Port of South Los Santos", ['ZQ_UAR'] = "Davis Quartz" } - -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} - -local AllWeapons = json.decode('{"melee":{"dagger":"0x92A27487","bat":"0x958A4A8F","bottle":"0xF9E6AA4B","crowbar":"0x84BD7BFD","unarmed":"0xA2719263","flashlight":"0x8BB05FD7","golfclub":"0x440E4788","hammer":"0x4E875F73","hatchet":"0xF9DCBF2D","knuckle":"0xD8DF3C3C","knife":"0x99B507EA","machete":"0xDD5DF8D9","switchblade":"0xDFE37640","nightstick":"0x678B81B1","wrench":"0x19044EE0","battleaxe":"0xCD274149","poolcue":"0x94117305","stone_hatchet":"0x3813FC08"},"handguns":{"pistol":"0x1B06D571","pistol_mk2":"0xBFE256D4","combatpistol":"0x5EF9FEC4","appistol":"0x22D8FE39","stungun":"0x3656C8C1","pistol50":"0x99AEEB3B","snspistol":"0xBFD21232","snspistol_mk2":"0x88374054","heavypistol":"0xD205520E","vintagepistol":"0x83839C4","flaregun":"0x47757124","marksmanpistol":"0xDC4DB296","revolver":"0xC1B3C3D1","revolver_mk2":"0xCB96392F","doubleaction":"0x97EA20B8","raypistol":"0xAF3696A1"},"smg":{"microsmg":"0x13532244","smg":"0x2BE6766B","smg_mk2":"0x78A97CD0","assaultsmg":"0xEFE7E2DF","combatpdw":"0xA3D4D34","machinepistol":"0xDB1AA450","minismg":"0xBD248B55","raycarbine":"0x476BF155"},"shotguns":{"pumpshotgun":"0x1D073A89","pumpshotgun_mk2":"0x555AF99A","sawnoffshotgun":"0x7846A318","assaultshotgun":"0xE284C527","bullpupshotgun":"0x9D61E50F","musket":"0xA89CB99E","heavyshotgun":"0x3AABBBAA","dbshotgun":"0xEF951FBB","autoshotgun":"0x12E82D3D"},"assault_rifles":{"assaultrifle":"0xBFEFFF6D","assaultrifle_mk2":"0x394F415C","carbinerifle":"0x83BF0278","carbinerifle_mk2":"0xFAD1F1C9","advancedrifle":"0xAF113F99","specialcarbine":"0xC0A3098D","specialcarbine_mk2":"0x969C3D67","bullpuprifle":"0x7F229F94","bullpuprifle_mk2":"0x84D6FAFD","compactrifle":"0x624FE830"},"machine_guns":{"mg":"0x9D07F764","combatmg":"0x7FD62962","combatmg_mk2":"0xDBBD7280","gusenberg":"0x61012683"},"sniper_rifles":{"sniperrifle":"0x5FC3C11","heavysniper":"0xC472FE2","heavysniper_mk2":"0xA914799","marksmanrifle":"0xC734385A","marksmanrifle_mk2":"0x6A6C02E0"},"heavy_weapons":{"rpg":"0xB1CA77B1","grenadelauncher":"0xA284510B","grenadelauncher_smoke":"0x4DD2DC56","minigun":"0x42BF8A85","firework":"0x7F7497E5","railgun":"0x6D544C99","hominglauncher":"0x63AB0442","compactlauncher":"0x781FE4A","rayminigun":"0xB62D1F67"},"throwables":{"grenade":"0x93E220BD","bzgas":"0xA0973D5E","smokegrenade":"0xFDBC8A50","flare":"0x497FACC3","molotov":"0x24B17070","stickybomb":"0x2C3731D9","proxmine":"0xAB564B93","snowball":"0x787F0BB","pipebomb":"0xBA45E8B8","ball":"0x23C9F95C"},"misc":{"petrolcan":"0x34A67B97","fireextinguisher":"0x60EC506","parachute":"0xFBAB5776"}}') - -function _U(entry) - return Locales[ Config.Locale ][entry] -end - -local vehiclesCars = {0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20}; - --- Hides TREW UI when it's on Pause Menu -Citizen.CreateThread(function() - - local isPauseMenu = false - - while true do - Citizen.Wait(0) - - if IsPauseMenuActive() then -- ESC Key - if not isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = false }) - end - else - if isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = true }) - end - - HideHudComponentThisFrame(1) -- Wanted Stars - HideHudComponentThisFrame(2) -- Weapon Icon - HideHudComponentThisFrame(3) -- Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(6) -- Vehicle Name - HideHudComponentThisFrame(7) -- Area Name - HideHudComponentThisFrame(8) -- Vehicle Class - HideHudComponentThisFrame(9) -- Street Name - HideHudComponentThisFrame(13) -- Cash Change - HideHudComponentThisFrame(17) -- Save Game - HideHudComponentThisFrame(20) -- Weapon Stats - end - - - end -end) - - - - - - --- Date and time update -Citizen.CreateThread(function() - while true do - Citizen.Wait(1000) - if Config.ui.showDate == true then - SendNUIMessage({ action = 'setText', id = 'date', value = trewDate() }) - end - end -end) - - - - - --- Location update -Citizen.CreateThread(function() - - while true do - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - - local position = GetEntityCoords(player) - - if Config.ui.showLocation == true then - local zoneNameFull = zones[GetNameOfZone(position.x, position.y, position.z)] - local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(position.x, position.y, position.z)) - - local locationMessage = nil - - if zoneNameFull then - locationMessage = streetName .. ', ' .. zoneNameFull - else - locationMessage = streetName - end - - locationMessage = string.format( - Locales[Config.Locale]['you_are_on_location'], - locationMessage - ) - - SendNUIMessage({ action = 'setText', id = 'location', value = locationMessage }) - end - end -end) - - - - - --- Vehicle Info -local vehicleCruiser -local vehicleSignalIndicator = 'off' -local seatbeltEjectSpeed = 45.0 -local seatbeltEjectAccel = 100.0 -local seatbeltIsOn = false -local currSpeed = 0.0 -local prevVelocity = {x = 0.0, y = 0.0, z = 0.0} - -Citizen.CreateThread(function() - - while true do - - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local position = GetEntityCoords(player) - local vehicleIsOn = GetIsVehicleEngineRunning(vehicle) - local vehicleInfo - - if IsPedInAnyVehicle(player, false) and vehicleIsOn then - - - local vehicleClass = GetVehicleClass(vehicle) - - - if Config.ui.showMinimap == false then - DisplayRadar(true) - end - - -- Vehicle Speed - local vehicleSpeedSource = GetEntitySpeed(vehicle) - local vehicleSpeed - if Config.vehicle.speedUnit == 'MPH' then - vehicleSpeed = math.ceil(vehicleSpeedSource * 2.237) - else - vehicleSpeed = math.ceil(vehicleSpeedSource * 3.6) - end - - -- Vehicle Gradient Speed - local vehicleNailSpeed - - if vehicleSpeed > Config.vehicle.maxSpeed then - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(Config.vehicle.maxSpeed * 205) / Config.vehicle.maxSpeed) ) - else - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(vehicleSpeed * 205) / Config.vehicle.maxSpeed) ) - end - - - - -- Vehicle Fuel and Gear - local vehicleFuel - vehicleFuel = GetVehicleFuelLevel(vehicle) - - local vehicleGear = GetVehicleCurrentGear(vehicle) - - if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then - vehicleGear = 'N' - elseif vehicleSpeed > 0 and vehicleGear == 0 then - vehicleGear = 'R' - end - - -- Vehicle Lights - local vehicleVal,vehicleLights,vehicleHighlights = GetVehicleLightsState(vehicle) - local vehicleIsLightsOn - if vehicleLights == 1 and vehicleHighlights == 0 then - vehicleIsLightsOn = 'normal' - elseif (vehicleLights == 1 and vehicleHighlights == 1) or (vehicleLights == 0 and vehicleHighlights == 1) then - vehicleIsLightsOn = 'high' - else - vehicleIsLightsOn = 'off' - end - - - - - - - -- Vehicle Siren - local vehicleSiren - - if IsVehicleSirenOn(vehicle) then - vehicleSiren = true - else - vehicleSiren = false - end - - - - - - - -- Vehicle Seatbelt - if has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8 then - - local prevSpeed = currSpeed - currSpeed = vehicleSpeedSource - - SetPedConfigFlag(PlayerPedId(), 32, true) - - if not seatbeltIsOn then - local vehIsMovingFwd = GetEntitySpeedVector(vehicle, true).y > 1.0 - local vehAcc = (prevSpeed - currSpeed) / GetFrameTime() - if (vehIsMovingFwd and (prevSpeed > (seatbeltEjectSpeed/2.237)) and (vehAcc > (seatbeltEjectAccel*9.81))) then - - SetEntityCoords(player, position.x, position.y, position.z - 0.47, true, true, true) - SetEntityVelocity(player, prevVelocity.x, prevVelocity.y, prevVelocity.z) - SetPedToRagdoll(player, 1000, 1000, 0, 0, 0, 0) - else - -- Update previous velocity for ejecting player - prevVelocity = GetEntityVelocity(vehicle) - end - - else - - DisableControlAction(0, 75) - - end - - - - end - - - - vehicleInfo = { - action = 'updateVehicle', - - status = true, - speed = vehicleSpeed, - nail = vehicleNailSpeed, - gear = vehicleGear, - fuel = vehicleFuel, - lights = vehicleIsLightsOn, - signals = vehicleSignalIndicator, - cruiser = vehicleCruiser, - type = vehicleClass, - siren = vehicleSiren, - seatbelt = {}, - - config = { - speedUnit = Config.vehicle.speedUnit, - maxSpeed = Config.vehicle.maxSpeed - } - } - - vehicleInfo['seatbelt']['status'] = seatbeltIsOn - else - - - vehicleCruiser = false - vehicleNailSpeed = 0 - vehicleSignalIndicator = 'off' - - seatbeltIsOn = false - - vehicleInfo = { - action = 'updateVehicle', - - status = false, - nail = vehicleNailSpeed, - seatbelt = { status = seatbeltIsOn }, - cruiser = vehicleCruiser, - signals = vehicleSignalIndicator, - type = 0, - } - - if Config.ui.showMinimap == false then - DisplayRadar(false) - end - - end - - SendNUIMessage(vehicleInfo) - - - - - - end -end) - - - - --- Player status -Citizen.CreateThread(function() - - while true do - Citizen.Wait(1000) - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - - if Config.ui.showHealth == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['isdead'] = false - - playerStatus['status'][showPlayerStatus] = { - name = 'health', - value = GetEntityHealth(GetPlayerPed(-1)) - 100 - } - - if IsEntityDead(GetPlayerPed(-1)) then - playerStatus.isdead = true - end - end - - if Config.ui.showArmor == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'armor', - value = GetPedArmour(GetPlayerPed(-1)), - } - end - - if Config.ui.showStamina == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'stamina', - value = 100 - GetPlayerSprintStaminaRemaining(PlayerId()), - } - end - - TriggerServerEvent('trew_hud_ui:getServerInfo') - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - - end -end) - - --- Overall Info -RegisterNetEvent('trew_hud_ui:setInfo') -AddEventHandler('trew_hud_ui:setInfo', function(info) - - SendNUIMessage({ action = 'setText', id = 'job', value = info['job'] }) - SendNUIMessage({ action = 'setMoney', id = 'wallet', value = info['money'] }) - SendNUIMessage({ action = 'setMoney', id = 'bank', value = info['bankMoney'] }) - SendNUIMessage({ action = 'setMoney', id = 'blackMoney', value = info['blackMoney'] }) - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - - - if Config.ui.showHunger == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'hunger', - value = info['hunger'] - } - - end - - if Config.ui.showThirst == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'thirst', - value = info['thirst'] - } - end - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - - -end) - - --- Voice detection and distance -Citizen.CreateThread(function() - - if Config.ui.showVoice == true then - - RequestAnimDict('facials@gen_male@variations@normal') - RequestAnimDict('mp_facial') - - while true do - Citizen.Wait(300) - local playerID = PlayerId() - - for _,player in ipairs(GetActivePlayers()) do - local boolTalking = NetworkIsPlayerTalking(player) - - if player ~= playerID then - if boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mic_chatter', 'mp_facial') - elseif not boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mood_normal_1', 'facials@gen_male@variations@normal') - end - end - end - end - - end -end) - - - -Citizen.CreateThread(function() - if Config.ui.showVoice == true then - - - - local isTalking = false - local voiceDistance = nil - - while true do - Citizen.Wait(1) - - - - - if NetworkIsPlayerTalking(PlayerId()) and not isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - elseif not NetworkIsPlayerTalking(PlayerId()) and isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - end - - - - if IsControlJustPressed(1, Keys[Config.voice.keys.distance]) then - - Config.voice.levels.current = (Config.voice.levels.current + 1) % 3 - - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - voiceDistance = 'whisper' - end - - SendNUIMessage({ action = 'setVoiceDistance', value = voiceDistance }) - end - - if Config.voice.levels.current == 0 then - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - voiceDistance = 'whisper' - end - - - end - - - - - - end -end) - - - - --- Weapons -Citizen.CreateThread(function() - if Config.ui.showWeapons == true then - while true do - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - local status = {} - - if IsPedArmed(player, 7) then - - local weapon = GetSelectedPedWeapon(player) - local ammoTotal = GetAmmoInPedWeapon(player,weapon) - local bool,ammoClip = GetAmmoInClip(player,weapon) - local ammoRemaining = math.floor(ammoTotal - ammoClip) - - status['armed'] = true - - for key,value in pairs(AllWeapons) do - - for keyTwo,valueTwo in pairs(AllWeapons[key]) do - if weapon == GetHashKey('weapon_'..keyTwo) then - status['weapon'] = keyTwo - - - if key == 'melee' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - if keyTwo == 'stungun' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - SendNUIMessage({ action = 'element', task = 'enable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'enable', value = 'bullets' }) - end - end - - end - end - - end - - SendNUIMessage({ action = 'setText', id = 'weapon_clip', value = ammoClip }) - SendNUIMessage({ action = 'setText', id = 'weapon_ammo', value = ammoRemaining }) - - else - status['armed'] = false - end - - SendNUIMessage({ action = 'updateWeapon', status = status }) - - end - end -end) - - - - - - - - - - - --- Everything that neededs to be at WAIT 0 -Citizen.CreateThread(function() - - while true do - Citizen.Wait(0) - - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local vehicleClass = GetVehicleClass(vehicle) - - -- Vehicle Seatbelt - if IsPedInAnyVehicle(player, false) and GetIsVehicleEngineRunning(vehicle) then - if IsControlJustReleased(0, Keys[Config.vehicle.keys.seatbelt]) and (has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8) then - seatbeltIsOn = not seatbeltIsOn - end - end - - -- Vehicle Cruiser - if IsControlJustPressed(1, Keys[Config.vehicle.keys.cruiser]) and GetPedInVehicleSeat(vehicle, -1) == player and (has_value(vehiclesCars, vehicleClass) == true) then - - local vehicleSpeedSource = GetEntitySpeed(vehicle) - - if vehicleCruiser == 'on' then - vehicleCruiser = 'off' - SetEntityMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle,"CHandlingData","fInitialDriveMaxFlatVel")) - - else - vehicleCruiser = 'on' - SetEntityMaxSpeed(vehicle, vehicleSpeedSource) - end - end - - - - - - -- Vehicle Signal Lights - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalLeft]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'left' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalRight]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'right' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalBoth]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'both' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - - end -end) - - - - - - - - - - -AddEventHandler('onClientMapStart', function() - - SendNUIMessage({ action = 'ui', config = Config.ui }) - SendNUIMessage({ action = 'setFont', url = Config.font.url, name = Config.font.name }) - SendNUIMessage({ action = 'setLogo', value = Config.serverLogo }) - - if Config.ui.showVoice == true then - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - end - end -end) - -AddEventHandler('playerSpawned', function() - if Config.ui.showVoice == true then - NetworkSetTalkerProximity(5.0) - end - - - HideHudComponentThisFrame(7) -- Area - HideHudComponentThisFrame(9) -- Street - HideHudComponentThisFrame(6) -- Vehicle - HideHudComponentThisFrame(3) -- SP Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(13) -- Cash changes! -end) - - - - - - - - - -AddEventHandler('trew_hud_ui:setCarSignalLights', function(status) - local driver = GetVehiclePedIsIn(GetPlayerPed(-1), false) - local hasTrailer,vehicleTrailer = GetVehicleTrailerVehicle(driver,vehicleTrailer) - local leftLight - local rightLight - - if status == 'left' then - leftLight = false - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'right' then - leftLight = true - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'both' then - leftLight = true - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - else - leftLight = false - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - end - - TriggerServerEvent('trew_hud_ui:syncCarLights', status) - - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) -end) - - - -RegisterNetEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(driver, status) - - if GetPlayerFromServerId(driver) ~= PlayerId() then - local driver = GetVehiclePedIsIn(GetPlayerPed(GetPlayerFromServerId(driver)), false) - - if status == 'left' then - leftLight = false - rightLight = true - - elseif status == 'right' then - leftLight = true - rightLight = false - - elseif status == 'both' then - leftLight = true - rightLight = true - - else - leftLight = false - rightLight = false - end - - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) - - end -end) - - - - - - - - - - - - - - - - - - - - - -function trewDate() - local timeString = nil - - local day = _U('day_' .. GetClockDayOfMonth()) - local weekDay = _U('weekDay_' .. GetClockDayOfWeek()) - local month = _U('month_' .. GetClockMonth()) - local day = _U('day_' .. GetClockDayOfMonth()) - local year = GetClockYear() - - - local hour = GetClockHours() - local minutes = GetClockMinutes() - local time = nil - local AmPm = '' - - - if Config.date.AmPm == true then - - if hour >= 13 and hour <= 24 then - hour = hour - 12 - AmPm = 'PM' - else - if hour == 0 or hour == 24 then - hour = 12 - end - AmPm = 'AM' - end - - end - - if hour <= 9 then - hour = '0' .. hour - end - if minutes <= 9 then - minutes = '0' .. minutes - end - - time = hour .. ':' .. minutes .. ' ' .. AmPm - - - - - local date_format = Locales[Config.Locale]['date_format'][Config.date.format] - - if Config.date.format == 'default' then - timeString = string.format( - date_format, - day, month, year - ) - elseif Config.date.format == 'simple' then - timeString = string.format( - date_format, - day, month - ) - - elseif Config.date.format == 'simpleWithHours' then - timeString = string.format( - date_format, - time, day, month - ) - elseif Config.date.format == 'withWeekday' then - timeString = string.format( - date_format, - weekDay, day, month, year - ) - elseif Config.date.format == 'withHours' then - timeString = string.format( - date_format, - time, day, month, year - ) - elseif Config.date.format == 'withWeekdayAndHours' then - timeString = string.format( - date_format, - time, weekDay, day, month, year - ) - end - - - - - return timeString -end - - - - - - -function has_value(tab, val) - for index, value in ipairs(tab) do - if value == val then - return true - end - end - - return false -end - - - - - - - - - - - - - - - - - - -local toggleui = false -RegisterCommand('toggleui', function() - if not toggleui then - SendNUIMessage({ action = 'element', task = 'disable', value = 'job' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bank' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'blackMoney' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'wallet' }) - else - - if (Config.ui.showJob == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'job' }) - end - if (Config.ui.showSocietyMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) - end - if (Config.ui.showBankMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'bank' }) - end - if (Config.ui.showBlackMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'blackMoney' }) - end - if (Config.ui.showWalletMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'wallet' }) - end - end - - toggleui = not toggleui -end) - - - - - - - - - - -exports('createStatus', function(args) - local statusCreation = { action = 'createStatus', status = args['status'], color = args['color'], icon = args['icon'] } - SendNUIMessage(statusCreation) -end) - - - - -exports('setStatus', function(args) - local playerStatus = { action = 'setStatus', status = { - { name = args['name'], value = args['value'] } - }} - SendNUIMessage(playerStatus) -end) diff --git a/VRP/trew_hud_ui/client/hansolo.lua b/VRP/trew_hud_ui/client/hansolo.lua deleted file mode 100644 index d3e85c3..0000000 --- a/VRP/trew_hud_ui/client/hansolo.lua +++ /dev/null @@ -1,8 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- - -AddEventHandler('onClientMapStart', function() -end) \ No newline at end of file diff --git a/VRP/trew_hud_ui/config.lua b/VRP/trew_hud_ui/config.lua deleted file mode 100644 index 7ac333c..0000000 --- a/VRP/trew_hud_ui/config.lua +++ /dev/null @@ -1,78 +0,0 @@ -local Config = {} - -Config.Locale = 'en' - -Config.serverLogo = 'https://i.imgur.com/AcgDL9f.png' - -Config.font = { - name = 'Montserrat', - url = 'https://fonts.googleapis.com/css?family=Montserrat:300,400,700,900&display=swap' -} - -Config.date = { - format = 'default', - AmPm = false -} - -Config.voice = { - - levels = { - default = 5.0, - shout = 12.0, - whisper = 1.0, - current = 0 - }, - - keys = { - distance = 'HOME', - } -} - - -Config.vehicle = { - speedUnit = 'KMH', - maxSpeed = 240, - - keys = { - seatbelt = 'K', - cruiser = 'CAPS', - signalLeft = 'LEFT', - signalRight = 'RIGHT', - signalBoth = 'DOWN', - } -} - -Config.ui = { - showServerLogo = true, - - showJob = true, - - showWalletMoney = true, - showBankMoney = true, - showBlackMoney = true, - - showDate = true, - showLocation = true, - showVoice = true, - - showHealth = true, - showArmor = true, - showStamina = true, - showHunger = true, - showThirst = true, - - showMinimap = false, - - showWeapons = true, - -} - - - -Config.vRP = { - items = { - blackMoney = 'dirty_money' - } -} - -return Config \ No newline at end of file diff --git a/VRP/trew_hud_ui/html/main.css b/VRP/trew_hud_ui/html/main.css deleted file mode 100644 index 0f9bb65..0000000 --- a/VRP/trew_hud_ui/html/main.css +++ /dev/null @@ -1,234 +0,0 @@ -*, *:before, *:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - - margin: 0; - padding: 0; -} - -body,html { width: 100%; height: 100%; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - -} - -body { /*background: url('https://i.imgur.com/MoYBh1e.jpg') center center no-repeat; background-size: cover;*/ } - -#ui { position: relative; width: 100%; height: 100%; overflow: hidden; } -div.separator { display: block; clear: both; width: 100%; } - - - - -.icon { display: block; position: relative; padding: 10px 8px; margin: 10px 5px 0 5px; width: 30px; height: 30px; border-radius: 100px; overflow: hidden; background: rgba(0,0,0,0.35); } - -.icon i { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #FFF; z-index: 11; font-size: 15px; } -.icon img { width: 16px; margin: -3px 0 0 0; } -.icon span { display: block; position: absolute; left: 50%; bottom: 0; transform: translate(-50%,0); width: 100%; height: 100%; } - -.icon.text { display: inline-block; overflow: visible; width: auto; padding: 0; } -.icon.text i { display: inline-block; float: left; transform: translate(0%,0%); left: 0; top: 0; position: relative; padding: 10px 8px; width: 30px; height: 30px; border-radius: 100px; color: #FFF; } -.icon.text i:before { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); } -.icon.text span { position: relative; width: auto; height: auto; left: 0; transform: translate(0,0); display: inline-block; font-size: 12px; padding: 7px 15px 0 10px; font-weight: 700; color: #FFF; } - - -.icon.dying:not(.customstatus) span { animation: trew-status-blink 500ms infinite; } -.icon.pulse i { animation: trew-pulse 500ms 1; } - - - - -.info { position: absolute; } - -.info.server { top: 45px; right: 26px; width: 90px; height: 90px; } -.info.server #server img { max-width: 100%; opacity: 0.75; } - -.info.player { top: 140px; right: 25px; text-align: right;} -.info.player #job span { font-size: 24px; color: #FFF; font-weight: 900; text-transform: uppercase; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } - - - - - -.info.player #money div[id] { float: right; } - -.info.player #money { clear: both; } -.info.player #money #wallet i { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.player #money #blackMoney i { background: linear-gradient(180deg, #474747 0%, #252525 100%); } -.info.player #money #bank i { background: linear-gradient(180deg, #c70a0a 0%, #960505 100%); } -.info.player #money #society i { background: linear-gradient(180deg, #874c14 0%, #6a3c10 100%); } - -/*.info.player #money #wallet i:before { content: '\f153'; }*/ - - -.info.player #status { clear: both; } -.info.player #status ul { margin: 10px 0 0 0; } -.info.player #status ul li { float: right;} -.info.player #status ul li#health span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.player #status ul li#armor span { background: linear-gradient(180deg, #0bcfe6 0%, #0aa3b5 100%); } -.info.player #status ul li#stamina span { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } -.info.player #status ul li#hunger span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } -.info.player #status ul li#thirst span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } -.info.player #status ul li#health.dead { animation: trew-pulse 500ms infinite; } -.info.player #status ul li#health.dead span { height: 0 !important; } -.info.player #status ul li#health.dead i.fas:before { content: '\f714'; } - -.info.vehicle { bottom: 20px; left: 50%; transform: translate(-50%,0); z-index: 11; } -.info.vehicle.active { opacity: 1; } -.info.vehicle.inactive { opacity: 0; } - - -.info.vehicle #speedometer { position: relative; width: 270px; height: 130px; } -.info.vehicle #speedometer svg { position: absolute; top: 0; left: 50%; transform: translate(-50%,0) rotate(138deg); width: 130px; } - -.info.vehicle #speedometer svg circle { display: block; fill: transparent; stroke-width: 5px; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 75; transform-origin: 50% 50%; } -.info.vehicle #speedometer svg circle.mask { stroke: rgba(0,0,0,0.35); } -.info.vehicle #speedometer svg circle.speed { stroke: url(#speed-gradient); stroke-dashoffset: 180; } -.info.vehicle #speedometer svg:first-child { z-index: 11; } - - -.info.vehicle #speedometer svg circle { transition: all 250ms linear; } -.info.vehicle #speedometer svg circle.zero { stroke: #00c3ff; stroke-dashoffset: 235; } -.info.vehicle #speedometer svg circle.twentyfive { stroke: #18b70b; stroke-dashoffset: 180; } -.info.vehicle #speedometer svg circle.fifty { stroke: #ff8000; stroke-dashoffset: 125; } -.info.vehicle #speedometer svg circle.seventyfive { stroke: #ff0000; stroke-dashoffset: 75; } - - -.info.vehicle #speedometer #vehicle-speed { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; color: #FFF;} -.info.vehicle #speedometer #vehicle-speed span { display: block; font-weight: 900; font-size: 30px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } - - .info.vehicle #speedometer #vehicle-speed strong { display: inline-block; font-size: 10px; font-weight: 900; padding: 2px 5px; border-radius: 100px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); transition: all 150ms linear; } - .info.vehicle #speedometer #vehicle-speed strong.on { background: #18b70b; } - -.info.vehicle #speedometer #vehicle-gear, -.info.vehicle #speedometer #vehicle-others { position: absolute; bottom: 0; left: 50%; width: 69px; transform: translate(-50%,0); margin: auto; border: 2px solid transparent; } - -.info.vehicle #speedometer #vehicle-gear.pulsing { animation: trew-siren 1s infinite; } - -.info.vehicle #speedometer #vehicle-gear i { top: -2px; } -.info.vehicle #speedometer #vehicle-gear span { padding: 5px 15px 0 10px; } - - -.info.vehicle #speedometer #vehicle-status-left { position: absolute; bottom: 0; left: 0; } -.info.vehicle #speedometer #vehicle-status-left ul li { float: left; } - -.info.vehicle #speedometer #vehicle-status-right { position: absolute; bottom: 0; right: 0; } -.info.vehicle #speedometer #vehicle-status-right ul li { float: left; } - -.info.vehicle #speedometer li#seatbelt span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.vehicle #speedometer li#seatbelt.on span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } - -.info.vehicle #speedometer li#fuel span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } - -.info.vehicle #speedometer li#lights.normal span, -.info.vehicle #speedometer li#lights.high span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } - -.info.vehicle #speedometer li#signals.dying span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); animation: trew-status-blink 750ms infinite; } - - - - - - - - -.info.weapon { bottom: 85px; right: 25px; } -.info.weapon.armed { display: block; opacity: 1; } -.info.weapon.unarmed { display: none; opacity: 0; } - -.info.weapon #weapon_image { float: left; width: 200px; height: 40px; text-align: left; position: relative; } -.info.weapon #weapon_image img { position: absolute; top: 50%; right: 25px; transform: translateY(-50%); height: 40px; } - -.info.weapon #weapon_bullets { color: #FFF; float: left; width: 35px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); line-height: 1; } -.info.weapon #weapon_bullets .clip { font-weight: 900; font-size: 22px; } -.info.weapon #weapon_bullets .ammo { font-weight: 700; font-size: 16px; opacity: 0.7;} - - -.info.weapon #bullets { margin: 0; float: left; margin: 5px 0 0 20px; overflow: visible; transform: scale(1.1); } -.info.weapon #bullets i { color: #FFF; float: right; height: 34px; width: 34px; border-radius: 100px; } -.info.weapon #bullets i.clone { background: none; position: absolute; float: none; top: 15px; left: inherit; left: 10px; opacity: 0; } -.info.weapon #bullets.shooting i.clone { animation: trew-bullets 250ms 1; } -.info.weapon #bullets i img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-35%); } - - - - - - -.info.radio { bottom: 19px; right: 25px; z-index: 11; } -.info.radio #voice { width: 35px; height: 35px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); text-align: center; padding: 7px 0 0 0; transition: all 0.1s linear; } - -.info.radio #voice.whisper { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } -.info.radio #voice.normal { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.radio #voice.shout { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.radio #voice i.fas { font-size: 18px; color: #FFF; } -.info.radio #voice.speak { animation: trew-soundwave 1s infinite; } - -.info.time-and-place { position: absolute; bottom: 18px; right: 65px; height: 38px; font-size: 11px; color: #FFF; background: rgba(0,0,0,0.35); border-radius: 100px; text-align: right; } - -.info.time-and-place .data { position: relative; top: 50%; transform: translate(0,-50%); } -.info.time-and-place .data div { padding: 0 25px; } - - - -@keyframes trew-siren { - 0% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } - 50% { border-color: rgba(255,0,0,1); box-shadow: 0 0 10px 10px rgba(255,0,0,0.50); } - 100% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } -} - -@keyframes trew-soundwave { - 0% { box-shadow: 0 0 0 0px rgba(255,255,255,0.75); } - 100% { box-shadow: 0 0 0 25px rgba(255,255,255,0); } -} - -@keyframes trew-status-blink { - 0% { opacity: 0; } - 50% { opacity: 1; } - 100% { opacity: 0; } -} - -@keyframes trew-pulse { - 0% { transform: scale(1); } - 25% { transform: scale(1.5); } - 100% { transform: scale(1); } -} - -@keyframes trew-speed { - 0% { stroke-dashoffset: 280; } - 50% { stroke-dashoffset: 75; } - 100% { stroke-dashoffset: 280; } -} - -@keyframes trew-bullets { - 0% { opacity: 0; } - 25% { opacity: 1; } - 100% { transform: translate(30px,-60px) rotate(90deg); opacity: 0;} -} - -@keyframes trew-rainbow{ - 100%, - 0%{ background: rgba(255,0,0,0.70); } - 8%{ background: rgba(255,127,0,0.70); } - 16%{ background: rgba(230,205,23,0.70); } - 25%{ background: rgba(127,255,0,0.70); } - 33%{ background: rgba(0,255,0,0.70); } - 41%{ background: rgba(0,255,127,0.70); } - 50%{ background: rgba(0,255,255,0.70); } - 58%{ background: rgba(0,127,255,0.70); } - 66%{ background: rgba(0,0,255,0.70); } - 75%{ background: rgba(127,0,255,0.70); } - 83%{ background: rgba(255,0,255,0.70); } - 91%{ background: rgba(255,0,127,0.70); } -} \ No newline at end of file diff --git a/VRP/trew_hud_ui/html/ui.html b/VRP/trew_hud_ui/html/ui.html deleted file mode 100644 index c1e7b7a..0000000 --- a/VRP/trew_hud_ui/html/ui.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - TREW UI - - - -
- - - - - -
- - -
-
    - - - - - -
-
- -
- - - - -
- - -
- - - - - - - -
- -
- - -
- - - - -
- - - -
- 999 - KM/H -
- - - -
- N -
- - - - - -
-
    -
  • -
  • -
-
- - -
-
    -
  • -
  • -
-
- - - -
- - - - - -
- - - - - - - - - - - - - - -
- -
- - - - - - - -
-
- - -
-
- - - -
- - - - - diff --git a/VRP/trew_hud_ui/locales/languages.lua b/VRP/trew_hud_ui/locales/languages.lua deleted file mode 100644 index 45ceb89..0000000 --- a/VRP/trew_hud_ui/locales/languages.lua +++ /dev/null @@ -1,160 +0,0 @@ -Locales = { - - --- Brazilian Portuguese -['br'] = { - ['you_are_on_location'] = 'Você está em %s', - - ['date_format'] = { - default = 'Hoje é %s de %s de %s', - simple = 'Hoje é %s de %s', - simpleWithHours = 'São %s do dia %s de %s', - withWeekday = 'Hoje é %s, %s de %s de %s', - withHours = 'São %s do dia %s de %s de %s', - withWeekdayAndHours = 'São %s de %s, %s de %s de %s' - }, - - ['weekDay_0'] = 'Domingo', - ['weekDay_1'] = 'Segunda-feira', - ['weekDay_2'] = 'Terça-feira', - ['weekDay_3'] = 'Quarta-feira', - ['weekDay_4'] = 'Quinta-feira', - ['weekDay_5'] = 'Sexta-feira', - ['weekDay_6'] = 'Sábado', - - ['day_1'] = '1', - ['day_2'] = '2', - ['day_3'] = '3', - ['day_4'] = '4', - ['day_5'] = '5', - ['day_6'] = '6', - ['day_7'] = '7', - ['day_8'] = '8', - ['day_9'] = '9', - - ['day_10'] = '10', - ['day_11'] = '11', - ['day_12'] = '12', - ['day_13'] = '13', - ['day_14'] = '14', - ['day_15'] = '15', - ['day_16'] = '16', - ['day_17'] = '17', - ['day_18'] = '18', - ['day_19'] = '19', - - ['day_20'] = '20', - ['day_21'] = '21', - ['day_22'] = '22', - ['day_23'] = '23', - ['day_24'] = '24', - ['day_25'] = '25', - ['day_26'] = '26', - ['day_27'] = '27', - ['day_28'] = '28', - ['day_29'] = '29', - - ['day_30'] = '30', - ['day_31'] = '31', - - ['month_0'] = 'Janeiro', - ['month_1'] = 'Fevereiro', - ['month_2'] = 'Março', - ['month_3'] = 'Abril', - ['month_4'] = 'Maio', - ['month_5'] = 'Junho', - ['month_6'] = 'Julho', - ['month_7'] = 'Agosto', - ['month_8'] = 'Setembro', - ['month_9'] = 'Outubro', - ['month_10'] = 'Novembro', - ['month_11'] = 'Dezembro', - - ['toggleui'] = 'Habilita/Desabilita parte da HUD', - -}, - - - --- English -['en'] = { - ['you_are_on_location'] = 'You are on %s', - - ['date_format'] = { - default = 'Today is %s of %s, %s', - simple = 'Today is %s, %s', - simpleWithHours = 'It is %s, %s, %s', - withWeekday = 'Today is %s, %s of %s, %s', - withHours = 'It is %s, %s of %s, %s', - withWeekdayAndHours = 'It is %s, %s, %s of %s, %s' - }, - - ['weekDay_0'] = 'Sunday', - ['weekDay_1'] = 'Monday', - ['weekDay_2'] = 'Tuesday', - ['weekDay_3'] = 'Wednesday', - ['weekDay_4'] = 'Thursday', - ['weekDay_5'] = 'Friday', - ['weekDay_6'] = 'Saturday', - - ['day_1'] = '1st', - ['day_2'] = '2rd', - ['day_3'] = '3rd', - ['day_4'] = '4th', - ['day_5'] = '5th', - ['day_6'] = '6th', - ['day_7'] = '7th', - ['day_8'] = '8th', - ['day_9'] = '9th', - - ['day_10'] = '10th', - ['day_11'] = '11th', - ['day_12'] = '12th', - ['day_13'] = '13th', - ['day_14'] = '14th', - ['day_15'] = '15th', - ['day_16'] = '16th', - ['day_17'] = '17th', - ['day_18'] = '18th', - ['day_19'] = '19th', - - ['day_20'] = '20th', - ['day_21'] = '21th', - ['day_22'] = '22th', - ['day_23'] = '23th', - ['day_24'] = '24th', - ['day_25'] = '25th', - ['day_26'] = '26th', - ['day_27'] = '27th', - ['day_28'] = '28th', - ['day_29'] = '29th', - - ['day_30'] = '30th', - ['day_31'] = '31th', - - ['month_0'] = 'January', - ['month_1'] = 'February', - ['month_2'] = 'March', - ['month_3'] = 'April', - ['month_4'] = 'May', - ['month_5'] = 'June', - ['month_6'] = 'July', - ['month_7'] = 'August', - ['month_8'] = 'September', - ['month_9'] = 'October', - ['month_10'] = 'November', - ['month_11'] = 'December', - - ['toggleui'] = 'Enables/Disables parts of the HUD', - -} - - - - -} - - - - -return Locales \ No newline at end of file diff --git a/VRP/trew_hud_ui/readme-en.html b/VRP/trew_hud_ui/readme-en.html deleted file mode 100644 index 9dabd21..0000000 --- a/VRP/trew_hud_ui/readme-en.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - TREW HUD UI - - - - -
-

Trew HUD UI

- -

User Interface created originally for ESX and then adapted for VRP/VRPEX.

- -

Demo

-

- - -

Installation

-
    -
  1. Extract the .zip or Open the .zip.
  2. -
  3. Place trew_hud_ui in your resources directory.
  4. -
  5. Add start trew_hud_ui to your server.cfg
  6. -
- -

Special Instructions for the ESX version

-

Requirements

- - -

Optional

- - -

What you can disable

- - -

Post Installation

-
    -
  • Go to es_extended config.lua and turn Config.EnableHud to false
  • -
  • If needed, go to esx_basicneeds main.lua and replace this code
  • -
-
-			
-	TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
-		return true
-	end, function(status)
-		status.remove(1000)
-	end)
-	
-	TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
-		return true
-	end, function(status)
-		status.remove(750)
-	end)
-			
-		
- -

for this one

- -
-			
-	TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
-		return false
-	end, function(status)
-		status.remove(1000)
-	end)
-	
-	TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
-		return false
-	end, function(status)
-		status.remove(750)
-	end)
-			
-		
- - -

Special Instructions for the VRP/VRPEX versions

- -

- Inside config.lua you will see a Config.vRP with certain items needed to set up properly, like black money. Since black money is considered an item on VRP/VRPEX versions, you need to put the ID of said item on this configuration. On most VRP versions, the ID is dirty_money. -

- -

- Config.vRP
- Special settings for vRP/vRPEX -

-
    -
  • items -
      -
    • blackMoney: The item ID for Black Money.
    • -
    -
  • -
- - -

Config.lua settings

- -

- Config.Locale
- The language. Default is en. -

- -

- Config.serverLogo
- Logo for your server. It’s suggested that you upload a PNG file to websites like imgur.com and then paste the link there. -

- -

- Config.font
- Font configuration for the UI. Default is Montserrat and the link points up to Google Fonts. It’s suggested that you look up for a font there and place the name and the link on it’s location. -

- -
    -
  • name: The name of the font
  • -
  • link: CSS Stylesheet file link for the font
  • -
- -

- Config.date
- Date format for the GPS location. -

- -
    -
  • -

    format:

    -
      -
    • default: It’s the default format;
    • -
    • withWeekDay: Format that shows week day names, like monday, tuesday, wednesday, etc;
    • -
    • withHours: Format that shows the current time in game;
    • -
    • withWeekAndHours: A mix of withWeekDay and withHours.
    • -
    • simple: Format that shows only day and month;
    • -
    • simpleWithHours: Same as simple, but also showing the time.
    • -
    -
  • -
  • -

    AmPm: set it to true if you want to use AM/PM time format, false if you don’t.

    -
  • -
- -

- Config.voice
- Voice settings for the UI. OneSync compatible -

- - -
    -
  • -

    levels:

    -
      -
    • default: Distance in meters for a default distance. Default is 5.0;
    • -
    • shout: Distance in meters for a shout distance. Default is 12.0;
    • -
    • whisper: Distance in meters for a whisper distance. Default is 1.0;
    • -
    • current: It’s important that this is left unchanged.
    • -
    -
  • -
  • -

    keys:

    -
      -
    • distance: Distance in meters for a default distance. Default is HOME.
    • -
    -
  • -
- - -

- Config.vehicle
- Vehicle and speedometer settings -

- -
    -
  • speedUnit: It should be set either KMH or MPH. Default is KMH;
  • -
  • maxSpeed: The top speed the Speedometer is allowed to go. Default is 240;
  • -
  • keys: -
      -
    • seatbelt: Buckle/unbuckle seatbelt. Default is K;
    • -
    • cruiser: Activate/deactivate cruiser speed. Default is CAPS;
    • -
    • signalLeft: Activate/deactivate car left signal. Default is LEFT;
    • -
    • signalRight: Activate/deactivate car right signal. Default is RIGHT;
    • -
    • signalBoth: Activate/deactivate car danger signal. Default is DOWN;
    • -
    -
  • -
- -

- Config.ui
- Display or hide elements of the HUD -

- -
    -
  • showJob: Displays the job name. Default is true;
  • -
  • showWalletMoney: Displays the money on your wallet. Default is true;
  • -
  • showBankMoney: Displays the money on your bank account. Default is true;
  • -
  • showBlackMoney: Displays the black money you have. Default is true;
  • -
  • showSocietyMoney: If you are the boss of a job, it displays the money you have in the society vault. Default is true; (Society money only works on ESX)
  • -
  • showDate: Displays the date. Default is true;
  • -
  • showLocation: Displays the location. Default is true;
  • -
  • showHealth: Displays your health. Default is true;
  • -
  • showArmor: Displays your armor. Default is true;
  • -
  • showStamina: Displays your stamina. Default is true;
  • -
  • showHunger: Displays hunger. Default is true;
  • -
  • showThirst: Displays thirst. Default is true;
  • -
  • showMinimap: Displays the minimap while off the vehicle. Default is false;
  • -
  • showVoice: Displays/use the voice controller. Default is true;
  • -
  • showWeapons: Displays the weapons you have on your hand, with ammo. Default is true;
  • -
- - - -

Adding Custom Status

-

-

- Check by the thirst indicator -

-

- You can create custom indicators for status you already have, like stress status, drunken, shit, piss, you name it! You would just have to use the new exports functions. I would recommend you create a new script with the code and load it below trew_hud_ui on your server.cfg. -

- -


- -

- exports.trew_hud_ui.createStatus
- Creates a new indicator after the existing ones. -

- -

Example:

-
-			
-	local STRESS_ACTIVE = false
-
-	AddEventHandler('playerSpawned', function()
-		
-		if STRESS_ACTIVE == false then
-			exports.trew_hud_ui:createStatus({
-			    status = 'stress',
-			    color = '#FF0090',
-			    icon = '<i class="fas fa-brain"></i>'
-			});
-			STRESS_ACTIVE = true
-		end
-
-	end)
-			
-		
- -

Usage:

-
    -
  • status: The status ID. It's purely to identify it;
  • -
  • color: The color you want for the status;
  • -
  • icon: The HTML code for the icon. You can search on FontAwesome for an icon and when you find one of your liking, change it there.
  • -
- - -


- -

- exports.trew_hud_ui.setStatus
- It is what makes the status update. It should be set on a Wait() timer to update on whenever your custom status is. The example below ticks while getting from a custom status registered on esx_status. -

- -

Example:

-
-			
-	Citizen.CreateThread(function()
-		while true do
-			Citizen.Wait(1000)
-			
-			local STRESS_STATUS
-	
-			TriggerEvent('esx_status:getStatus', 'stress', function(status)
-			    STRESS_STATUS = status.getPercent()
-			end)
-	
-			exports.trew_hud_ui:setStatus({
-			    name = 'stress',
-			    value = STRESS_STATUS
-			});
-		end
-	end)
-			
-		
- -

Usage:

-
    -
  • name: The name of the status. It should be correspondent with the ID when you created it;
  • -
  • value: The percentage value for the status, from 0 to 100.
  • -
- - -

Chat commands

-

- /toggleui
- Enables/Disables HUD information elements, like and job all types money. Useful for streamers. -

-

Usage example: /toggleui

- - -

Donate

-

This HUD is the product of 4 months of work, craft and creativity. While now I'm giving it for free, if you want to help, consider donating any ammount you want to. It will be really appreciated. :)

-
- - - - - -
- -
- - - - - \ No newline at end of file diff --git a/VRP/trew_hud_ui/server/milleniumfalcon.lua b/VRP/trew_hud_ui/server/milleniumfalcon.lua deleted file mode 100644 index 5752dc4..0000000 --- a/VRP/trew_hud_ui/server/milleniumfalcon.lua +++ /dev/null @@ -1,5 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- \ No newline at end of file diff --git a/VRP/trew_hud_ui/server/server.lua b/VRP/trew_hud_ui/server/server.lua deleted file mode 100644 index 996afd0..0000000 --- a/VRP/trew_hud_ui/server/server.lua +++ /dev/null @@ -1,40 +0,0 @@ -local Tunnel = module('vrp','lib/Tunnel') -local Proxy = module('vrp','lib/Proxy') -vRP = Proxy.getInterface('vRP') -local Config = module('trew_hud_ui', 'config') -local Locales = module('trew_hud_ui', 'locales/languages') - -function _U(entry) - return Locales[ Config.Locale ][entry] -end - -RegisterServerEvent('trew_hud_ui:getServerInfo') -AddEventHandler('trew_hud_ui:getServerInfo', function() - - local source = {source} - local playerID = vRP.getUserId(source) - local player = vRP.getUserSource({playerID}) - - local info = { - hunger = vRP.getHunger({playerID}), - thirst = vRP.getThirst({playerID}), - - job = vRP.getUserGroupByType({playerID, 'job'}), - - money = vRP.getMoney({playerID}), - bankMoney = vRP.getBankMoney({playerID}), - blackMoney = vRP.getInventoryItemAmount({playerID, Config.vRP.items.blackMoney}) - } - - TriggerClientEvent('trew_hud_ui:setInfo', player, info) -end) - -RegisterServerEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(status) - - local source = {source} - local playerID = vRP.getUserId(source) - local player = vRP.getUserSource({playerID}) - - TriggerClientEvent('trew_hud_ui:syncCarLights', -1, player, status) -end) diff --git a/VRP2/trew_hud_ui/client/client.lua b/VRP2/trew_hud_ui/client/client.lua deleted file mode 100644 index 0096c67..0000000 --- a/VRP2/trew_hud_ui/client/client.lua +++ /dev/null @@ -1,661 +0,0 @@ -local Config = module('trew_hud_ui', 'config') -local Locales = module('trew_hud_ui', 'locales/languages') - -local zones = { ['AIRP'] = "Los Santos International Airport", ['ALAMO'] = "Alamo Sea", ['ALTA'] = "Alta", ['ARMYB'] = "Fort Zancudo", ['BANHAMC'] = "Banham Canyon Dr", ['BANNING'] = "Banning", ['BEACH'] = "Vespucci Beach", ['BHAMCA'] = "Banham Canyon", ['BRADP'] = "Braddock Pass", ['BRADT'] = "Braddock Tunnel", ['BURTON'] = "Burton", ['CALAFB'] = "Calafia Bridge", ['CANNY'] = "Raton Canyon", ['CCREAK'] = "Cassidy Creek", ['CHAMH'] = "Chamberlain Hills", ['CHIL'] = "Vinewood Hills", ['CHU'] = "Chumash", ['CMSW'] = "Chiliad Mountain State Wilderness", ['CYPRE'] = "Cypress Flats", ['DAVIS'] = "Davis", ['DELBE'] = "Del Perro Beach", ['DELPE'] = "Del Perro", ['DELSOL'] = "La Puerta", ['DESRT'] = "Grand Senora Desert", ['DOWNT'] = "Downtown", ['DTVINE'] = "Downtown Vinewood", ['EAST_V'] = "East Vinewood", ['EBURO'] = "El Burro Heights", ['ELGORL'] = "El Gordo Lighthouse", ['ELYSIAN'] = "Elysian Island", ['GALFISH'] = "Galilee", ['GOLF'] = "GWC and Golfing Society", ['GRAPES'] = "Grapeseed", ['GREATC'] = "Great Chaparral", ['HARMO'] = "Harmony", ['HAWICK'] = "Hawick", ['HORS'] = "Vinewood Racetrack", ['HUMLAB'] = "Humane Labs and Research", ['JAIL'] = "Bolingbroke Penitentiary", ['KOREAT'] = "Little Seoul", ['LACT'] = "Land Act Reservoir", ['LAGO'] = "Lago Zancudo", ['LDAM'] = "Land Act Dam", ['LEGSQU'] = "Legion Square", ['LMESA'] = "La Mesa", ['LOSPUER'] = "La Puerta", ['MIRR'] = "Mirror Park", ['MORN'] = "Morningwood", ['MOVIE'] = "Richards Majestic", ['MTCHIL'] = "Mount Chiliad", ['MTGORDO'] = "Mount Gordo", ['MTJOSE'] = "Mount Josiah", ['MURRI'] = "Murrieta Heights", ['NCHU'] = "North Chumash", ['NOOSE'] = "N.O.O.S.E", ['OCEANA'] = "Pacific Ocean", ['PALCOV'] = "Paleto Cove", ['PALETO'] = "Paleto Bay", ['PALFOR'] = "Paleto Forest", ['PALHIGH'] = "Palomino Highlands", ['PALMPOW'] = "Palmer-Taylor Power Station", ['PBLUFF'] = "Pacific Bluffs", ['PBOX'] = "Pillbox Hill", ['PROCOB'] = "Procopio Beach", ['RANCHO'] = "Rancho", ['RGLEN'] = "Richman Glen", ['RICHM'] = "Richman", ['ROCKF'] = "Rockford Hills", ['RTRAK'] = "Redwood Lights Track", ['SANAND'] = "San Andreas", ['SANCHIA'] = "San Chianski Mountain Range", ['SANDY'] = "Sandy Shores", ['SKID'] = "Mission Row", ['SLAB'] = "Stab City", ['STAD'] = "Maze Bank Arena", ['STRAW'] = "Strawberry", ['TATAMO'] = "Tataviam Mountains", ['TERMINA'] = "Terminal", ['TEXTI'] = "Textile City", ['TONGVAH'] = "Tongva Hills", ['TONGVAV'] = "Tongva Valley", ['VCANA'] = "Vespucci Canals", ['VESP'] = "Vespucci", ['VINE'] = "Vinewood", ['WINDF'] = "Ron Alternates Wind Farm", ['WVINE'] = "West Vinewood", ['ZANCUDO'] = "Zancudo River", ['ZP_ORT'] = "Port of South Los Santos", ['ZQ_UAR'] = "Davis Quartz" } - -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} - -local AllWeapons = json.decode('{"melee":{"dagger":"0x92A27487","bat":"0x958A4A8F","bottle":"0xF9E6AA4B","crowbar":"0x84BD7BFD","unarmed":"0xA2719263","flashlight":"0x8BB05FD7","golfclub":"0x440E4788","hammer":"0x4E875F73","hatchet":"0xF9DCBF2D","knuckle":"0xD8DF3C3C","knife":"0x99B507EA","machete":"0xDD5DF8D9","switchblade":"0xDFE37640","nightstick":"0x678B81B1","wrench":"0x19044EE0","battleaxe":"0xCD274149","poolcue":"0x94117305","stone_hatchet":"0x3813FC08"},"handguns":{"pistol":"0x1B06D571","pistol_mk2":"0xBFE256D4","combatpistol":"0x5EF9FEC4","appistol":"0x22D8FE39","stungun":"0x3656C8C1","pistol50":"0x99AEEB3B","snspistol":"0xBFD21232","snspistol_mk2":"0x88374054","heavypistol":"0xD205520E","vintagepistol":"0x83839C4","flaregun":"0x47757124","marksmanpistol":"0xDC4DB296","revolver":"0xC1B3C3D1","revolver_mk2":"0xCB96392F","doubleaction":"0x97EA20B8","raypistol":"0xAF3696A1"},"smg":{"microsmg":"0x13532244","smg":"0x2BE6766B","smg_mk2":"0x78A97CD0","assaultsmg":"0xEFE7E2DF","combatpdw":"0xA3D4D34","machinepistol":"0xDB1AA450","minismg":"0xBD248B55","raycarbine":"0x476BF155"},"shotguns":{"pumpshotgun":"0x1D073A89","pumpshotgun_mk2":"0x555AF99A","sawnoffshotgun":"0x7846A318","assaultshotgun":"0xE284C527","bullpupshotgun":"0x9D61E50F","musket":"0xA89CB99E","heavyshotgun":"0x3AABBBAA","dbshotgun":"0xEF951FBB","autoshotgun":"0x12E82D3D"},"assault_rifles":{"assaultrifle":"0xBFEFFF6D","assaultrifle_mk2":"0x394F415C","carbinerifle":"0x83BF0278","carbinerifle_mk2":"0xFAD1F1C9","advancedrifle":"0xAF113F99","specialcarbine":"0xC0A3098D","specialcarbine_mk2":"0x969C3D67","bullpuprifle":"0x7F229F94","bullpuprifle_mk2":"0x84D6FAFD","compactrifle":"0x624FE830"},"machine_guns":{"mg":"0x9D07F764","combatmg":"0x7FD62962","combatmg_mk2":"0xDBBD7280","gusenberg":"0x61012683"},"sniper_rifles":{"sniperrifle":"0x5FC3C11","heavysniper":"0xC472FE2","heavysniper_mk2":"0xA914799","marksmanrifle":"0xC734385A","marksmanrifle_mk2":"0x6A6C02E0"},"heavy_weapons":{"rpg":"0xB1CA77B1","grenadelauncher":"0xA284510B","grenadelauncher_smoke":"0x4DD2DC56","minigun":"0x42BF8A85","firework":"0x7F7497E5","railgun":"0x6D544C99","hominglauncher":"0x63AB0442","compactlauncher":"0x781FE4A","rayminigun":"0xB62D1F67"},"throwables":{"grenade":"0x93E220BD","bzgas":"0xA0973D5E","smokegrenade":"0xFDBC8A50","flare":"0x497FACC3","molotov":"0x24B17070","stickybomb":"0x2C3731D9","proxmine":"0xAB564B93","snowball":"0x787F0BB","pipebomb":"0xBA45E8B8","ball":"0x23C9F95C"},"misc":{"petrolcan":"0x34A67B97","fireextinguisher":"0x60EC506","parachute":"0xFBAB5776"}}') - -function _U(entry) - return Locales[ Config.Locale ][entry] -end - -local vehiclesCars = {0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20}; - --- Hides TREW UI when it's on Pause Menu -Citizen.CreateThread(function() - local isPauseMenu = false - while true do - Citizen.Wait(0) - if IsPauseMenuActive() then -- ESC Key - if not isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = false }) - end - else - if isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = true }) - end - HideHudComponentThisFrame(1) -- Wanted Stars - HideHudComponentThisFrame(2) -- Weapon Icon - HideHudComponentThisFrame(3) -- Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(6) -- Vehicle Name - HideHudComponentThisFrame(7) -- Area Name - HideHudComponentThisFrame(8) -- Vehicle Class - HideHudComponentThisFrame(9) -- Street Name - HideHudComponentThisFrame(13) -- Cash Change - HideHudComponentThisFrame(17) -- Save Game - HideHudComponentThisFrame(20) -- Weapon Stats - end - end -end) --- Date and time update -Citizen.CreateThread(function() - while true do - Citizen.Wait(1000) - if Config.ui.showDate == true then - SendNUIMessage({ action = 'setText', id = 'date', value = trewDate() }) - end - end -end) --- Location update -Citizen.CreateThread(function() - while true do - Citizen.Wait(100) - local player = GetPlayerPed(-1) - local position = GetEntityCoords(player) - if Config.ui.showLocation == true then - local zoneNameFull = zones[GetNameOfZone(position.x, position.y, position.z)] - local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(position.x, position.y, position.z)) - - local locationMessage = nil - if zoneNameFull then - locationMessage = streetName .. ', ' .. zoneNameFull - else - locationMessage = streetName - end - locationMessage = string.format( - Locales[Config.Locale]['you_are_on_location'], - locationMessage - ) - SendNUIMessage({ action = 'setText', id = 'location', value = locationMessage }) - end - end -end) - - --- Vehicle Info -local vehicleCruiser -local vehicleSignalIndicator = 'off' -local seatbeltEjectSpeed = 45.0 -local seatbeltEjectAccel = 100.0 -local seatbeltIsOn = false -local currSpeed = 0.0 -local prevVelocity = {x = 0.0, y = 0.0, z = 0.0} - -Citizen.CreateThread(function() - while true do - Citizen.Wait(100) - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local position = GetEntityCoords(player) - local vehicleIsOn = GetIsVehicleEngineRunning(vehicle) - local vehicleInfo - if IsPedInAnyVehicle(player, false) and vehicleIsOn then - local vehicleClass = GetVehicleClass(vehicle) - if Config.ui.showMinimap == false then - DisplayRadar(true) - end - -- Vehicle Speed - local vehicleSpeedSource = GetEntitySpeed(vehicle) - local vehicleSpeed - if (ShouldUseMetricMeasurements()) then - -- Speed set to MPH - Config.vehicle.speedUnit = "MPH" - else - -- Speed set to KHM - Config.vehicle.speedUnit = "KMH" - end - - if Config.vehicle.speedUnit == 'MPH' then - vehicleSpeed = math.ceil(vehicleSpeedSource * 2.237) - else - vehicleSpeed = math.ceil(vehicleSpeedSource * 3.6) - end - - -- Vehicle Gradient Speed - local vehicleNailSpeed - - if vehicleSpeed > Config.vehicle.maxSpeed then - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(Config.vehicle.maxSpeed * 205) / Config.vehicle.maxSpeed) ) - else - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(vehicleSpeed * 205) / Config.vehicle.maxSpeed) ) - end - - -- Vehicle Fuel and Gear - local vehicleFuel - vehicleFuel = GetVehicleFuelLevel(vehicle) - - local vehicleGear = GetVehicleCurrentGear(vehicle) - - if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then - vehicleGear = 'N' - elseif vehicleSpeed > 0 and vehicleGear == 0 then - vehicleGear = 'R' - end - - -- Vehicle Lights - local vehicleVal,vehicleLights,vehicleHighlights = GetVehicleLightsState(vehicle) - local vehicleIsLightsOn - if vehicleLights == 1 and vehicleHighlights == 0 then - vehicleIsLightsOn = 'normal' - elseif (vehicleLights == 1 and vehicleHighlights == 1) or (vehicleLights == 0 and vehicleHighlights == 1) then - vehicleIsLightsOn = 'high' - else - vehicleIsLightsOn = 'off' - end - - -- Vehicle Siren - local vehicleSiren - - if IsVehicleSirenOn(vehicle) then - vehicleSiren = true - else - vehicleSiren = false - end - -- Vehicle Seatbelt - if has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8 then - local prevSpeed = currSpeed - currSpeed = vehicleSpeedSource - SetPedConfigFlag(PlayerPedId(), 32, true) - if not seatbeltIsOn then - local vehIsMovingFwd = GetEntitySpeedVector(vehicle, true).y > 1.0 - local vehAcc = (prevSpeed - currSpeed) / GetFrameTime() - if (vehIsMovingFwd and (prevSpeed > (seatbeltEjectSpeed/2.237)) and (vehAcc > (seatbeltEjectAccel*9.81))) then - - SetEntityCoords(player, position.x, position.y, position.z - 0.47, true, true, true) - SetEntityVelocity(player, prevVelocity.x, prevVelocity.y, prevVelocity.z) - SetPedToRagdoll(player, 1000, 1000, 0, 0, 0, 0) - else - -- Update previous velocity for ejecting player - prevVelocity = GetEntityVelocity(vehicle) - end - - else - DisableControlAction(0, 75) - end - end - vehicleInfo = { - action = 'updateVehicle', - status = true, - speed = vehicleSpeed, - nail = vehicleNailSpeed, - gear = vehicleGear, - fuel = vehicleFuel, - lights = vehicleIsLightsOn, - signals = vehicleSignalIndicator, - cruiser = vehicleCruiser, - type = vehicleClass, - siren = vehicleSiren, - seatbelt = {}, - config = { - speedUnit = Config.vehicle.speedUnit, - maxSpeed = Config.vehicle.maxSpeed - } - } - vehicleInfo['seatbelt']['status'] = seatbeltIsOn - else - vehicleCruiser = false - vehicleNailSpeed = 0 - vehicleSignalIndicator = 'off' - seatbeltIsOn = false - vehicleInfo = { - action = 'updateVehicle', - status = false, - nail = vehicleNailSpeed, - seatbelt = { status = seatbeltIsOn }, - cruiser = vehicleCruiser, - signals = vehicleSignalIndicator, - type = 0, - } - if Config.ui.showMinimap == false then - DisplayRadar(false) - end - end - - SendNUIMessage(vehicleInfo) - end -end) - --- Player status -Citizen.CreateThread(function() - while true do - Citizen.Wait(1000) - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - if Config.ui.showHealth == true then - showPlayerStatus = (showPlayerStatus + 1) - playerStatus['isdead'] = false - playerStatus['status'][showPlayerStatus] = { - name = 'health', - value = GetEntityHealth(GetPlayerPed(-1)) - 100 - } - if IsEntityDead(GetPlayerPed(-1)) then - playerStatus.isdead = true - end - end - if Config.ui.showArmor == true then - showPlayerStatus = (showPlayerStatus+1) - playerStatus['status'][showPlayerStatus] = { - name = 'armor', - value = GetPedArmour(GetPlayerPed(-1)), - } - end - if Config.ui.showStamina == true then - showPlayerStatus = (showPlayerStatus+1) - playerStatus['status'][showPlayerStatus] = { - name = 'stamina', - value = 100 - GetPlayerSprintStaminaRemaining(PlayerId()), - } - end - TriggerServerEvent('trew_hud_ui:getServerInfo') - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - end -end) - --- Overall Info -RegisterNetEvent('trew_hud_ui:setInfo') -AddEventHandler('trew_hud_ui:setInfo', function(info) - - SendNUIMessage({ action = 'setText', id = 'job', value = info['job'] }) - SendNUIMessage({ action = 'setMoney', id = 'wallet', value = info['money'] }) - SendNUIMessage({ action = 'setMoney', id = 'bank', value = info['bankMoney'] }) - SendNUIMessage({ action = 'setMoney', id = 'blackMoney', value = info['blackMoney'] }) - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - if Config.ui.showHunger == true then - showPlayerStatus = (showPlayerStatus+1) - playerStatus['status'][showPlayerStatus] = { - name = 'hunger', - value = info['hunger'] - } - end - - if Config.ui.showThirst == true then - showPlayerStatus = (showPlayerStatus+1) - playerStatus['status'][showPlayerStatus] = { - name = 'thirst', - value = info['thirst'] - } - end - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end -end) - --- Voice detection and distance -Citizen.CreateThread(function() - if Config.ui.showVoice == true then - RequestAnimDict('facials@gen_male@variations@normal') - RequestAnimDict('mp_facial') - while true do - Citizen.Wait(300) - local playerID = PlayerId() - for _,player in ipairs(GetActivePlayers()) do - local boolTalking = NetworkIsPlayerTalking(player) - if player ~= playerID then - if boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mic_chatter', 'mp_facial') - elseif not boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mood_normal_1', 'facials@gen_male@variations@normal') - end - end - end - end - end -end) - -Citizen.CreateThread(function() - if Config.ui.showVoice == true then - local isTalking = false - local voiceDistance = nil - while true do - Citizen.Wait(1) - if NetworkIsPlayerTalking(PlayerId()) and not isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - elseif not NetworkIsPlayerTalking(PlayerId()) and isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - end - - if IsControlJustPressed(1, Keys[Config.voice.keys.distance]) then - Config.voice.levels.current = (Config.voice.levels.current + 1) % 3 - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - voiceDistance = 'whisper' - end - - SendNUIMessage({ action = 'setVoiceDistance', value = voiceDistance }) - end - - if Config.voice.levels.current == 0 then - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - voiceDistance = 'whisper' - end - end - end -end) - --- Weapons -Citizen.CreateThread(function() - if Config.ui.showWeapons == true then - while true do - Citizen.Wait(100) - local player = GetPlayerPed(-1) - local status = {} - if IsPedArmed(player, 7) then - local weapon = GetSelectedPedWeapon(player) - local ammoTotal = GetAmmoInPedWeapon(player,weapon) - local bool,ammoClip = GetAmmoInClip(player,weapon) - local ammoRemaining = math.floor(ammoTotal - ammoClip) - status['armed'] = true - for key,value in pairs(AllWeapons) do - for keyTwo,valueTwo in pairs(AllWeapons[key]) do - if weapon == GetHashKey('weapon_'..keyTwo) then - status['weapon'] = keyTwo - if key == 'melee' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - if keyTwo == 'stungun' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - SendNUIMessage({ action = 'element', task = 'enable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'enable', value = 'bullets' }) - end - end - end - end - end - SendNUIMessage({ action = 'setText', id = 'weapon_clip', value = ammoClip }) - SendNUIMessage({ action = 'setText', id = 'weapon_ammo', value = ammoRemaining }) - else - status['armed'] = false - end - SendNUIMessage({ action = 'updateWeapon', status = status }) - end - end -end) - --- Everything that neededs to be at WAIT 0 -Citizen.CreateThread(function() - while true do - Citizen.Wait(0) - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local vehicleClass = GetVehicleClass(vehicle) - -- Vehicle Seatbelt - if IsPedInAnyVehicle(player, false) and GetIsVehicleEngineRunning(vehicle) then - if IsControlJustReleased(0, Keys[Config.vehicle.keys.seatbelt]) and (has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8) then - seatbeltIsOn = not seatbeltIsOn - end - end - -- Vehicle Cruiser - if IsControlJustPressed(1, Keys[Config.vehicle.keys.cruiser]) and GetPedInVehicleSeat(vehicle, -1) == player and (has_value(vehiclesCars, vehicleClass) == true) then - local vehicleSpeedSource = GetEntitySpeed(vehicle) - if vehicleCruiser == 'on' then - vehicleCruiser = 'off' - SetEntityMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle,"CHandlingData","fInitialDriveMaxFlatVel")) - else - vehicleCruiser = 'on' - SetEntityMaxSpeed(vehicle, vehicleSpeedSource) - end - end - -- Vehicle Signal Lights - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalLeft]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'left' - else - vehicleSignalIndicator = 'off' - end - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalRight]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'right' - else - vehicleSignalIndicator = 'off' - end - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalBoth]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'both' - else - vehicleSignalIndicator = 'off' - end - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - end -end) - -AddEventHandler('onClientMapStart', function() - SendNUIMessage({ action = 'ui', config = Config.ui }) - SendNUIMessage({ action = 'setFont', url = Config.font.url, name = Config.font.name }) - SendNUIMessage({ action = 'setLogo', value = Config.serverLogo }) - - if Config.ui.showVoice == true then - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - end - end -end) - -AddEventHandler('playerSpawned', function() - if Config.ui.showVoice == true then - NetworkSetTalkerProximity(5.0) - end - HideHudComponentThisFrame(7) -- Area - HideHudComponentThisFrame(9) -- Street - HideHudComponentThisFrame(6) -- Vehicle - HideHudComponentThisFrame(3) -- SP Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(13) -- Cash changes! -end) - - -AddEventHandler('trew_hud_ui:setCarSignalLights', function(status) - local driver = GetVehiclePedIsIn(GetPlayerPed(-1), false) - local hasTrailer,vehicleTrailer = GetVehicleTrailerVehicle(driver,vehicleTrailer) - local leftLight - local rightLight - if status == 'left' then - leftLight = false - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'right' then - leftLight = true - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'both' then - leftLight = true - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - else - leftLight = false - rightLight = false - if hasTrailer then driver = vehicleTrailer end - end - TriggerServerEvent('trew_hud_ui:syncCarLights', status) - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) -end) - - - -RegisterNetEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(driver, status) - if GetPlayerFromServerId(driver) ~= PlayerId() then - local driver = GetVehiclePedIsIn(GetPlayerPed(GetPlayerFromServerId(driver)), false) - - if status == 'left' then - leftLight = false - rightLight = true - - elseif status == 'right' then - leftLight = true - rightLight = false - - elseif status == 'both' then - leftLight = true - rightLight = true - - else - leftLight = false - rightLight = false - end - - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) - - end -end) - -function trewDate() - local timeString = nil - - local day = _U('day_' .. GetClockDayOfMonth()) - local weekDay = _U('weekDay_' .. GetClockDayOfWeek()) - local month = _U('month_' .. GetClockMonth()) - local day = _U('day_' .. GetClockDayOfMonth()) - local year = GetClockYear() - local hour = GetClockHours() - local minutes = GetClockMinutes() - local time = nil - local AmPm = '' - - if Config.date.AmPm == true then - if hour >= 13 and hour <= 24 then - hour = hour - 12 - AmPm = 'PM' - else - if hour == 0 or hour == 24 then - hour = 12 - end - AmPm = 'AM' - end - end - - if hour <= 9 then - hour = '0' .. hour - end - if minutes <= 9 then - minutes = '0' .. minutes - end - time = hour .. ':' .. minutes .. ' ' .. AmPm - local date_format = Locales[Config.Locale]['date_format'][Config.date.format] - if Config.date.format == 'default' then - timeString = string.format( - date_format, - day, month, year - ) - elseif Config.date.format == 'simple' then - timeString = string.format( - date_format, - day, month - ) - elseif Config.date.format == 'simpleWithHours' then - timeString = string.format( - date_format, - time, day, month - ) - elseif Config.date.format == 'withWeekday' then - timeString = string.format( - date_format, - weekDay, day, month, year - ) - elseif Config.date.format == 'withHours' then - timeString = string.format( - date_format, - time, day, month, year - ) - elseif Config.date.format == 'withWeekdayAndHours' then - timeString = string.format( - date_format, - time, weekDay, day, month, year - ) - end - return timeString -end - -function has_value(tab, val) - for index, value in ipairs(tab) do - if value == val then - return true - end - end - - return false -end - -local toggleui = false -RegisterCommand('toggleui', function() - if not toggleui then - SendNUIMessage({ action = 'element', task = 'disable', value = 'job' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bank' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'blackMoney' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'wallet' }) - else - - if (Config.ui.showJob == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'job' }) - end - if (Config.ui.showSocietyMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) - end - if (Config.ui.showBankMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'bank' }) - end - if (Config.ui.showBlackMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'blackMoney' }) - end - if (Config.ui.showWalletMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'wallet' }) - end - end - - toggleui = not toggleui -end) - -exports('createStatus', function(args) - local statusCreation = { action = 'createStatus', status = args['status'], color = args['color'], icon = args['icon'] } - SendNUIMessage(statusCreation) -end) - - -exports('setStatus', function(args) - local playerStatus = { action = 'setStatus', status = { - { name = args['name'], value = args['value'] } - }} - SendNUIMessage(playerStatus) -end) diff --git a/VRP2/trew_hud_ui/client/hansolo.lua b/VRP2/trew_hud_ui/client/hansolo.lua deleted file mode 100644 index c40278f..0000000 --- a/VRP2/trew_hud_ui/client/hansolo.lua +++ /dev/null @@ -1,8 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- - -AddEventHandler('onClientMapStart', function() -end) \ No newline at end of file diff --git a/VRP2/trew_hud_ui/config.lua b/VRP2/trew_hud_ui/config.lua deleted file mode 100644 index ef0cee0..0000000 --- a/VRP2/trew_hud_ui/config.lua +++ /dev/null @@ -1,77 +0,0 @@ -local Config = {} - -Config.Locale = 'en' - -Config.serverLogo = 'https://i.imgur.com/AcgDL9f.png' - -Config.font = { - name = 'Montserrat', - url = 'https://fonts.googleapis.com/css?family=Montserrat:300,400,700,900&display=swap' -} - -Config.date = { - format = 'default', - AmPm = false -} - -Config.voice = { - - levels = { - default = 5.0, - shout = 12.0, - whisper = 1.0, - current = 0 - }, - - keys = { - distance = 'HOME', - } -} - -Config.vehicle = { - speedUnit = 'KMH', -- Speedometer uses MPH or KMH based on players game settings (settings -> display -> measurement system) - maxSpeed = 240, - - keys = { - seatbelt = 'K', - cruiser = 'CAPS', - signalLeft = 'LEFT', - signalRight = 'RIGHT', - signalBoth = 'DOWN', - } -} - -Config.ui = { - showServerLogo = true, - - showJob = true, - - showWalletMoney = true, - showBankMoney = true, - showBlackMoney = false, - - showDate = true, - showLocation = true, - showVoice = false, - - showHealth = true, - showArmor = true, - showStamina = true, - showHunger = true, - showThirst = true, - - showMinimap = true, - - showWeapons = true, - -} - - - -Config.vRP = { - items = { - blackMoney = 'dirty_money' - } -} - -return Config diff --git a/VRP2/trew_hud_ui/html/app.js b/VRP2/trew_hud_ui/html/app.js deleted file mode 100644 index d5ed845..0000000 --- a/VRP2/trew_hud_ui/html/app.js +++ /dev/null @@ -1,360 +0,0 @@ -function rgba(hex,opacity){ - hex = hex.replace('#',''); - redColor = parseInt(hex.substring(0,2), 16); - greenColor = parseInt(hex.substring(2,4), 16); - blueColor = parseInt(hex.substring(4,6), 16); - - result = 'rgba('+redColor+','+greenColor+','+blueColor+','+opacity/100+')'; - return result; -} - -var loadJS = function(url, implementationCode, location) { - var scriptTag = document.createElement('script'); - scriptTag.src = url; - - scriptTag.onload = implementationCode; - scriptTag.onreadystatechange = implementationCode; - - location.appendChild(scriptTag); -}; - -function ajaxio(method,url,type=null,data=null) { - return new Promise((resolve, reject) => { - const req = new XMLHttpRequest(); - req.open(method, url, true); - - if (method == 'POST') { - if (type == 'json' && data != null) { - req.setRequestHeader('Content-Type', 'application/json'); - var data = JSON.stringify(data); - } - else { req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } - } - - req.onload = () => req.status === 200 ? resolve(req.response) : reject(Error(req.statusText)); - req.onerror = (e) => reject(Error(`Network Error: ${e}`)); - - if (method == 'POST') { req.send(data); } - else { req.send(); } - }); -} - - -Object.prototype.addMultiListener = function(eventNames, listener) { - var events = eventNames.split(' '); - - if (NodeList.prototype.isPrototypeOf(this) == true) { - for (var x=0, xLen=this.length; x'; - if (document.getElementById(statusID)) { } - else { - var newStatus = document.createElement('li'); - newStatus.classList.add('icon', 'customstatus'); - newStatus.id = statusID; - motherStatus.insertBefore(newStatus, motherStatus.firstChild); - saferInnerHTML(document.getElementById(statusID), statusIcon); - } - }, - - setStatus: function(data) { - if (data.isdead == true) { - if (document.querySelector('#health').classList.contains('dead') == false) { - document.querySelector('#health').classList.add('dead'); - for (i = 0; i < data.status.length; i++) { document.querySelector('#'+data.status[i].name+' span').style.height = '0'; } - } - } - else { - for (i = 0; i < data.status.length; i++) { - if ((data.status[i].name == 'hunger') || (data.status[i].name == 'thirst')) { var statusValue = Math.floor(100 - data.status[i].value); } - else { var statusValue = Math.floor(data.status[i].value); } - if (document.querySelector('#'+data.status[i].name+' span')) { document.querySelector('#'+data.status[i].name+' span').style.height = statusValue+'%'; } - if (statusValue <= 35) { - if (document.querySelector('#'+data.status[i].name)) { - if (document.querySelector('#'+data.status[i].name).classList.contains('dying') == false) { - document.querySelector('#'+data.status[i].name).classList.add('dying'); - } - } - } - else { - if (document.querySelector('#'+data.status[i].name)) { document.querySelector('#'+data.status[i].name).classList.remove('dying'); } - - } - } - if (document.querySelector('#health').classList.contains('dead')) { document.querySelector('#health').classList.remove('dead'); } - } - }, - - updateWeapon: function(data) { - var weaponContainer = document.querySelector('#weapon'); - var bulletsContainer = document.querySelector('#bullets'); - - if (data.status.armed == true) { - - var oldWeapon = document.querySelector('#weapon_image img').src; - var newWeapon = 'img/weapons/'+data.status.weapon+'.png'; - if (oldWeapon != newWeapon) { document.querySelector('#weapon_image img').src = newWeapon; } - - if (weaponContainer.classList.contains('armed') == false) { - weaponContainer.classList.remove('unarmed', 'fadeOut'); - weaponContainer.classList.add('armed', 'fadeIn'); - } - - } - else { - - if (weaponContainer.classList.contains('unarmed') == false) { - weaponContainer.classList.remove('armed', 'fadeIn'); - weaponContainer.classList.add('unarmed', 'fadeOut'); - } - - } - }, - - updateVehicle: function(data) { - var vehicleInfo = document.querySelector('.info.vehicle'); - var vehicleSeatbelt = document.querySelector('#seatbelt'); - var vehicleLights = document.querySelector('#lights'); - var vehicleSignals = document.querySelector('#signals'); - var vehicleFuel = document.querySelector('#fuel'); - var vehicleCruiser = document.querySelector('#vehicle-speed strong'); - var vehiclesCars = [0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20]; - if (data.status == true) { - if (vehicleInfo.classList.contains('inactive')) { - vehicleSeatbelt.style.display = 'none'; - vehicleLights.style.display = 'none'; - vehicleSignals.style.display = 'none'; - vehicleFuel.style.display = 'none'; - - if (vehiclesCars.indexOf(data.type) > -1) { - document.querySelector('#vehicle-others').style.display = 'none'; - document.querySelector('#vehicle-gear').style.display = 'block'; - - vehicleSeatbelt.style.display = 'block'; - vehicleLights.style.display = 'block'; - vehicleSignals.style.display = 'block'; - vehicleFuel.style.display = 'block'; - - document.querySelector('#vehicle-gear').style.display = 'block'; - } - else { - document.querySelector('#vehicle-others').style.display = 'block'; - document.querySelector('#vehicle-gear').style.display = 'none'; - document.querySelector('#vehicle-others i').classList.remove('fa-biking', 'fa-helicopter', 'fa-ship'); - if (data.type == 13) { document.querySelector('#vehicle-others i').classList.add('fa-biking'); } - else if (data.type == 14) { document.querySelector('#vehicle-others i').classList.add('fa-ship'); } - else if (data.type == 15) { document.querySelector('#vehicle-others i').classList.add('fa-helicopter'); } - else if (data.type == 16) { document.querySelector('#vehicle-others i').classList.add('fa-plane'); } - else if (data.type == 21) { document.querySelector('#vehicle-others i').classList.add('fa-train'); } - } - vehicleInfo.classList.remove('inactive'); - vehicleInfo.classList.add('active', 'fadeIn'); - } - if (vehicleInfo.classList.contains('updated') == false) { - - var vehicleSpeedUnit = data.config.speedUnit.slice(0,2)+'/'+data.config.speedUnit.slice(-1); - var vehicleAverageSpeed = Math.ceil(data.config.maxSpeed / 6); - vehicleInfo.classList.add('updated'); - saferInnerHTML(vehicleCruiser,vehicleSpeedUnit); - } - - var previousGear = document.querySelector('#vehicle-gear span').innerHTML; - var currentGear = data.gear; - if (previousGear != currentGear) { document.querySelector('#vehicle-gear').classList.add('pulse') } - - saferInnerHTML(document.querySelector('#vehicle-gear span'), data.gear); - var speedometerCircle = document.querySelector('#progress-speed svg circle.speed'); - var speedPercentage = Math.floor(Math.floor(data.speed*100)/data.config.maxSpeed); - - speedometerCircle.classList.remove('zero'); - speedometerCircle.classList.remove('twentyfive'); - speedometerCircle.classList.remove('fifty'); - speedometerCircle.classList.remove('seventyfive'); - - if (speedPercentage >= 0 && speedPercentage <= 25) { speedometerCircle.classList.add('zero'); } - else if (speedPercentage > 25 && speedPercentage <= 50) { speedometerCircle.classList.add('twentyfive'); } - else if (speedPercentage > 50 && speedPercentage <= 75) { speedometerCircle.classList.add('fifty'); } - else if (speedPercentage > 75) { speedometerCircle.classList.add('seventyfive'); } - - document.querySelector('#progress-speed svg circle.speed').style.strokeDashoffset = data.nail; - saferInnerHTML(document.querySelector('#vehicle-speed span'), data.speed); - - if ( (data.seatbelt.status == true) && (vehicleSeatbelt.classList.contains('on') == false) ) { - vehicleSeatbelt.classList.remove('off'); - vehicleSeatbelt.classList.add('on'); - - eventCallback.sound('sounds/seatbelt-buckle.ogg', { volume: '0.50' }); - } - else if ( (data.seatbelt.status == false) && (vehicleSeatbelt.classList.contains('off') == false) ) { - vehicleSeatbelt.classList.remove('on'); - vehicleSeatbelt.classList.add('off'); - eventCallback.sound('sounds/seatbelt-unbuckle.ogg', { volume: '0.50' }); - } - - if (vehicleCruiser.classList.contains(data.cruiser) == false) { - vehicleCruiser.classList.remove('on','off'); - vehicleCruiser.classList.add(data.cruiser); - } - if (data.siren == true) { document.querySelector('#vehicle-gear').classList.add('pulsing'); } - else { document.querySelector('#vehicle-gear').classList.remove('pulsing'); } - - if (vehicleLights.classList.contains(data.lights) == false) { - vehicleLights.classList.remove('normal','high','off'); - vehicleLights.classList.add(data.lights); - if (data.lights == 'high') { vehicleLights.querySelector('i img').src = 'img/vehicle-lights-high.png'; } - else { vehicleLights.querySelector('i img').src = 'img/vehicle-lights.png'; } - } - if (vehicleSignals.classList.contains(data.signals) == false) { - vehicleSignals.querySelector('i').className = 'fa fa-arrows-alt-h'; - vehicleSignals.classList.remove('left','right','both','off'); - if ( (data.signals == 'left') || (data.signals == 'right') || (data.signals == 'both') ) { - var classSignal = 'fa-long-arrow-alt-'+data.signals; - if (data.signals == 'both') { classSignal = 'fa-arrows-alt-h'; } - vehicleSignals.querySelector('i').classList.add('fas',classSignal); - vehicleSignals.classList.add(data.signals, 'dying'); - eventCallback.sound('sounds/car-indicators.ogg', { loop: 'loop' }); - } - else if (data.signals == 'off') { - vehicleSignals.querySelector('i').classList.add('fas','fa-arrows-alt-h'); - vehicleSignals.classList.remove('dying'); - vehicleSignals.classList.add(data.signals); - eventCallback.sound(); - } - } - vehicleFuel.querySelector('span').style.height = data.fuel+'%'; - if (data.fuel <= 35) { - if (vehicleFuel.classList.contains('dying') == false) { vehicleFuel.classList.add('dying'); } - } - else { vehicleFuel.classList.remove('dying'); } - } - else { - if (vehicleInfo.classList.contains('active')) { - vehicleSeatbelt.classList.remove('on'); - vehicleCruiser.classList.remove('on'); - vehicleInfo.classList.remove('active'); - vehicleInfo.classList.add('inactive', 'fadeOut'); - eventCallback.sound(); - } - } - - }, - toggleUi: function(data) { - var uiID = document.querySelector('#ui'); - if (data.value == true) { - uiID.style.display = 'block'; - } - else { - uiID.style.display = 'none'; - } - }, - sound: function(file = null, args = null) { - var sound = document.querySelector('#sounds'); - var soundFile = file; - var args = args; - - for (i = 0; i < sound.attributes.length; i++) { - if (sound.attributes[i].name != 'id') { sound.removeAttribute(sound.attributes[i].name); } - } - if (soundFile == null) { sound.setAttribute('src', ''); } - else { - if (args == null) { } - else { - for (var key in args) { - if (key != 'addMultiListener') { - if (key == 'volume') { sound.volume = args[key]; } - else { sound.setAttribute(key, args[key]); } - } - } - } - sound.setAttribute('src', soundFile); - sound.play(); - } - }, - }; - - document.querySelectorAll('.icon i').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { this.parentElement.classList.remove('pulse'); this.parentElement.classList.remove('shooting'); }); - - document.querySelectorAll('.info.vehicle').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { - this.classList.remove('fadeOut', 'fadeIn'); - }); - window.addEventListener('message', function(event) { - eventCallback[event.data.action](event.data); - }); -} diff --git a/VRP2/trew_hud_ui/html/img/vehicle-gear.png b/VRP2/trew_hud_ui/html/img/vehicle-gear.png deleted file mode 100644 index d001954..0000000 Binary files a/VRP2/trew_hud_ui/html/img/vehicle-gear.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/vehicle-lights-high.png b/VRP2/trew_hud_ui/html/img/vehicle-lights-high.png deleted file mode 100644 index a7f8325..0000000 Binary files a/VRP2/trew_hud_ui/html/img/vehicle-lights-high.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/vehicle-lights.png b/VRP2/trew_hud_ui/html/img/vehicle-lights.png deleted file mode 100644 index c0cd51b..0000000 Binary files a/VRP2/trew_hud_ui/html/img/vehicle-lights.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/vehicle-seatbelt.png b/VRP2/trew_hud_ui/html/img/vehicle-seatbelt.png deleted file mode 100644 index c05edd8..0000000 Binary files a/VRP2/trew_hud_ui/html/img/vehicle-seatbelt.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapon-bullets.png b/VRP2/trew_hud_ui/html/img/weapon-bullets.png deleted file mode 100644 index b0b1d4e..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapon-bullets.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/advancedrifle.png b/VRP2/trew_hud_ui/html/img/weapons/advancedrifle.png deleted file mode 100644 index 282aa82..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/advancedrifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/appistol.png b/VRP2/trew_hud_ui/html/img/weapons/appistol.png deleted file mode 100644 index 7be7761..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/appistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/assaultrifle.png b/VRP2/trew_hud_ui/html/img/weapons/assaultrifle.png deleted file mode 100644 index 40c4bee..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/assaultrifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png deleted file mode 100644 index b9b7517..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/assaultshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/assaultshotgun.png deleted file mode 100644 index 822d832..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/assaultshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/assaultsmg.png b/VRP2/trew_hud_ui/html/img/weapons/assaultsmg.png deleted file mode 100644 index d787be5..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/assaultsmg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/autoshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/autoshotgun.png deleted file mode 100644 index a27c195..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/autoshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/ball.png b/VRP2/trew_hud_ui/html/img/weapons/ball.png deleted file mode 100644 index aa66e26..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/ball.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/bat.png b/VRP2/trew_hud_ui/html/img/weapons/bat.png deleted file mode 100644 index f215038..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/bat.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/battleaxe.png b/VRP2/trew_hud_ui/html/img/weapons/battleaxe.png deleted file mode 100644 index 99542b3..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/battleaxe.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/bottle.png b/VRP2/trew_hud_ui/html/img/weapons/bottle.png deleted file mode 100644 index 2743bc6..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/bottle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/bullpuprifle.png b/VRP2/trew_hud_ui/html/img/weapons/bullpuprifle.png deleted file mode 100644 index ddc0657..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/bullpuprifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png deleted file mode 100644 index a7a1681..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/bullpupshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/bullpupshotgun.png deleted file mode 100644 index 285a487..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/bullpupshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/bzgas.png b/VRP2/trew_hud_ui/html/img/weapons/bzgas.png deleted file mode 100644 index 49cc6a5..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/bzgas.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/carbinerifle.png b/VRP2/trew_hud_ui/html/img/weapons/carbinerifle.png deleted file mode 100644 index 7f5f213..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/carbinerifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png deleted file mode 100644 index 63368f2..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/combatmg.png b/VRP2/trew_hud_ui/html/img/weapons/combatmg.png deleted file mode 100644 index 81fd9bc..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/combatmg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/combatmg_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/combatmg_mk2.png deleted file mode 100644 index 0799024..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/combatmg_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/combatpdw.png b/VRP2/trew_hud_ui/html/img/weapons/combatpdw.png deleted file mode 100644 index 89b8dff..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/combatpdw.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/combatpistol.png b/VRP2/trew_hud_ui/html/img/weapons/combatpistol.png deleted file mode 100644 index e586f69..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/combatpistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/compactlauncher.png b/VRP2/trew_hud_ui/html/img/weapons/compactlauncher.png deleted file mode 100644 index b879d34..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/compactlauncher.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/compactrifle.png b/VRP2/trew_hud_ui/html/img/weapons/compactrifle.png deleted file mode 100644 index 6897cd4..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/compactrifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/crowbar.png b/VRP2/trew_hud_ui/html/img/weapons/crowbar.png deleted file mode 100644 index 13e4745..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/crowbar.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/dagger.png b/VRP2/trew_hud_ui/html/img/weapons/dagger.png deleted file mode 100644 index e270fdb..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/dagger.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/dbshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/dbshotgun.png deleted file mode 100644 index 932cbbe..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/dbshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/doubleaction.png b/VRP2/trew_hud_ui/html/img/weapons/doubleaction.png deleted file mode 100644 index bdbb076..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/doubleaction.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/firework.png b/VRP2/trew_hud_ui/html/img/weapons/firework.png deleted file mode 100644 index f27bee3..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/firework.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/flare.png b/VRP2/trew_hud_ui/html/img/weapons/flare.png deleted file mode 100644 index 890cc51..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/flare.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/flaregun.png b/VRP2/trew_hud_ui/html/img/weapons/flaregun.png deleted file mode 100644 index a163d80..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/flaregun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/flashlight.png b/VRP2/trew_hud_ui/html/img/weapons/flashlight.png deleted file mode 100644 index 4bfd7d4..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/flashlight.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/golfclub.png b/VRP2/trew_hud_ui/html/img/weapons/golfclub.png deleted file mode 100644 index a599062..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/golfclub.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/grenade.png b/VRP2/trew_hud_ui/html/img/weapons/grenade.png deleted file mode 100644 index 81863d7..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/grenade.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/grenadelauncher.png b/VRP2/trew_hud_ui/html/img/weapons/grenadelauncher.png deleted file mode 100644 index cca0001..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/grenadelauncher.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png b/VRP2/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png deleted file mode 100644 index cca0001..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/gusenberg.png b/VRP2/trew_hud_ui/html/img/weapons/gusenberg.png deleted file mode 100644 index 1fcb2cb..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/gusenberg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/hammer.png b/VRP2/trew_hud_ui/html/img/weapons/hammer.png deleted file mode 100644 index 6a1980e..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/hammer.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/hatchet.png b/VRP2/trew_hud_ui/html/img/weapons/hatchet.png deleted file mode 100644 index 1611d00..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/hatchet.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/heavypistol.png b/VRP2/trew_hud_ui/html/img/weapons/heavypistol.png deleted file mode 100644 index fc2fd7d..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/heavypistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/heavyshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/heavyshotgun.png deleted file mode 100644 index 6cb1a5e..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/heavyshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/heavysniper.png b/VRP2/trew_hud_ui/html/img/weapons/heavysniper.png deleted file mode 100644 index 4d6c522..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/heavysniper.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/heavysniper_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/heavysniper_mk2.png deleted file mode 100644 index 8a7899a..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/heavysniper_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/hominglauncher.png b/VRP2/trew_hud_ui/html/img/weapons/hominglauncher.png deleted file mode 100644 index 825fc62..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/hominglauncher.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/knife.png b/VRP2/trew_hud_ui/html/img/weapons/knife.png deleted file mode 100644 index 37d4efc..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/knife.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/knuckle.png b/VRP2/trew_hud_ui/html/img/weapons/knuckle.png deleted file mode 100644 index 2b96f5b..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/knuckle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/machete.png b/VRP2/trew_hud_ui/html/img/weapons/machete.png deleted file mode 100644 index c1ad676..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/machete.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/machinepistol.png b/VRP2/trew_hud_ui/html/img/weapons/machinepistol.png deleted file mode 100644 index 0219843..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/machinepistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/marksmanpistol.png b/VRP2/trew_hud_ui/html/img/weapons/marksmanpistol.png deleted file mode 100644 index 586bc20..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/marksmanpistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/marksmanrifle.png b/VRP2/trew_hud_ui/html/img/weapons/marksmanrifle.png deleted file mode 100644 index 6df75b6..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/marksmanrifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png deleted file mode 100644 index 9348d13..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/mg.png b/VRP2/trew_hud_ui/html/img/weapons/mg.png deleted file mode 100644 index 113bd19..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/mg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/microsmg.png b/VRP2/trew_hud_ui/html/img/weapons/microsmg.png deleted file mode 100644 index 9a5b739..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/microsmg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/minigun.png b/VRP2/trew_hud_ui/html/img/weapons/minigun.png deleted file mode 100644 index 5c21459..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/minigun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/minismg.png b/VRP2/trew_hud_ui/html/img/weapons/minismg.png deleted file mode 100644 index 35cb809..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/minismg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/molotov.png b/VRP2/trew_hud_ui/html/img/weapons/molotov.png deleted file mode 100644 index ef78455..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/molotov.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/musket.png b/VRP2/trew_hud_ui/html/img/weapons/musket.png deleted file mode 100644 index 846f0ea..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/musket.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/nightstick.png b/VRP2/trew_hud_ui/html/img/weapons/nightstick.png deleted file mode 100644 index 2f4b833..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/nightstick.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/petrolcan.png b/VRP2/trew_hud_ui/html/img/weapons/petrolcan.png deleted file mode 100644 index 4cc0863..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/petrolcan.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/pipebomb.png b/VRP2/trew_hud_ui/html/img/weapons/pipebomb.png deleted file mode 100644 index aef7e97..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/pipebomb.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/pistol.png b/VRP2/trew_hud_ui/html/img/weapons/pistol.png deleted file mode 100644 index 596cd6f..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/pistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/pistol50.png b/VRP2/trew_hud_ui/html/img/weapons/pistol50.png deleted file mode 100644 index d55b730..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/pistol50.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/pistol_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/pistol_mk2.png deleted file mode 100644 index fcbbfa2..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/pistol_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/poolcue.png b/VRP2/trew_hud_ui/html/img/weapons/poolcue.png deleted file mode 100644 index ec5743f..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/poolcue.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/proxmine.png b/VRP2/trew_hud_ui/html/img/weapons/proxmine.png deleted file mode 100644 index 669140e..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/proxmine.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/pumpshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/pumpshotgun.png deleted file mode 100644 index bb3feaa..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/pumpshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png deleted file mode 100644 index b936ba9..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/railgun.png b/VRP2/trew_hud_ui/html/img/weapons/railgun.png deleted file mode 100644 index a561140..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/railgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/raycarbine.png b/VRP2/trew_hud_ui/html/img/weapons/raycarbine.png deleted file mode 100644 index 709ffc0..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/raycarbine.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/rayminigun.png b/VRP2/trew_hud_ui/html/img/weapons/rayminigun.png deleted file mode 100644 index 140c97f..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/rayminigun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/raypistol.png b/VRP2/trew_hud_ui/html/img/weapons/raypistol.png deleted file mode 100644 index b9e56d6..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/raypistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/revolver.png b/VRP2/trew_hud_ui/html/img/weapons/revolver.png deleted file mode 100644 index a5e529f..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/revolver.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/revolver_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/revolver_mk2.png deleted file mode 100644 index 500f9c1..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/revolver_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/rpg.png b/VRP2/trew_hud_ui/html/img/weapons/rpg.png deleted file mode 100644 index f108bd4..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/rpg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/sawnoffshotgun.png b/VRP2/trew_hud_ui/html/img/weapons/sawnoffshotgun.png deleted file mode 100644 index b722a44..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/sawnoffshotgun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/smg.png b/VRP2/trew_hud_ui/html/img/weapons/smg.png deleted file mode 100644 index 69380b2..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/smg.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/smg_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/smg_mk2.png deleted file mode 100644 index fb90422..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/smg_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/smokegrenade.png b/VRP2/trew_hud_ui/html/img/weapons/smokegrenade.png deleted file mode 100644 index 49cc6a5..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/smokegrenade.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/sniperrifle.png b/VRP2/trew_hud_ui/html/img/weapons/sniperrifle.png deleted file mode 100644 index 0093806..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/sniperrifle.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/snowball.png b/VRP2/trew_hud_ui/html/img/weapons/snowball.png deleted file mode 100644 index 01157fd..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/snowball.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/snspistol.png b/VRP2/trew_hud_ui/html/img/weapons/snspistol.png deleted file mode 100644 index 0991add..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/snspistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/snspistol_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/snspistol_mk2.png deleted file mode 100644 index 7b11a78..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/snspistol_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/specialcarbine.png b/VRP2/trew_hud_ui/html/img/weapons/specialcarbine.png deleted file mode 100644 index e8982f5..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/specialcarbine.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png b/VRP2/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png deleted file mode 100644 index b69bdd1..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/stickybomb.png b/VRP2/trew_hud_ui/html/img/weapons/stickybomb.png deleted file mode 100644 index 06f718f..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/stickybomb.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/stone_hatchet.png b/VRP2/trew_hud_ui/html/img/weapons/stone_hatchet.png deleted file mode 100644 index a24ca95..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/stone_hatchet.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/stungun.png b/VRP2/trew_hud_ui/html/img/weapons/stungun.png deleted file mode 100644 index 3b36f8e..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/stungun.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/switchblade.png b/VRP2/trew_hud_ui/html/img/weapons/switchblade.png deleted file mode 100644 index e4675c8..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/switchblade.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/unarmed.png b/VRP2/trew_hud_ui/html/img/weapons/unarmed.png deleted file mode 100644 index 1e6ad23..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/unarmed.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/vintagepistol.png b/VRP2/trew_hud_ui/html/img/weapons/vintagepistol.png deleted file mode 100644 index e9a3d8c..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/vintagepistol.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/img/weapons/wrench.png b/VRP2/trew_hud_ui/html/img/weapons/wrench.png deleted file mode 100644 index f3a75fd..0000000 Binary files a/VRP2/trew_hud_ui/html/img/weapons/wrench.png and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/sounds/car-indicators.ogg b/VRP2/trew_hud_ui/html/sounds/car-indicators.ogg deleted file mode 100644 index 4225cf2..0000000 Binary files a/VRP2/trew_hud_ui/html/sounds/car-indicators.ogg and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/sounds/seatbelt-buckle.ogg b/VRP2/trew_hud_ui/html/sounds/seatbelt-buckle.ogg deleted file mode 100644 index 70c20ea..0000000 Binary files a/VRP2/trew_hud_ui/html/sounds/seatbelt-buckle.ogg and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg b/VRP2/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg deleted file mode 100644 index 66394bd..0000000 Binary files a/VRP2/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg and /dev/null differ diff --git a/VRP2/trew_hud_ui/html/ui.html b/VRP2/trew_hud_ui/html/ui.html deleted file mode 100644 index 844fe44..0000000 --- a/VRP2/trew_hud_ui/html/ui.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - TREW UI - - - -
- -
- -
-
    - - - - - -
-
- -
- - - - -
- - -
-
-
-
- - - - -
-
- 999 - KM/H -
-
- N -
- - -
-
    -
  • -
  • -
-
-
-
    -
  • -
  • -
-
-
-
- -
- -
-
-
- - -
-
- -
- - - - diff --git a/VRP2/trew_hud_ui/locales/languages.lua b/VRP2/trew_hud_ui/locales/languages.lua deleted file mode 100644 index 30abeab..0000000 --- a/VRP2/trew_hud_ui/locales/languages.lua +++ /dev/null @@ -1,141 +0,0 @@ -Locales = { - -- Brazilian Portuguese - ['br'] = { - ['you_are_on_location'] = 'Você está em %s', - - ['date_format'] = { - default = 'Hoje é %s de %s de %s', - simple = 'Hoje é %s de %s', - simpleWithHours = 'São %s do dia %s de %s', - withWeekday = 'Hoje é %s, %s de %s de %s', - withHours = 'São %s do dia %s de %s de %s', - withWeekdayAndHours = 'São %s de %s, %s de %s de %s' - }, - - ['weekDay_0'] = 'Domingo', - ['weekDay_1'] = 'Segunda-feira', - ['weekDay_2'] = 'Terça-feira', - ['weekDay_3'] = 'Quarta-feira', - ['weekDay_4'] = 'Quinta-feira', - ['weekDay_5'] = 'Sexta-feira', - ['weekDay_6'] = 'Sábado', - - ['day_1'] = '1', - ['day_2'] = '2', - ['day_3'] = '3', - ['day_4'] = '4', - ['day_5'] = '5', - ['day_6'] = '6', - ['day_7'] = '7', - ['day_8'] = '8', - ['day_9'] = '9', - ['day_10'] = '10', - ['day_11'] = '11', - ['day_12'] = '12', - ['day_13'] = '13', - ['day_14'] = '14', - ['day_15'] = '15', - ['day_16'] = '16', - ['day_17'] = '17', - ['day_18'] = '18', - ['day_19'] = '19', - ['day_20'] = '20', - ['day_21'] = '21', - ['day_22'] = '22', - ['day_23'] = '23', - ['day_24'] = '24', - ['day_25'] = '25', - ['day_26'] = '26', - ['day_27'] = '27', - ['day_28'] = '28', - ['day_29'] = '29', - ['day_30'] = '30', - ['day_31'] = '31', - - ['month_0'] = 'Janeiro', - ['month_1'] = 'Fevereiro', - ['month_2'] = 'Março', - ['month_3'] = 'Abril', - ['month_4'] = 'Maio', - ['month_5'] = 'Junho', - ['month_6'] = 'Julho', - ['month_7'] = 'Agosto', - ['month_8'] = 'Setembro', - ['month_9'] = 'Outubro', - ['month_10'] = 'Novembro', - ['month_11'] = 'Dezembro', - - ['toggleui'] = 'Habilita/Desabilita parte da HUD', - - }, - - -- English - ['en'] = { - ['you_are_on_location'] = 'You are on %s', - - ['date_format'] = { - default = 'Today is %s of %s, %s', - simple = 'Today is %s, %s', - simpleWithHours = 'It is %s, %s, %s', - withWeekday = 'Today is %s, %s of %s, %s', - withHours = 'It is %s, %s of %s, %s', - withWeekdayAndHours = 'It is %s, %s, %s of %s, %s' - }, - - ['weekDay_0'] = 'Sunday', - ['weekDay_1'] = 'Monday', - ['weekDay_2'] = 'Tuesday', - ['weekDay_3'] = 'Wednesday', - ['weekDay_4'] = 'Thursday', - ['weekDay_5'] = 'Friday', - ['weekDay_6'] = 'Saturday', - - ['day_1'] = '1st', - ['day_2'] = '2rd', - ['day_3'] = '3rd', - ['day_4'] = '4th', - ['day_5'] = '5th', - ['day_6'] = '6th', - ['day_7'] = '7th', - ['day_8'] = '8th', - ['day_9'] = '9th', - ['day_10'] = '10th', - ['day_11'] = '11th', - ['day_12'] = '12th', - ['day_13'] = '13th', - ['day_14'] = '14th', - ['day_15'] = '15th', - ['day_16'] = '16th', - ['day_17'] = '17th', - ['day_18'] = '18th', - ['day_19'] = '19th', - ['day_20'] = '20th', - ['day_21'] = '21th', - ['day_22'] = '22th', - ['day_23'] = '23th', - ['day_24'] = '24th', - ['day_25'] = '25th', - ['day_26'] = '26th', - ['day_27'] = '27th', - ['day_28'] = '28th', - ['day_29'] = '29th', - ['day_30'] = '30th', - ['day_31'] = '31th', - - ['month_0'] = 'January', - ['month_1'] = 'February', - ['month_2'] = 'March', - ['month_3'] = 'April', - ['month_4'] = 'May', - ['month_5'] = 'June', - ['month_6'] = 'July', - ['month_7'] = 'August', - ['month_8'] = 'September', - ['month_9'] = 'October', - ['month_10'] = 'November', - ['month_11'] = 'December', - ['toggleui'] = 'Enables/Disables parts of the HUD', - } -} - -return Locales diff --git a/VRP2/trew_hud_ui/server/milleniumfalcon.lua b/VRP2/trew_hud_ui/server/milleniumfalcon.lua deleted file mode 100644 index d6e90ee..0000000 --- a/VRP2/trew_hud_ui/server/milleniumfalcon.lua +++ /dev/null @@ -1,5 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- \ No newline at end of file diff --git a/VRP2/trew_hud_ui/server/server.lua b/VRP2/trew_hud_ui/server/server.lua deleted file mode 100644 index 2c90164..0000000 --- a/VRP2/trew_hud_ui/server/server.lua +++ /dev/null @@ -1,62 +0,0 @@ -local trewhudui = class("trewhudui", vRP.Extension) -trewhudui.User = class("User") - -function trewhudui:__construct() - vRP.Extension.__construct(self) -end - -local Config = module('trew_hud_ui', 'config') -local Locales = module('trew_hud_ui', 'locales/languages') - -function _U(entry) - return Locales[ Config.Locale ][entry] -end - -local info = { - hunger = "0", - thirst = "0", - job = "Unemployed", - money = "0", - bankMoney = "0", - blackMoney = "0" -} - -TriggerEvent('chatMessage', "", {255, 0, 0}, hunger) - -RegisterServerEvent('trew_hud_ui:getServerInfo') -AddEventHandler('trew_hud_ui:getServerInfo', function() - TriggerClientEvent('trew_hud_ui:setInfo', source, info) -end) - -RegisterServerEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(status) - TriggerClientEvent('trew_hud_ui:syncCarLights', -1, source, status) -end) --- Events created by DeVe --- Create event for : --- PlayerSpawn --- Player Money Update --- PlayerVitalChange -trewhudui.event = {} - -function trewhudui.event:playerSpawn(user, first_spawn) - if first_spawn then - info.hunger = (1 - user:getVital("food")) * 100 - info.thirst = (1 - user:getVital("water")) * 100 - info.job = user:getGroupByType('job') - info.money = user:getWallet() - info.bankMoney = user:getBank() - end -end - -function trewhudui.event:playerMoneyUpdate(user) - info.money = user:getWallet() - info.bankMoney = user:getBank() -end - -function trewhudui.event:playerVitalChange(user) - info.hunger = (1 - user:getVital("food")) * 100 - info.thirst = (1 - user:getVital("water")) * 100 -end - -vRP:registerExtension(trewhudui) diff --git a/VRP2/trew_hud_ui/server_vrp.lua b/VRP2/trew_hud_ui/server_vrp.lua deleted file mode 100644 index e789546..0000000 --- a/VRP2/trew_hud_ui/server_vrp.lua +++ /dev/null @@ -1,7 +0,0 @@ -local Proxy = module("vrp", "lib/Proxy") - -local vRP = Proxy.getInterface("vRP") - -async(function() - vRP.loadScript("trew_hud_ui", "server/server") -end) diff --git a/VRPEX/trew_hud_ui/LICENSE b/VRPEX/trew_hud_ui/LICENSE deleted file mode 100644 index f288702..0000000 --- a/VRPEX/trew_hud_ui/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/VRPEX/trew_hud_ui/__resource.lua b/VRPEX/trew_hud_ui/__resource.lua deleted file mode 100644 index fa9c78b..0000000 --- a/VRPEX/trew_hud_ui/__resource.lua +++ /dev/null @@ -1,132 +0,0 @@ -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' - -description 'Trew HUD UI' - -ui_page 'html/ui.html' - - -files { - 'html/ui.html', - 'html/main.css', - 'html/app.js', - - 'html/img/vehicle-gear.png', - 'html/img/vehicle-lights.png', - 'html/img/vehicle-lights-high.png', - 'html/img/vehicle-seatbelt.png', - - 'html/img/weapon-bullets.png', - - 'html/img/weapons/appistol.png', - 'html/img/weapons/assaultrifle.png', - 'html/img/weapons/assaultrifle_mk2.png', - 'html/img/weapons/assaultshotgun.png', - 'html/img/weapons/assaultsmg.png', - 'html/img/weapons/autoshotgun.png', - 'html/img/weapons/ball.png', - 'html/img/weapons/bat.png', - 'html/img/weapons/battleaxe.png', - 'html/img/weapons/bottle.png', - 'html/img/weapons/bullpuprifle.png', - 'html/img/weapons/bullpuprifle_mk2.png', - 'html/img/weapons/bullpupshotgun.png', - 'html/img/weapons/bzgas.png', - 'html/img/weapons/carbinerifle.png', - 'html/img/weapons/carbinerifle_mk2.png', - 'html/img/weapons/combatmg.png', - 'html/img/weapons/combatmg_mk2.png', - 'html/img/weapons/combatpdw.png', - 'html/img/weapons/combatpistol.png', - 'html/img/weapons/compactlauncher.png', - 'html/img/weapons/compactrifle.png', - 'html/img/weapons/crowbar.png', - 'html/img/weapons/dagger.png', - 'html/img/weapons/dbshotgun.png', - 'html/img/weapons/doubleaction.png', - 'html/img/weapons/firework.png', - 'html/img/weapons/flare.png', - 'html/img/weapons/flaregun.png', - 'html/img/weapons/flashlight.png', - 'html/img/weapons/golfclub.png', - 'html/img/weapons/grenade.png', - 'html/img/weapons/grenadelauncher.png', - 'html/img/weapons/grenadelauncher_smoke.png', - 'html/img/weapons/gusenberg.png', - 'html/img/weapons/hammer.png', - 'html/img/weapons/hatchet.png', - 'html/img/weapons/heavypistol.png', - 'html/img/weapons/heavyshotgun.png', - 'html/img/weapons/heavysniper.png', - 'html/img/weapons/heavysniper_mk2.png', - 'html/img/weapons/hominglauncher.png', - 'html/img/weapons/knife.png', - 'html/img/weapons/knuckle.png', - 'html/img/weapons/machete.png', - 'html/img/weapons/machinepistol.png', - 'html/img/weapons/marksmanpistol.png', - 'html/img/weapons/marksmanrifle.png', - 'html/img/weapons/marksmanrifle_mk2.png', - 'html/img/weapons/mg.png', - 'html/img/weapons/microsmg.png', - 'html/img/weapons/minigun.png', - 'html/img/weapons/minismg.png', - 'html/img/weapons/molotov.png', - 'html/img/weapons/musket.png', - 'html/img/weapons/nightstick.png', - 'html/img/weapons/petrolcan.png', - 'html/img/weapons/pipebomb.png', - 'html/img/weapons/pistol.png', - 'html/img/weapons/pistol50.png', - 'html/img/weapons/pistol_mk2.png', - 'html/img/weapons/poolcue.png', - 'html/img/weapons/proxmine.png', - 'html/img/weapons/pumpshotgun.png', - 'html/img/weapons/pumpshotgun_mk2.png', - 'html/img/weapons/railgun.png', - 'html/img/weapons/raycarbine.png', - 'html/img/weapons/rayminigun.png', - 'html/img/weapons/raypistol.png', - 'html/img/weapons/revolver.png', - 'html/img/weapons/revolver_mk2.png', - 'html/img/weapons/rpg.png', - 'html/img/weapons/sawnoffshotgun.png', - 'html/img/weapons/smg.png', - 'html/img/weapons/smg_mk2.png', - 'html/img/weapons/smokegrenade.png', - 'html/img/weapons/sniperrifle.png', - 'html/img/weapons/snowball.png', - 'html/img/weapons/snspistol.png', - 'html/img/weapons/snspistol_mk2.png', - 'html/img/weapons/specialcarbine.png', - 'html/img/weapons/specialcarbine_mk2.png', - 'html/img/weapons/stickybomb.png', - 'html/img/weapons/stone_hatchet.png', - 'html/img/weapons/stungun.png', - 'html/img/weapons/switchblade.png', - 'html/img/weapons/unarmed.png', - 'html/img/weapons/vintagepistol.png', - 'html/img/weapons/wrench.png', - - - - 'html/sounds/seatbelt-buckle.ogg', - 'html/sounds/seatbelt-unbuckle.ogg', - - 'html/sounds/car-indicators.ogg', -} - -client_scripts { - "@vrp/lib/utils.lua", - 'locales/languages.lua', - 'config.lua', - 'client/client.lua', - 'client/hansolo.lua' -} - -server_scripts { - "@vrp/lib/utils.lua", - 'locales/languages.lua', - 'config.lua', - 'server/server.lua', - 'server/milleniumfalcon.lua' -} \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/client/client.lua b/VRPEX/trew_hud_ui/client/client.lua deleted file mode 100644 index c429a65..0000000 --- a/VRPEX/trew_hud_ui/client/client.lua +++ /dev/null @@ -1,919 +0,0 @@ -local Config = module('trew_hud_ui', 'config') -local Locales = module('trew_hud_ui', 'locales/languages') - -local zones = { ['AIRP'] = "Los Santos International Airport", ['ALAMO'] = "Alamo Sea", ['ALTA'] = "Alta", ['ARMYB'] = "Fort Zancudo", ['BANHAMC'] = "Banham Canyon Dr", ['BANNING'] = "Banning", ['BEACH'] = "Vespucci Beach", ['BHAMCA'] = "Banham Canyon", ['BRADP'] = "Braddock Pass", ['BRADT'] = "Braddock Tunnel", ['BURTON'] = "Burton", ['CALAFB'] = "Calafia Bridge", ['CANNY'] = "Raton Canyon", ['CCREAK'] = "Cassidy Creek", ['CHAMH'] = "Chamberlain Hills", ['CHIL'] = "Vinewood Hills", ['CHU'] = "Chumash", ['CMSW'] = "Chiliad Mountain State Wilderness", ['CYPRE'] = "Cypress Flats", ['DAVIS'] = "Davis", ['DELBE'] = "Del Perro Beach", ['DELPE'] = "Del Perro", ['DELSOL'] = "La Puerta", ['DESRT'] = "Grand Senora Desert", ['DOWNT'] = "Downtown", ['DTVINE'] = "Downtown Vinewood", ['EAST_V'] = "East Vinewood", ['EBURO'] = "El Burro Heights", ['ELGORL'] = "El Gordo Lighthouse", ['ELYSIAN'] = "Elysian Island", ['GALFISH'] = "Galilee", ['GOLF'] = "GWC and Golfing Society", ['GRAPES'] = "Grapeseed", ['GREATC'] = "Great Chaparral", ['HARMO'] = "Harmony", ['HAWICK'] = "Hawick", ['HORS'] = "Vinewood Racetrack", ['HUMLAB'] = "Humane Labs and Research", ['JAIL'] = "Bolingbroke Penitentiary", ['KOREAT'] = "Little Seoul", ['LACT'] = "Land Act Reservoir", ['LAGO'] = "Lago Zancudo", ['LDAM'] = "Land Act Dam", ['LEGSQU'] = "Legion Square", ['LMESA'] = "La Mesa", ['LOSPUER'] = "La Puerta", ['MIRR'] = "Mirror Park", ['MORN'] = "Morningwood", ['MOVIE'] = "Richards Majestic", ['MTCHIL'] = "Mount Chiliad", ['MTGORDO'] = "Mount Gordo", ['MTJOSE'] = "Mount Josiah", ['MURRI'] = "Murrieta Heights", ['NCHU'] = "North Chumash", ['NOOSE'] = "N.O.O.S.E", ['OCEANA'] = "Pacific Ocean", ['PALCOV'] = "Paleto Cove", ['PALETO'] = "Paleto Bay", ['PALFOR'] = "Paleto Forest", ['PALHIGH'] = "Palomino Highlands", ['PALMPOW'] = "Palmer-Taylor Power Station", ['PBLUFF'] = "Pacific Bluffs", ['PBOX'] = "Pillbox Hill", ['PROCOB'] = "Procopio Beach", ['RANCHO'] = "Rancho", ['RGLEN'] = "Richman Glen", ['RICHM'] = "Richman", ['ROCKF'] = "Rockford Hills", ['RTRAK'] = "Redwood Lights Track", ['SANAND'] = "San Andreas", ['SANCHIA'] = "San Chianski Mountain Range", ['SANDY'] = "Sandy Shores", ['SKID'] = "Mission Row", ['SLAB'] = "Stab City", ['STAD'] = "Maze Bank Arena", ['STRAW'] = "Strawberry", ['TATAMO'] = "Tataviam Mountains", ['TERMINA'] = "Terminal", ['TEXTI'] = "Textile City", ['TONGVAH'] = "Tongva Hills", ['TONGVAV'] = "Tongva Valley", ['VCANA'] = "Vespucci Canals", ['VESP'] = "Vespucci", ['VINE'] = "Vinewood", ['WINDF'] = "Ron Alternates Wind Farm", ['WVINE'] = "West Vinewood", ['ZANCUDO'] = "Zancudo River", ['ZP_ORT'] = "Port of South Los Santos", ['ZQ_UAR'] = "Davis Quartz" } - -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} - -local AllWeapons = json.decode('{"melee":{"dagger":"0x92A27487","bat":"0x958A4A8F","bottle":"0xF9E6AA4B","crowbar":"0x84BD7BFD","unarmed":"0xA2719263","flashlight":"0x8BB05FD7","golfclub":"0x440E4788","hammer":"0x4E875F73","hatchet":"0xF9DCBF2D","knuckle":"0xD8DF3C3C","knife":"0x99B507EA","machete":"0xDD5DF8D9","switchblade":"0xDFE37640","nightstick":"0x678B81B1","wrench":"0x19044EE0","battleaxe":"0xCD274149","poolcue":"0x94117305","stone_hatchet":"0x3813FC08"},"handguns":{"pistol":"0x1B06D571","pistol_mk2":"0xBFE256D4","combatpistol":"0x5EF9FEC4","appistol":"0x22D8FE39","stungun":"0x3656C8C1","pistol50":"0x99AEEB3B","snspistol":"0xBFD21232","snspistol_mk2":"0x88374054","heavypistol":"0xD205520E","vintagepistol":"0x83839C4","flaregun":"0x47757124","marksmanpistol":"0xDC4DB296","revolver":"0xC1B3C3D1","revolver_mk2":"0xCB96392F","doubleaction":"0x97EA20B8","raypistol":"0xAF3696A1"},"smg":{"microsmg":"0x13532244","smg":"0x2BE6766B","smg_mk2":"0x78A97CD0","assaultsmg":"0xEFE7E2DF","combatpdw":"0xA3D4D34","machinepistol":"0xDB1AA450","minismg":"0xBD248B55","raycarbine":"0x476BF155"},"shotguns":{"pumpshotgun":"0x1D073A89","pumpshotgun_mk2":"0x555AF99A","sawnoffshotgun":"0x7846A318","assaultshotgun":"0xE284C527","bullpupshotgun":"0x9D61E50F","musket":"0xA89CB99E","heavyshotgun":"0x3AABBBAA","dbshotgun":"0xEF951FBB","autoshotgun":"0x12E82D3D"},"assault_rifles":{"assaultrifle":"0xBFEFFF6D","assaultrifle_mk2":"0x394F415C","carbinerifle":"0x83BF0278","carbinerifle_mk2":"0xFAD1F1C9","advancedrifle":"0xAF113F99","specialcarbine":"0xC0A3098D","specialcarbine_mk2":"0x969C3D67","bullpuprifle":"0x7F229F94","bullpuprifle_mk2":"0x84D6FAFD","compactrifle":"0x624FE830"},"machine_guns":{"mg":"0x9D07F764","combatmg":"0x7FD62962","combatmg_mk2":"0xDBBD7280","gusenberg":"0x61012683"},"sniper_rifles":{"sniperrifle":"0x5FC3C11","heavysniper":"0xC472FE2","heavysniper_mk2":"0xA914799","marksmanrifle":"0xC734385A","marksmanrifle_mk2":"0x6A6C02E0"},"heavy_weapons":{"rpg":"0xB1CA77B1","grenadelauncher":"0xA284510B","grenadelauncher_smoke":"0x4DD2DC56","minigun":"0x42BF8A85","firework":"0x7F7497E5","railgun":"0x6D544C99","hominglauncher":"0x63AB0442","compactlauncher":"0x781FE4A","rayminigun":"0xB62D1F67"},"throwables":{"grenade":"0x93E220BD","bzgas":"0xA0973D5E","smokegrenade":"0xFDBC8A50","flare":"0x497FACC3","molotov":"0x24B17070","stickybomb":"0x2C3731D9","proxmine":"0xAB564B93","snowball":"0x787F0BB","pipebomb":"0xBA45E8B8","ball":"0x23C9F95C"},"misc":{"petrolcan":"0x34A67B97","fireextinguisher":"0x60EC506","parachute":"0xFBAB5776"}}') - -function _U(entry) - return Locales[ Config.Locale ][entry] -end - -local vehiclesCars = {0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20}; - --- Hides TREW UI when it's on Pause Menu -Citizen.CreateThread(function() - - local isPauseMenu = false - - while true do - Citizen.Wait(0) - - if IsPauseMenuActive() then -- ESC Key - if not isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = false }) - end - else - if isPauseMenu then - isPauseMenu = not isPauseMenu - SendNUIMessage({ action = 'toggleUi', value = true }) - end - - HideHudComponentThisFrame(1) -- Wanted Stars - HideHudComponentThisFrame(2) -- Weapon Icon - HideHudComponentThisFrame(3) -- Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(6) -- Vehicle Name - HideHudComponentThisFrame(7) -- Area Name - HideHudComponentThisFrame(8) -- Vehicle Class - HideHudComponentThisFrame(9) -- Street Name - HideHudComponentThisFrame(13) -- Cash Change - HideHudComponentThisFrame(17) -- Save Game - HideHudComponentThisFrame(20) -- Weapon Stats - end - - - end -end) - - - - - - --- Date and time update -Citizen.CreateThread(function() - while true do - Citizen.Wait(1000) - if Config.ui.showDate == true then - SendNUIMessage({ action = 'setText', id = 'date', value = trewDate() }) - end - end -end) - - - - - --- Location update -Citizen.CreateThread(function() - - while true do - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - - local position = GetEntityCoords(player) - - if Config.ui.showLocation == true then - local zoneNameFull = zones[GetNameOfZone(position.x, position.y, position.z)] - local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(position.x, position.y, position.z)) - - local locationMessage = nil - - if zoneNameFull then - locationMessage = streetName .. ', ' .. zoneNameFull - else - locationMessage = streetName - end - - locationMessage = string.format( - Locales[Config.Locale]['you_are_on_location'], - locationMessage - ) - - SendNUIMessage({ action = 'setText', id = 'location', value = locationMessage }) - end - end -end) - - - - - --- Vehicle Info -local vehicleCruiser -local vehicleSignalIndicator = 'off' -local seatbeltEjectSpeed = 45.0 -local seatbeltEjectAccel = 100.0 -local seatbeltIsOn = false -local currSpeed = 0.0 -local prevVelocity = {x = 0.0, y = 0.0, z = 0.0} - -Citizen.CreateThread(function() - - while true do - - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local position = GetEntityCoords(player) - local vehicleIsOn = GetIsVehicleEngineRunning(vehicle) - local vehicleInfo - - if IsPedInAnyVehicle(player, false) and vehicleIsOn then - - - local vehicleClass = GetVehicleClass(vehicle) - - - if Config.ui.showMinimap == false then - DisplayRadar(true) - end - - -- Vehicle Speed - local vehicleSpeedSource = GetEntitySpeed(vehicle) - local vehicleSpeed - if Config.vehicle.speedUnit == 'MPH' then - vehicleSpeed = math.ceil(vehicleSpeedSource * 2.237) - else - vehicleSpeed = math.ceil(vehicleSpeedSource * 3.6) - end - - -- Vehicle Gradient Speed - local vehicleNailSpeed - - if vehicleSpeed > Config.vehicle.maxSpeed then - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(Config.vehicle.maxSpeed * 205) / Config.vehicle.maxSpeed) ) - else - vehicleNailSpeed = math.ceil( 280 - math.ceil( math.ceil(vehicleSpeed * 205) / Config.vehicle.maxSpeed) ) - end - - - - -- Vehicle Fuel and Gear - local vehicleFuel - vehicleFuel = GetVehicleFuelLevel(vehicle) - - local vehicleGear = GetVehicleCurrentGear(vehicle) - - if (vehicleSpeed == 0 and vehicleGear == 0) or (vehicleSpeed == 0 and vehicleGear == 1) then - vehicleGear = 'N' - elseif vehicleSpeed > 0 and vehicleGear == 0 then - vehicleGear = 'R' - end - - -- Vehicle Lights - local vehicleVal,vehicleLights,vehicleHighlights = GetVehicleLightsState(vehicle) - local vehicleIsLightsOn - if vehicleLights == 1 and vehicleHighlights == 0 then - vehicleIsLightsOn = 'normal' - elseif (vehicleLights == 1 and vehicleHighlights == 1) or (vehicleLights == 0 and vehicleHighlights == 1) then - vehicleIsLightsOn = 'high' - else - vehicleIsLightsOn = 'off' - end - - - - - - - -- Vehicle Siren - local vehicleSiren - - if IsVehicleSirenOn(vehicle) then - vehicleSiren = true - else - vehicleSiren = false - end - - - - - - - -- Vehicle Seatbelt - if has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8 then - - local prevSpeed = currSpeed - currSpeed = vehicleSpeedSource - - SetPedConfigFlag(PlayerPedId(), 32, true) - - if not seatbeltIsOn then - local vehIsMovingFwd = GetEntitySpeedVector(vehicle, true).y > 1.0 - local vehAcc = (prevSpeed - currSpeed) / GetFrameTime() - if (vehIsMovingFwd and (prevSpeed > (seatbeltEjectSpeed/2.237)) and (vehAcc > (seatbeltEjectAccel*9.81))) then - - SetEntityCoords(player, position.x, position.y, position.z - 0.47, true, true, true) - SetEntityVelocity(player, prevVelocity.x, prevVelocity.y, prevVelocity.z) - SetPedToRagdoll(player, 1000, 1000, 0, 0, 0, 0) - else - -- Update previous velocity for ejecting player - prevVelocity = GetEntityVelocity(vehicle) - end - - else - - DisableControlAction(0, 75) - - end - - - - end - - - - vehicleInfo = { - action = 'updateVehicle', - - status = true, - speed = vehicleSpeed, - nail = vehicleNailSpeed, - gear = vehicleGear, - fuel = vehicleFuel, - lights = vehicleIsLightsOn, - signals = vehicleSignalIndicator, - cruiser = vehicleCruiser, - type = vehicleClass, - siren = vehicleSiren, - seatbelt = {}, - - config = { - speedUnit = Config.vehicle.speedUnit, - maxSpeed = Config.vehicle.maxSpeed - } - } - - vehicleInfo['seatbelt']['status'] = seatbeltIsOn - else - - - vehicleCruiser = false - vehicleNailSpeed = 0 - vehicleSignalIndicator = 'off' - - seatbeltIsOn = false - - vehicleInfo = { - action = 'updateVehicle', - - status = false, - nail = vehicleNailSpeed, - seatbelt = { status = seatbeltIsOn }, - cruiser = vehicleCruiser, - signals = vehicleSignalIndicator, - type = 0, - } - - if Config.ui.showMinimap == false then - DisplayRadar(false) - end - - end - - SendNUIMessage(vehicleInfo) - - - - - - end -end) - - - - --- Player status -Citizen.CreateThread(function() - - while true do - Citizen.Wait(1000) - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - - if Config.ui.showHealth == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['isdead'] = false - - playerStatus['status'][showPlayerStatus] = { - name = 'health', - value = GetEntityHealth(GetPlayerPed(-1)) - 100 - } - - if IsEntityDead(GetPlayerPed(-1)) then - playerStatus.isdead = true - end - end - - if Config.ui.showArmor == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'armor', - value = GetPedArmour(GetPlayerPed(-1)), - } - end - - if Config.ui.showStamina == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'stamina', - value = 100 - GetPlayerSprintStaminaRemaining(PlayerId()), - } - end - - TriggerServerEvent('trew_hud_ui:getServerInfo') - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - - end -end) - - --- Overall Info -RegisterNetEvent('trew_hud_ui:setInfo') -AddEventHandler('trew_hud_ui:setInfo', function(info) - - SendNUIMessage({ action = 'setText', id = 'job', value = info['job'] }) - SendNUIMessage({ action = 'setMoney', id = 'wallet', value = info['money'] }) - SendNUIMessage({ action = 'setMoney', id = 'bank', value = info['bankMoney'] }) - SendNUIMessage({ action = 'setMoney', id = 'blackMoney', value = info['blackMoney'] }) - - local playerStatus - local showPlayerStatus = 0 - playerStatus = { action = 'setStatus', status = {} } - - - if Config.ui.showHunger == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'hunger', - value = info['hunger'] - } - - end - - if Config.ui.showThirst == true then - showPlayerStatus = (showPlayerStatus+1) - - playerStatus['status'][showPlayerStatus] = { - name = 'thirst', - value = info['thirst'] - } - end - - if showPlayerStatus > 0 then - SendNUIMessage(playerStatus) - end - - -end) - - --- Voice detection and distance -Citizen.CreateThread(function() - - if Config.ui.showVoice == true then - - RequestAnimDict('facials@gen_male@variations@normal') - RequestAnimDict('mp_facial') - - while true do - Citizen.Wait(300) - local playerID = PlayerId() - - for _,player in ipairs(GetActivePlayers()) do - local boolTalking = NetworkIsPlayerTalking(player) - - if player ~= playerID then - if boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mic_chatter', 'mp_facial') - elseif not boolTalking then - PlayFacialAnim(GetPlayerPed(player), 'mood_normal_1', 'facials@gen_male@variations@normal') - end - end - end - end - - end -end) - - - -Citizen.CreateThread(function() - if Config.ui.showVoice == true then - - - - local isTalking = false - local voiceDistance = nil - - while true do - Citizen.Wait(1) - - - - - if NetworkIsPlayerTalking(PlayerId()) and not isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - elseif not NetworkIsPlayerTalking(PlayerId()) and isTalking then - isTalking = not isTalking - SendNUIMessage({ action = 'isTalking', value = isTalking }) - end - - - - if IsControlJustPressed(1, Keys[Config.voice.keys.distance]) then - - Config.voice.levels.current = (Config.voice.levels.current + 1) % 3 - - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - voiceDistance = 'whisper' - end - - SendNUIMessage({ action = 'setVoiceDistance', value = voiceDistance }) - end - - if Config.voice.levels.current == 0 then - voiceDistance = 'normal' - elseif Config.voice.levels.current == 1 then - voiceDistance = 'shout' - elseif Config.voice.levels.current == 2 then - voiceDistance = 'whisper' - end - - - end - - - - - - end -end) - - - - --- Weapons -Citizen.CreateThread(function() - if Config.ui.showWeapons == true then - while true do - Citizen.Wait(100) - - local player = GetPlayerPed(-1) - local status = {} - - if IsPedArmed(player, 7) then - - local weapon = GetSelectedPedWeapon(player) - local ammoTotal = GetAmmoInPedWeapon(player,weapon) - local bool,ammoClip = GetAmmoInClip(player,weapon) - local ammoRemaining = math.floor(ammoTotal - ammoClip) - - status['armed'] = true - - for key,value in pairs(AllWeapons) do - - for keyTwo,valueTwo in pairs(AllWeapons[key]) do - if weapon == GetHashKey('weapon_'..keyTwo) then - status['weapon'] = keyTwo - - - if key == 'melee' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - if keyTwo == 'stungun' then - SendNUIMessage({ action = 'element', task = 'disable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bullets' }) - else - SendNUIMessage({ action = 'element', task = 'enable', value = 'weapon_bullets' }) - SendNUIMessage({ action = 'element', task = 'enable', value = 'bullets' }) - end - end - - end - end - - end - - SendNUIMessage({ action = 'setText', id = 'weapon_clip', value = ammoClip }) - SendNUIMessage({ action = 'setText', id = 'weapon_ammo', value = ammoRemaining }) - - else - status['armed'] = false - end - - SendNUIMessage({ action = 'updateWeapon', status = status }) - - end - end -end) - - - - - - - - - - - --- Everything that neededs to be at WAIT 0 -Citizen.CreateThread(function() - - while true do - Citizen.Wait(0) - - local player = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(player, false) - local vehicleClass = GetVehicleClass(vehicle) - - -- Vehicle Seatbelt - if IsPedInAnyVehicle(player, false) and GetIsVehicleEngineRunning(vehicle) then - if IsControlJustReleased(0, Keys[Config.vehicle.keys.seatbelt]) and (has_value(vehiclesCars, vehicleClass) == true and vehicleClass ~= 8) then - seatbeltIsOn = not seatbeltIsOn - end - end - - -- Vehicle Cruiser - if IsControlJustPressed(1, Keys[Config.vehicle.keys.cruiser]) and GetPedInVehicleSeat(vehicle, -1) == player and (has_value(vehiclesCars, vehicleClass) == true) then - - local vehicleSpeedSource = GetEntitySpeed(vehicle) - - if vehicleCruiser == 'on' then - vehicleCruiser = 'off' - SetEntityMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle,"CHandlingData","fInitialDriveMaxFlatVel")) - - else - vehicleCruiser = 'on' - SetEntityMaxSpeed(vehicle, vehicleSpeedSource) - end - end - - - - - - -- Vehicle Signal Lights - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalLeft]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'left' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalRight]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'right' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - if IsControlJustPressed(1, Keys[Config.vehicle.keys.signalBoth]) and (has_value(vehiclesCars, vehicleClass) == true) then - if vehicleSignalIndicator == 'off' then - vehicleSignalIndicator = 'both' - else - vehicleSignalIndicator = 'off' - end - - TriggerEvent('trew_hud_ui:setCarSignalLights', vehicleSignalIndicator) - end - - - end -end) - - - - - - - - - - -AddEventHandler('onClientMapStart', function() - - SendNUIMessage({ action = 'ui', config = Config.ui }) - SendNUIMessage({ action = 'setFont', url = Config.font.url, name = Config.font.name }) - SendNUIMessage({ action = 'setLogo', value = Config.serverLogo }) - - if Config.ui.showVoice == true then - if Config.voice.levels.current == 0 then - NetworkSetTalkerProximity(Config.voice.levels.default) - elseif Config.voice.levels.current == 1 then - NetworkSetTalkerProximity(Config.voice.levels.shout) - elseif Config.voice.levels.current == 2 then - NetworkSetTalkerProximity(Config.voice.levels.whisper) - end - end -end) - -AddEventHandler('playerSpawned', function() - if Config.ui.showVoice == true then - NetworkSetTalkerProximity(5.0) - end - - - HideHudComponentThisFrame(7) -- Area - HideHudComponentThisFrame(9) -- Street - HideHudComponentThisFrame(6) -- Vehicle - HideHudComponentThisFrame(3) -- SP Cash - HideHudComponentThisFrame(4) -- MP Cash - HideHudComponentThisFrame(13) -- Cash changes! -end) - - - - - - - - - -AddEventHandler('trew_hud_ui:setCarSignalLights', function(status) - local driver = GetVehiclePedIsIn(GetPlayerPed(-1), false) - local hasTrailer,vehicleTrailer = GetVehicleTrailerVehicle(driver,vehicleTrailer) - local leftLight - local rightLight - - if status == 'left' then - leftLight = false - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'right' then - leftLight = true - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - elseif status == 'both' then - leftLight = true - rightLight = true - if hasTrailer then driver = vehicleTrailer end - - else - leftLight = false - rightLight = false - if hasTrailer then driver = vehicleTrailer end - - end - - TriggerServerEvent('trew_hud_ui:syncCarLights', status) - - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) -end) - - - -RegisterNetEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(driver, status) - - if GetPlayerFromServerId(driver) ~= PlayerId() then - local driver = GetVehiclePedIsIn(GetPlayerPed(GetPlayerFromServerId(driver)), false) - - if status == 'left' then - leftLight = false - rightLight = true - - elseif status == 'right' then - leftLight = true - rightLight = false - - elseif status == 'both' then - leftLight = true - rightLight = true - - else - leftLight = false - rightLight = false - end - - SetVehicleIndicatorLights(driver, 0, leftLight) - SetVehicleIndicatorLights(driver, 1, rightLight) - - end -end) - - - - - - - - - - - - - - - - - - - - - -function trewDate() - local timeString = nil - - local day = _U('day_' .. GetClockDayOfMonth()) - local weekDay = _U('weekDay_' .. GetClockDayOfWeek()) - local month = _U('month_' .. GetClockMonth()) - local day = _U('day_' .. GetClockDayOfMonth()) - local year = GetClockYear() - - - local hour = GetClockHours() - local minutes = GetClockMinutes() - local time = nil - local AmPm = '' - - - if Config.date.AmPm == true then - - if hour >= 13 and hour <= 24 then - hour = hour - 12 - AmPm = 'PM' - else - if hour == 0 or hour == 24 then - hour = 12 - end - AmPm = 'AM' - end - - end - - if hour <= 9 then - hour = '0' .. hour - end - if minutes <= 9 then - minutes = '0' .. minutes - end - - time = hour .. ':' .. minutes .. ' ' .. AmPm - - - - - local date_format = Locales[Config.Locale]['date_format'][Config.date.format] - - if Config.date.format == 'default' then - timeString = string.format( - date_format, - day, month, year - ) - elseif Config.date.format == 'simple' then - timeString = string.format( - date_format, - day, month - ) - - elseif Config.date.format == 'simpleWithHours' then - timeString = string.format( - date_format, - time, day, month - ) - elseif Config.date.format == 'withWeekday' then - timeString = string.format( - date_format, - weekDay, day, month, year - ) - elseif Config.date.format == 'withHours' then - timeString = string.format( - date_format, - time, day, month, year - ) - elseif Config.date.format == 'withWeekdayAndHours' then - timeString = string.format( - date_format, - time, weekDay, day, month, year - ) - end - - - - - return timeString -end - - - - - - -function has_value(tab, val) - for index, value in ipairs(tab) do - if value == val then - return true - end - end - - return false -end - - - - - - - - - - - - - - - - - - -local toggleui = false -RegisterCommand('toggleui', function() - if not toggleui then - SendNUIMessage({ action = 'element', task = 'disable', value = 'job' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'society' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'bank' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'blackMoney' }) - SendNUIMessage({ action = 'element', task = 'disable', value = 'wallet' }) - else - - if (Config.ui.showJob == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'job' }) - end - if (Config.ui.showSocietyMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'society' }) - end - if (Config.ui.showBankMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'bank' }) - end - if (Config.ui.showBlackMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'blackMoney' }) - end - if (Config.ui.showWalletMoney == true) then - SendNUIMessage({ action = 'element', task = 'enable', value = 'wallet' }) - end - end - - toggleui = not toggleui -end) - - - - - - - - - - -exports('createStatus', function(args) - local statusCreation = { action = 'createStatus', status = args['status'], color = args['color'], icon = args['icon'] } - SendNUIMessage(statusCreation) -end) - - - - -exports('setStatus', function(args) - local playerStatus = { action = 'setStatus', status = { - { name = args['name'], value = args['value'] } - }} - SendNUIMessage(playerStatus) -end) diff --git a/VRPEX/trew_hud_ui/client/hansolo.lua b/VRPEX/trew_hud_ui/client/hansolo.lua deleted file mode 100644 index d3e85c3..0000000 --- a/VRPEX/trew_hud_ui/client/hansolo.lua +++ /dev/null @@ -1,8 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- - -AddEventHandler('onClientMapStart', function() -end) \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/config.lua b/VRPEX/trew_hud_ui/config.lua deleted file mode 100644 index 7ac333c..0000000 --- a/VRPEX/trew_hud_ui/config.lua +++ /dev/null @@ -1,78 +0,0 @@ -local Config = {} - -Config.Locale = 'en' - -Config.serverLogo = 'https://i.imgur.com/AcgDL9f.png' - -Config.font = { - name = 'Montserrat', - url = 'https://fonts.googleapis.com/css?family=Montserrat:300,400,700,900&display=swap' -} - -Config.date = { - format = 'default', - AmPm = false -} - -Config.voice = { - - levels = { - default = 5.0, - shout = 12.0, - whisper = 1.0, - current = 0 - }, - - keys = { - distance = 'HOME', - } -} - - -Config.vehicle = { - speedUnit = 'KMH', - maxSpeed = 240, - - keys = { - seatbelt = 'K', - cruiser = 'CAPS', - signalLeft = 'LEFT', - signalRight = 'RIGHT', - signalBoth = 'DOWN', - } -} - -Config.ui = { - showServerLogo = true, - - showJob = true, - - showWalletMoney = true, - showBankMoney = true, - showBlackMoney = true, - - showDate = true, - showLocation = true, - showVoice = true, - - showHealth = true, - showArmor = true, - showStamina = true, - showHunger = true, - showThirst = true, - - showMinimap = false, - - showWeapons = true, - -} - - - -Config.vRP = { - items = { - blackMoney = 'dirty_money' - } -} - -return Config \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/html/app.js b/VRPEX/trew_hud_ui/html/app.js deleted file mode 100644 index bd90754..0000000 --- a/VRPEX/trew_hud_ui/html/app.js +++ /dev/null @@ -1,496 +0,0 @@ -function rgba(hex,opacity){ - hex = hex.replace('#',''); - redColor = parseInt(hex.substring(0,2), 16); - greenColor = parseInt(hex.substring(2,4), 16); - blueColor = parseInt(hex.substring(4,6), 16); - - result = 'rgba('+redColor+','+greenColor+','+blueColor+','+opacity/100+')'; - return result; -} - -var loadJS = function(url, implementationCode, location) { - var scriptTag = document.createElement('script'); - scriptTag.src = url; - - scriptTag.onload = implementationCode; - scriptTag.onreadystatechange = implementationCode; - - location.appendChild(scriptTag); -}; - - - -function ajaxio(method,url,type=null,data=null) { - return new Promise((resolve, reject) => { - const req = new XMLHttpRequest(); - req.open(method, url, true); - - if (method == 'POST') { - if (type == 'json' && data != null) { - req.setRequestHeader('Content-Type', 'application/json'); - var data = JSON.stringify(data); - } - else { req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } - } - - req.onload = () => req.status === 200 ? resolve(req.response) : reject(Error(req.statusText)); - req.onerror = (e) => reject(Error(`Network Error: ${e}`)); - - if (method == 'POST') { req.send(data); } - else { req.send(); } - }); -} - - -Object.prototype.addMultiListener = function(eventNames, listener) { - var events = eventNames.split(' '); - - if (NodeList.prototype.isPrototypeOf(this) == true) { - for (var x=0, xLen=this.length; x'; - - - if (document.getElementById(statusID)) { } - else { - var newStatus = document.createElement('li'); - newStatus.classList.add('icon', 'customstatus'); - newStatus.id = statusID; - - motherStatus.insertBefore(newStatus, motherStatus.firstChild); - - saferInnerHTML(document.getElementById(statusID), statusIcon); - } - }, - - - setStatus: function(data) { - - if (data.isdead == true) { - if (document.querySelector('#health').classList.contains('dead') == false) { - document.querySelector('#health').classList.add('dead'); - for (i = 0; i < data.status.length; i++) { document.querySelector('#'+data.status[i].name+' span').style.height = '0'; } - } - } - else { - for (i = 0; i < data.status.length; i++) { - if ((data.status[i].name == 'hunger') || (data.status[i].name == 'thirst')) { var statusValue = Math.floor(100 - data.status[i].value); } - else { var statusValue = Math.floor(data.status[i].value); } - if (document.querySelector('#'+data.status[i].name+' span')) { document.querySelector('#'+data.status[i].name+' span').style.height = statusValue+'%'; } - if (statusValue <= 35) { - if (document.querySelector('#'+data.status[i].name)) { - if (document.querySelector('#'+data.status[i].name).classList.contains('dying') == false) { - document.querySelector('#'+data.status[i].name).classList.add('dying'); - } - } - } - else { - if (document.querySelector('#'+data.status[i].name)) { document.querySelector('#'+data.status[i].name).classList.remove('dying'); } - - } - } - if (document.querySelector('#health').classList.contains('dead')) { document.querySelector('#health').classList.remove('dead'); } - } - }, - - - updateWeapon: function(data) { - var weaponContainer = document.querySelector('#weapon'); - var bulletsContainer = document.querySelector('#bullets'); - - if (data.status.armed == true) { - - var oldWeapon = document.querySelector('#weapon_image img').src; - var newWeapon = 'img/weapons/'+data.status.weapon+'.png'; - if (oldWeapon != newWeapon) { document.querySelector('#weapon_image img').src = newWeapon; } - - if (weaponContainer.classList.contains('armed') == false) { - weaponContainer.classList.remove('unarmed', 'fadeOut'); - weaponContainer.classList.add('armed', 'fadeIn'); - } - - } - else { - - if (weaponContainer.classList.contains('unarmed') == false) { - weaponContainer.classList.remove('armed', 'fadeIn'); - weaponContainer.classList.add('unarmed', 'fadeOut'); - } - - } - }, - - - - - - - updateVehicle: function(data) { - - var vehicleInfo = document.querySelector('.info.vehicle'); - var vehicleSeatbelt = document.querySelector('#seatbelt'); - var vehicleLights = document.querySelector('#lights'); - var vehicleSignals = document.querySelector('#signals'); - var vehicleFuel = document.querySelector('#fuel'); - var vehicleCruiser = document.querySelector('#vehicle-speed strong'); - var vehiclesCars = [0,1,2,3,4,5,6,7,8,9,10,11,12,17,18,19,20]; - - if (data.status == true) { - if (vehicleInfo.classList.contains('inactive')) { - - vehicleSeatbelt.style.display = 'none'; - vehicleLights.style.display = 'none'; - vehicleSignals.style.display = 'none'; - vehicleFuel.style.display = 'none'; - - if (vehiclesCars.indexOf(data.type) > -1) { - document.querySelector('#vehicle-others').style.display = 'none'; - document.querySelector('#vehicle-gear').style.display = 'block'; - - vehicleSeatbelt.style.display = 'block'; - vehicleLights.style.display = 'block'; - vehicleSignals.style.display = 'block'; - vehicleFuel.style.display = 'block'; - - document.querySelector('#vehicle-gear').style.display = 'block'; - } - - else { - document.querySelector('#vehicle-others').style.display = 'block'; - document.querySelector('#vehicle-gear').style.display = 'none'; - document.querySelector('#vehicle-others i').classList.remove('fa-biking', 'fa-helicopter', 'fa-ship'); - - if (data.type == 13) { document.querySelector('#vehicle-others i').classList.add('fa-biking'); } - else if (data.type == 14) { document.querySelector('#vehicle-others i').classList.add('fa-ship'); } - else if (data.type == 15) { document.querySelector('#vehicle-others i').classList.add('fa-helicopter'); } - else if (data.type == 16) { document.querySelector('#vehicle-others i').classList.add('fa-plane'); } - else if (data.type == 21) { document.querySelector('#vehicle-others i').classList.add('fa-train'); } - } - - vehicleInfo.classList.remove('inactive'); - vehicleInfo.classList.add('active', 'fadeIn'); - } - - if (vehicleInfo.classList.contains('updated') == false) { - - var vehicleSpeedUnit = data.config.speedUnit.slice(0,2)+'/'+data.config.speedUnit.slice(-1); - var vehicleAverageSpeed = Math.ceil(data.config.maxSpeed / 6); - - vehicleInfo.classList.add('updated'); - saferInnerHTML(vehicleCruiser,vehicleSpeedUnit); - - } - - - - - var previousGear = document.querySelector('#vehicle-gear span').innerHTML; - var currentGear = data.gear; - if (previousGear != currentGear) { document.querySelector('#vehicle-gear').classList.add('pulse') } - saferInnerHTML(document.querySelector('#vehicle-gear span'), data.gear); - - - - - - - var speedometerCircle = document.querySelector('#progress-speed svg circle.speed'); - var speedPercentage = Math.floor(Math.floor(data.speed*100)/data.config.maxSpeed); - - speedometerCircle.classList.remove('zero'); - speedometerCircle.classList.remove('twentyfive'); - speedometerCircle.classList.remove('fifty'); - speedometerCircle.classList.remove('seventyfive'); - - if (speedPercentage >= 0 && speedPercentage <= 25) { speedometerCircle.classList.add('zero'); } - else if (speedPercentage > 25 && speedPercentage <= 50) { speedometerCircle.classList.add('twentyfive'); } - else if (speedPercentage > 50 && speedPercentage <= 75) { speedometerCircle.classList.add('fifty'); } - else if (speedPercentage > 75) { speedometerCircle.classList.add('seventyfive'); } - - document.querySelector('#progress-speed svg circle.speed').style.strokeDashoffset = data.nail; - saferInnerHTML(document.querySelector('#vehicle-speed span'), data.speed); - - - - - - - - - if ( (data.seatbelt.status == true) && (vehicleSeatbelt.classList.contains('on') == false) ) { - vehicleSeatbelt.classList.remove('off'); - vehicleSeatbelt.classList.add('on'); - - eventCallback.sound('sounds/seatbelt-buckle.ogg', { volume: '0.50' }); - } - else if ( (data.seatbelt.status == false) && (vehicleSeatbelt.classList.contains('off') == false) ) { - vehicleSeatbelt.classList.remove('on'); - vehicleSeatbelt.classList.add('off'); - - eventCallback.sound('sounds/seatbelt-unbuckle.ogg', { volume: '0.50' }); - } - - - - - - - - - - - if (vehicleCruiser.classList.contains(data.cruiser) == false) { - vehicleCruiser.classList.remove('on','off'); - vehicleCruiser.classList.add(data.cruiser); - } - - - - - if (data.siren == true) { document.querySelector('#vehicle-gear').classList.add('pulsing'); } - else { document.querySelector('#vehicle-gear').classList.remove('pulsing'); } - - - - - - - if (vehicleLights.classList.contains(data.lights) == false) { - vehicleLights.classList.remove('normal','high','off'); - vehicleLights.classList.add(data.lights); - - if (data.lights == 'high') { vehicleLights.querySelector('i img').src = 'img/vehicle-lights-high.png'; } - else { vehicleLights.querySelector('i img').src = 'img/vehicle-lights.png'; } - } - - - - - - - - - - - if (vehicleSignals.classList.contains(data.signals) == false) { - - vehicleSignals.querySelector('i').className = 'fa fa-arrows-alt-h'; - vehicleSignals.classList.remove('left','right','both','off'); - - if ( (data.signals == 'left') || (data.signals == 'right') || (data.signals == 'both') ) { - - var classSignal = 'fa-long-arrow-alt-'+data.signals; - if (data.signals == 'both') { classSignal = 'fa-arrows-alt-h'; } - - vehicleSignals.querySelector('i').classList.add('fas',classSignal); - vehicleSignals.classList.add(data.signals, 'dying'); - - eventCallback.sound('sounds/car-indicators.ogg', { loop: 'loop' }); - } - - else if (data.signals == 'off') { - vehicleSignals.querySelector('i').classList.add('fas','fa-arrows-alt-h'); - vehicleSignals.classList.remove('dying'); - vehicleSignals.classList.add(data.signals); - - eventCallback.sound(); - } - - - } - - - - - - - - - - - - - vehicleFuel.querySelector('span').style.height = data.fuel+'%'; - - if (data.fuel <= 35) { - if (vehicleFuel.classList.contains('dying') == false) { vehicleFuel.classList.add('dying'); } - } - else { vehicleFuel.classList.remove('dying'); } - - } - else { - if (vehicleInfo.classList.contains('active')) { - vehicleSeatbelt.classList.remove('on'); - vehicleCruiser.classList.remove('on'); - - vehicleInfo.classList.remove('active'); - vehicleInfo.classList.add('inactive', 'fadeOut'); - - eventCallback.sound(); - } - - } - - }, - - toggleUi: function(data) { - var uiID = document.querySelector('#ui'); - if (data.value == true) { - uiID.style.display = 'block'; - } - else { - uiID.style.display = 'none'; - } - }, - - sound: function(file = null, args = null) { - var sound = document.querySelector('#sounds'); - var soundFile = file; - var args = args; - - for (i = 0; i < sound.attributes.length; i++) { - if (sound.attributes[i].name != 'id') { sound.removeAttribute(sound.attributes[i].name); } - } - - if (soundFile == null) { sound.setAttribute('src', ''); } - else { - if (args == null) { } - else { - for (var key in args) { - if (key != 'addMultiListener') { - if (key == 'volume') { sound.volume = args[key]; } - else { sound.setAttribute(key, args[key]); } - } - } - } - - sound.setAttribute('src', soundFile); - sound.play(); - } - - - }, - - - - - - - - - - - - - - - - - - - - - - - - - - }; - - document.querySelectorAll('.icon i').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { this.parentElement.classList.remove('pulse'); this.parentElement.classList.remove('shooting'); }); - - document.querySelectorAll('.info.vehicle').addMultiListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { - this.classList.remove('fadeOut', 'fadeIn'); - }); - - - - window.addEventListener('message', function(event) { - eventCallback[event.data.action](event.data); - }); - -} \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/html/img/vehicle-gear.png b/VRPEX/trew_hud_ui/html/img/vehicle-gear.png deleted file mode 100644 index d001954..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/vehicle-gear.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/vehicle-lights-high.png b/VRPEX/trew_hud_ui/html/img/vehicle-lights-high.png deleted file mode 100644 index a7f8325..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/vehicle-lights-high.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/vehicle-lights.png b/VRPEX/trew_hud_ui/html/img/vehicle-lights.png deleted file mode 100644 index c0cd51b..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/vehicle-lights.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/vehicle-seatbelt.png b/VRPEX/trew_hud_ui/html/img/vehicle-seatbelt.png deleted file mode 100644 index c05edd8..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/vehicle-seatbelt.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapon-bullets.png b/VRPEX/trew_hud_ui/html/img/weapon-bullets.png deleted file mode 100644 index b0b1d4e..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapon-bullets.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/advancedrifle.png b/VRPEX/trew_hud_ui/html/img/weapons/advancedrifle.png deleted file mode 100644 index 282aa82..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/advancedrifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/appistol.png b/VRPEX/trew_hud_ui/html/img/weapons/appistol.png deleted file mode 100644 index 7be7761..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/appistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/assaultrifle.png b/VRPEX/trew_hud_ui/html/img/weapons/assaultrifle.png deleted file mode 100644 index 40c4bee..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/assaultrifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png deleted file mode 100644 index b9b7517..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/assaultrifle_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/assaultshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/assaultshotgun.png deleted file mode 100644 index 822d832..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/assaultshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/assaultsmg.png b/VRPEX/trew_hud_ui/html/img/weapons/assaultsmg.png deleted file mode 100644 index d787be5..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/assaultsmg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/autoshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/autoshotgun.png deleted file mode 100644 index a27c195..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/autoshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/ball.png b/VRPEX/trew_hud_ui/html/img/weapons/ball.png deleted file mode 100644 index aa66e26..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/ball.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/bat.png b/VRPEX/trew_hud_ui/html/img/weapons/bat.png deleted file mode 100644 index f215038..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/bat.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/battleaxe.png b/VRPEX/trew_hud_ui/html/img/weapons/battleaxe.png deleted file mode 100644 index 99542b3..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/battleaxe.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/bottle.png b/VRPEX/trew_hud_ui/html/img/weapons/bottle.png deleted file mode 100644 index 2743bc6..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/bottle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/bullpuprifle.png b/VRPEX/trew_hud_ui/html/img/weapons/bullpuprifle.png deleted file mode 100644 index ddc0657..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/bullpuprifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png deleted file mode 100644 index a7a1681..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/bullpuprifle_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/bullpupshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/bullpupshotgun.png deleted file mode 100644 index 285a487..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/bullpupshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/bzgas.png b/VRPEX/trew_hud_ui/html/img/weapons/bzgas.png deleted file mode 100644 index 49cc6a5..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/bzgas.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/carbinerifle.png b/VRPEX/trew_hud_ui/html/img/weapons/carbinerifle.png deleted file mode 100644 index 7f5f213..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/carbinerifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png deleted file mode 100644 index 63368f2..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/carbinerifle_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/combatmg.png b/VRPEX/trew_hud_ui/html/img/weapons/combatmg.png deleted file mode 100644 index 81fd9bc..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/combatmg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/combatmg_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/combatmg_mk2.png deleted file mode 100644 index 0799024..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/combatmg_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/combatpdw.png b/VRPEX/trew_hud_ui/html/img/weapons/combatpdw.png deleted file mode 100644 index 89b8dff..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/combatpdw.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/combatpistol.png b/VRPEX/trew_hud_ui/html/img/weapons/combatpistol.png deleted file mode 100644 index e586f69..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/combatpistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/compactlauncher.png b/VRPEX/trew_hud_ui/html/img/weapons/compactlauncher.png deleted file mode 100644 index b879d34..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/compactlauncher.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/compactrifle.png b/VRPEX/trew_hud_ui/html/img/weapons/compactrifle.png deleted file mode 100644 index 6897cd4..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/compactrifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/crowbar.png b/VRPEX/trew_hud_ui/html/img/weapons/crowbar.png deleted file mode 100644 index 13e4745..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/crowbar.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/dagger.png b/VRPEX/trew_hud_ui/html/img/weapons/dagger.png deleted file mode 100644 index e270fdb..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/dagger.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/dbshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/dbshotgun.png deleted file mode 100644 index 932cbbe..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/dbshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/doubleaction.png b/VRPEX/trew_hud_ui/html/img/weapons/doubleaction.png deleted file mode 100644 index bdbb076..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/doubleaction.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/firework.png b/VRPEX/trew_hud_ui/html/img/weapons/firework.png deleted file mode 100644 index f27bee3..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/firework.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/flare.png b/VRPEX/trew_hud_ui/html/img/weapons/flare.png deleted file mode 100644 index 890cc51..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/flare.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/flaregun.png b/VRPEX/trew_hud_ui/html/img/weapons/flaregun.png deleted file mode 100644 index a163d80..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/flaregun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/flashlight.png b/VRPEX/trew_hud_ui/html/img/weapons/flashlight.png deleted file mode 100644 index 4bfd7d4..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/flashlight.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/golfclub.png b/VRPEX/trew_hud_ui/html/img/weapons/golfclub.png deleted file mode 100644 index a599062..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/golfclub.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/grenade.png b/VRPEX/trew_hud_ui/html/img/weapons/grenade.png deleted file mode 100644 index 81863d7..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/grenade.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/grenadelauncher.png b/VRPEX/trew_hud_ui/html/img/weapons/grenadelauncher.png deleted file mode 100644 index cca0001..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/grenadelauncher.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png b/VRPEX/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png deleted file mode 100644 index cca0001..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/grenadelauncher_smoke.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/gusenberg.png b/VRPEX/trew_hud_ui/html/img/weapons/gusenberg.png deleted file mode 100644 index 1fcb2cb..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/gusenberg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/hammer.png b/VRPEX/trew_hud_ui/html/img/weapons/hammer.png deleted file mode 100644 index 6a1980e..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/hammer.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/hatchet.png b/VRPEX/trew_hud_ui/html/img/weapons/hatchet.png deleted file mode 100644 index 1611d00..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/hatchet.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/heavypistol.png b/VRPEX/trew_hud_ui/html/img/weapons/heavypistol.png deleted file mode 100644 index fc2fd7d..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/heavypistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/heavyshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/heavyshotgun.png deleted file mode 100644 index 6cb1a5e..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/heavyshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/heavysniper.png b/VRPEX/trew_hud_ui/html/img/weapons/heavysniper.png deleted file mode 100644 index 4d6c522..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/heavysniper.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/heavysniper_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/heavysniper_mk2.png deleted file mode 100644 index 8a7899a..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/heavysniper_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/hominglauncher.png b/VRPEX/trew_hud_ui/html/img/weapons/hominglauncher.png deleted file mode 100644 index 825fc62..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/hominglauncher.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/knife.png b/VRPEX/trew_hud_ui/html/img/weapons/knife.png deleted file mode 100644 index 37d4efc..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/knife.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/knuckle.png b/VRPEX/trew_hud_ui/html/img/weapons/knuckle.png deleted file mode 100644 index 2b96f5b..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/knuckle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/machete.png b/VRPEX/trew_hud_ui/html/img/weapons/machete.png deleted file mode 100644 index c1ad676..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/machete.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/machinepistol.png b/VRPEX/trew_hud_ui/html/img/weapons/machinepistol.png deleted file mode 100644 index 0219843..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/machinepistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/marksmanpistol.png b/VRPEX/trew_hud_ui/html/img/weapons/marksmanpistol.png deleted file mode 100644 index 586bc20..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/marksmanpistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/marksmanrifle.png b/VRPEX/trew_hud_ui/html/img/weapons/marksmanrifle.png deleted file mode 100644 index 6df75b6..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/marksmanrifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png deleted file mode 100644 index 9348d13..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/marksmanrifle_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/mg.png b/VRPEX/trew_hud_ui/html/img/weapons/mg.png deleted file mode 100644 index 113bd19..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/mg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/microsmg.png b/VRPEX/trew_hud_ui/html/img/weapons/microsmg.png deleted file mode 100644 index 9a5b739..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/microsmg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/minigun.png b/VRPEX/trew_hud_ui/html/img/weapons/minigun.png deleted file mode 100644 index 5c21459..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/minigun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/minismg.png b/VRPEX/trew_hud_ui/html/img/weapons/minismg.png deleted file mode 100644 index 35cb809..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/minismg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/molotov.png b/VRPEX/trew_hud_ui/html/img/weapons/molotov.png deleted file mode 100644 index ef78455..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/molotov.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/musket.png b/VRPEX/trew_hud_ui/html/img/weapons/musket.png deleted file mode 100644 index 846f0ea..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/musket.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/nightstick.png b/VRPEX/trew_hud_ui/html/img/weapons/nightstick.png deleted file mode 100644 index 2f4b833..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/nightstick.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/petrolcan.png b/VRPEX/trew_hud_ui/html/img/weapons/petrolcan.png deleted file mode 100644 index 4cc0863..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/petrolcan.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/pipebomb.png b/VRPEX/trew_hud_ui/html/img/weapons/pipebomb.png deleted file mode 100644 index aef7e97..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/pipebomb.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/pistol.png b/VRPEX/trew_hud_ui/html/img/weapons/pistol.png deleted file mode 100644 index 596cd6f..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/pistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/pistol50.png b/VRPEX/trew_hud_ui/html/img/weapons/pistol50.png deleted file mode 100644 index d55b730..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/pistol50.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/pistol_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/pistol_mk2.png deleted file mode 100644 index fcbbfa2..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/pistol_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/poolcue.png b/VRPEX/trew_hud_ui/html/img/weapons/poolcue.png deleted file mode 100644 index ec5743f..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/poolcue.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/proxmine.png b/VRPEX/trew_hud_ui/html/img/weapons/proxmine.png deleted file mode 100644 index 669140e..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/proxmine.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/pumpshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/pumpshotgun.png deleted file mode 100644 index bb3feaa..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/pumpshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png deleted file mode 100644 index b936ba9..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/pumpshotgun_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/railgun.png b/VRPEX/trew_hud_ui/html/img/weapons/railgun.png deleted file mode 100644 index a561140..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/railgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/raycarbine.png b/VRPEX/trew_hud_ui/html/img/weapons/raycarbine.png deleted file mode 100644 index 709ffc0..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/raycarbine.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/rayminigun.png b/VRPEX/trew_hud_ui/html/img/weapons/rayminigun.png deleted file mode 100644 index 140c97f..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/rayminigun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/raypistol.png b/VRPEX/trew_hud_ui/html/img/weapons/raypistol.png deleted file mode 100644 index b9e56d6..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/raypistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/revolver.png b/VRPEX/trew_hud_ui/html/img/weapons/revolver.png deleted file mode 100644 index a5e529f..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/revolver.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/revolver_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/revolver_mk2.png deleted file mode 100644 index 500f9c1..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/revolver_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/rpg.png b/VRPEX/trew_hud_ui/html/img/weapons/rpg.png deleted file mode 100644 index f108bd4..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/rpg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/sawnoffshotgun.png b/VRPEX/trew_hud_ui/html/img/weapons/sawnoffshotgun.png deleted file mode 100644 index b722a44..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/sawnoffshotgun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/smg.png b/VRPEX/trew_hud_ui/html/img/weapons/smg.png deleted file mode 100644 index 69380b2..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/smg.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/smg_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/smg_mk2.png deleted file mode 100644 index fb90422..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/smg_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/smokegrenade.png b/VRPEX/trew_hud_ui/html/img/weapons/smokegrenade.png deleted file mode 100644 index 49cc6a5..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/smokegrenade.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/sniperrifle.png b/VRPEX/trew_hud_ui/html/img/weapons/sniperrifle.png deleted file mode 100644 index 0093806..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/sniperrifle.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/snowball.png b/VRPEX/trew_hud_ui/html/img/weapons/snowball.png deleted file mode 100644 index 01157fd..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/snowball.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/snspistol.png b/VRPEX/trew_hud_ui/html/img/weapons/snspistol.png deleted file mode 100644 index 0991add..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/snspistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/snspistol_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/snspistol_mk2.png deleted file mode 100644 index 7b11a78..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/snspistol_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/specialcarbine.png b/VRPEX/trew_hud_ui/html/img/weapons/specialcarbine.png deleted file mode 100644 index e8982f5..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/specialcarbine.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png b/VRPEX/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png deleted file mode 100644 index b69bdd1..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/specialcarbine_mk2.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/stickybomb.png b/VRPEX/trew_hud_ui/html/img/weapons/stickybomb.png deleted file mode 100644 index 06f718f..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/stickybomb.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/stone_hatchet.png b/VRPEX/trew_hud_ui/html/img/weapons/stone_hatchet.png deleted file mode 100644 index a24ca95..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/stone_hatchet.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/stungun.png b/VRPEX/trew_hud_ui/html/img/weapons/stungun.png deleted file mode 100644 index 3b36f8e..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/stungun.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/switchblade.png b/VRPEX/trew_hud_ui/html/img/weapons/switchblade.png deleted file mode 100644 index e4675c8..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/switchblade.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/unarmed.png b/VRPEX/trew_hud_ui/html/img/weapons/unarmed.png deleted file mode 100644 index 1e6ad23..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/unarmed.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/vintagepistol.png b/VRPEX/trew_hud_ui/html/img/weapons/vintagepistol.png deleted file mode 100644 index e9a3d8c..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/vintagepistol.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/img/weapons/wrench.png b/VRPEX/trew_hud_ui/html/img/weapons/wrench.png deleted file mode 100644 index f3a75fd..0000000 Binary files a/VRPEX/trew_hud_ui/html/img/weapons/wrench.png and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/main.css b/VRPEX/trew_hud_ui/html/main.css deleted file mode 100644 index 0f9bb65..0000000 --- a/VRPEX/trew_hud_ui/html/main.css +++ /dev/null @@ -1,234 +0,0 @@ -*, *:before, *:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - - margin: 0; - padding: 0; -} - -body,html { width: 100%; height: 100%; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - -} - -body { /*background: url('https://i.imgur.com/MoYBh1e.jpg') center center no-repeat; background-size: cover;*/ } - -#ui { position: relative; width: 100%; height: 100%; overflow: hidden; } -div.separator { display: block; clear: both; width: 100%; } - - - - -.icon { display: block; position: relative; padding: 10px 8px; margin: 10px 5px 0 5px; width: 30px; height: 30px; border-radius: 100px; overflow: hidden; background: rgba(0,0,0,0.35); } - -.icon i { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #FFF; z-index: 11; font-size: 15px; } -.icon img { width: 16px; margin: -3px 0 0 0; } -.icon span { display: block; position: absolute; left: 50%; bottom: 0; transform: translate(-50%,0); width: 100%; height: 100%; } - -.icon.text { display: inline-block; overflow: visible; width: auto; padding: 0; } -.icon.text i { display: inline-block; float: left; transform: translate(0%,0%); left: 0; top: 0; position: relative; padding: 10px 8px; width: 30px; height: 30px; border-radius: 100px; color: #FFF; } -.icon.text i:before { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); } -.icon.text span { position: relative; width: auto; height: auto; left: 0; transform: translate(0,0); display: inline-block; font-size: 12px; padding: 7px 15px 0 10px; font-weight: 700; color: #FFF; } - - -.icon.dying:not(.customstatus) span { animation: trew-status-blink 500ms infinite; } -.icon.pulse i { animation: trew-pulse 500ms 1; } - - - - -.info { position: absolute; } - -.info.server { top: 45px; right: 26px; width: 90px; height: 90px; } -.info.server #server img { max-width: 100%; opacity: 0.75; } - -.info.player { top: 140px; right: 25px; text-align: right;} -.info.player #job span { font-size: 24px; color: #FFF; font-weight: 900; text-transform: uppercase; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } - - - - - -.info.player #money div[id] { float: right; } - -.info.player #money { clear: both; } -.info.player #money #wallet i { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.player #money #blackMoney i { background: linear-gradient(180deg, #474747 0%, #252525 100%); } -.info.player #money #bank i { background: linear-gradient(180deg, #c70a0a 0%, #960505 100%); } -.info.player #money #society i { background: linear-gradient(180deg, #874c14 0%, #6a3c10 100%); } - -/*.info.player #money #wallet i:before { content: '\f153'; }*/ - - -.info.player #status { clear: both; } -.info.player #status ul { margin: 10px 0 0 0; } -.info.player #status ul li { float: right;} -.info.player #status ul li#health span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.player #status ul li#armor span { background: linear-gradient(180deg, #0bcfe6 0%, #0aa3b5 100%); } -.info.player #status ul li#stamina span { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } -.info.player #status ul li#hunger span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } -.info.player #status ul li#thirst span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } -.info.player #status ul li#health.dead { animation: trew-pulse 500ms infinite; } -.info.player #status ul li#health.dead span { height: 0 !important; } -.info.player #status ul li#health.dead i.fas:before { content: '\f714'; } - -.info.vehicle { bottom: 20px; left: 50%; transform: translate(-50%,0); z-index: 11; } -.info.vehicle.active { opacity: 1; } -.info.vehicle.inactive { opacity: 0; } - - -.info.vehicle #speedometer { position: relative; width: 270px; height: 130px; } -.info.vehicle #speedometer svg { position: absolute; top: 0; left: 50%; transform: translate(-50%,0) rotate(138deg); width: 130px; } - -.info.vehicle #speedometer svg circle { display: block; fill: transparent; stroke-width: 5px; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 75; transform-origin: 50% 50%; } -.info.vehicle #speedometer svg circle.mask { stroke: rgba(0,0,0,0.35); } -.info.vehicle #speedometer svg circle.speed { stroke: url(#speed-gradient); stroke-dashoffset: 180; } -.info.vehicle #speedometer svg:first-child { z-index: 11; } - - -.info.vehicle #speedometer svg circle { transition: all 250ms linear; } -.info.vehicle #speedometer svg circle.zero { stroke: #00c3ff; stroke-dashoffset: 235; } -.info.vehicle #speedometer svg circle.twentyfive { stroke: #18b70b; stroke-dashoffset: 180; } -.info.vehicle #speedometer svg circle.fifty { stroke: #ff8000; stroke-dashoffset: 125; } -.info.vehicle #speedometer svg circle.seventyfive { stroke: #ff0000; stroke-dashoffset: 75; } - - -.info.vehicle #speedometer #vehicle-speed { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; color: #FFF;} -.info.vehicle #speedometer #vehicle-speed span { display: block; font-weight: 900; font-size: 30px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); } - - .info.vehicle #speedometer #vehicle-speed strong { display: inline-block; font-size: 10px; font-weight: 900; padding: 2px 5px; border-radius: 100px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); transition: all 150ms linear; } - .info.vehicle #speedometer #vehicle-speed strong.on { background: #18b70b; } - -.info.vehicle #speedometer #vehicle-gear, -.info.vehicle #speedometer #vehicle-others { position: absolute; bottom: 0; left: 50%; width: 69px; transform: translate(-50%,0); margin: auto; border: 2px solid transparent; } - -.info.vehicle #speedometer #vehicle-gear.pulsing { animation: trew-siren 1s infinite; } - -.info.vehicle #speedometer #vehicle-gear i { top: -2px; } -.info.vehicle #speedometer #vehicle-gear span { padding: 5px 15px 0 10px; } - - -.info.vehicle #speedometer #vehicle-status-left { position: absolute; bottom: 0; left: 0; } -.info.vehicle #speedometer #vehicle-status-left ul li { float: left; } - -.info.vehicle #speedometer #vehicle-status-right { position: absolute; bottom: 0; right: 0; } -.info.vehicle #speedometer #vehicle-status-right ul li { float: left; } - -.info.vehicle #speedometer li#seatbelt span { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.vehicle #speedometer li#seatbelt.on span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } - -.info.vehicle #speedometer li#fuel span { background: linear-gradient(180deg, #ff8000 0%, #cd6700 100%); } - -.info.vehicle #speedometer li#lights.normal span, -.info.vehicle #speedometer li#lights.high span { background: linear-gradient(180deg, #00c3ff 0%, #008fbb 100%); } - -.info.vehicle #speedometer li#signals.dying span { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); animation: trew-status-blink 750ms infinite; } - - - - - - - - -.info.weapon { bottom: 85px; right: 25px; } -.info.weapon.armed { display: block; opacity: 1; } -.info.weapon.unarmed { display: none; opacity: 0; } - -.info.weapon #weapon_image { float: left; width: 200px; height: 40px; text-align: left; position: relative; } -.info.weapon #weapon_image img { position: absolute; top: 50%; right: 25px; transform: translateY(-50%); height: 40px; } - -.info.weapon #weapon_bullets { color: #FFF; float: left; width: 35px; text-shadow: 0px 1px 1px rgba(0,0,0,0.75); line-height: 1; } -.info.weapon #weapon_bullets .clip { font-weight: 900; font-size: 22px; } -.info.weapon #weapon_bullets .ammo { font-weight: 700; font-size: 16px; opacity: 0.7;} - - -.info.weapon #bullets { margin: 0; float: left; margin: 5px 0 0 20px; overflow: visible; transform: scale(1.1); } -.info.weapon #bullets i { color: #FFF; float: right; height: 34px; width: 34px; border-radius: 100px; } -.info.weapon #bullets i.clone { background: none; position: absolute; float: none; top: 15px; left: inherit; left: 10px; opacity: 0; } -.info.weapon #bullets.shooting i.clone { animation: trew-bullets 250ms 1; } -.info.weapon #bullets i img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-35%); } - - - - - - -.info.radio { bottom: 19px; right: 25px; z-index: 11; } -.info.radio #voice { width: 35px; height: 35px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); text-align: center; padding: 7px 0 0 0; transition: all 0.1s linear; } - -.info.radio #voice.whisper { background: linear-gradient(180deg, #ffb700 0%, #e0a102 100%); } -.info.radio #voice.normal { background: linear-gradient(180deg, #18b70b 0%, #128c08 100%); } -.info.radio #voice.shout { background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%); } -.info.radio #voice i.fas { font-size: 18px; color: #FFF; } -.info.radio #voice.speak { animation: trew-soundwave 1s infinite; } - -.info.time-and-place { position: absolute; bottom: 18px; right: 65px; height: 38px; font-size: 11px; color: #FFF; background: rgba(0,0,0,0.35); border-radius: 100px; text-align: right; } - -.info.time-and-place .data { position: relative; top: 50%; transform: translate(0,-50%); } -.info.time-and-place .data div { padding: 0 25px; } - - - -@keyframes trew-siren { - 0% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } - 50% { border-color: rgba(255,0,0,1); box-shadow: 0 0 10px 10px rgba(255,0,0,0.50); } - 100% { border-color: rgba(255,0,0,0); box-shadow: 0 0 10px 10px rgba(255,0,0,0); } -} - -@keyframes trew-soundwave { - 0% { box-shadow: 0 0 0 0px rgba(255,255,255,0.75); } - 100% { box-shadow: 0 0 0 25px rgba(255,255,255,0); } -} - -@keyframes trew-status-blink { - 0% { opacity: 0; } - 50% { opacity: 1; } - 100% { opacity: 0; } -} - -@keyframes trew-pulse { - 0% { transform: scale(1); } - 25% { transform: scale(1.5); } - 100% { transform: scale(1); } -} - -@keyframes trew-speed { - 0% { stroke-dashoffset: 280; } - 50% { stroke-dashoffset: 75; } - 100% { stroke-dashoffset: 280; } -} - -@keyframes trew-bullets { - 0% { opacity: 0; } - 25% { opacity: 1; } - 100% { transform: translate(30px,-60px) rotate(90deg); opacity: 0;} -} - -@keyframes trew-rainbow{ - 100%, - 0%{ background: rgba(255,0,0,0.70); } - 8%{ background: rgba(255,127,0,0.70); } - 16%{ background: rgba(230,205,23,0.70); } - 25%{ background: rgba(127,255,0,0.70); } - 33%{ background: rgba(0,255,0,0.70); } - 41%{ background: rgba(0,255,127,0.70); } - 50%{ background: rgba(0,255,255,0.70); } - 58%{ background: rgba(0,127,255,0.70); } - 66%{ background: rgba(0,0,255,0.70); } - 75%{ background: rgba(127,0,255,0.70); } - 83%{ background: rgba(255,0,255,0.70); } - 91%{ background: rgba(255,0,127,0.70); } -} \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/html/sounds/car-indicators.ogg b/VRPEX/trew_hud_ui/html/sounds/car-indicators.ogg deleted file mode 100644 index 4225cf2..0000000 Binary files a/VRPEX/trew_hud_ui/html/sounds/car-indicators.ogg and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/sounds/seatbelt-buckle.ogg b/VRPEX/trew_hud_ui/html/sounds/seatbelt-buckle.ogg deleted file mode 100644 index 70c20ea..0000000 Binary files a/VRPEX/trew_hud_ui/html/sounds/seatbelt-buckle.ogg and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg b/VRPEX/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg deleted file mode 100644 index 66394bd..0000000 Binary files a/VRPEX/trew_hud_ui/html/sounds/seatbelt-unbuckle.ogg and /dev/null differ diff --git a/VRPEX/trew_hud_ui/html/ui.html b/VRPEX/trew_hud_ui/html/ui.html deleted file mode 100644 index c1e7b7a..0000000 --- a/VRPEX/trew_hud_ui/html/ui.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - TREW UI - - - -
- - - - - -
- - -
-
    - - - - - -
-
- -
- - - - -
- - -
- - - - - - - -
- -
- - -
- - - - -
- - - -
- 999 - KM/H -
- - - -
- N -
- - - - - -
-
    -
  • -
  • -
-
- - -
-
    -
  • -
  • -
-
- - - -
- - - - - -
- - - - - - - - - - - - - - -
- -
- - - - - - - -
-
- - -
-
- - - -
- - - - - diff --git a/VRPEX/trew_hud_ui/locales/languages.lua b/VRPEX/trew_hud_ui/locales/languages.lua deleted file mode 100644 index 45ceb89..0000000 --- a/VRPEX/trew_hud_ui/locales/languages.lua +++ /dev/null @@ -1,160 +0,0 @@ -Locales = { - - --- Brazilian Portuguese -['br'] = { - ['you_are_on_location'] = 'Você está em %s', - - ['date_format'] = { - default = 'Hoje é %s de %s de %s', - simple = 'Hoje é %s de %s', - simpleWithHours = 'São %s do dia %s de %s', - withWeekday = 'Hoje é %s, %s de %s de %s', - withHours = 'São %s do dia %s de %s de %s', - withWeekdayAndHours = 'São %s de %s, %s de %s de %s' - }, - - ['weekDay_0'] = 'Domingo', - ['weekDay_1'] = 'Segunda-feira', - ['weekDay_2'] = 'Terça-feira', - ['weekDay_3'] = 'Quarta-feira', - ['weekDay_4'] = 'Quinta-feira', - ['weekDay_5'] = 'Sexta-feira', - ['weekDay_6'] = 'Sábado', - - ['day_1'] = '1', - ['day_2'] = '2', - ['day_3'] = '3', - ['day_4'] = '4', - ['day_5'] = '5', - ['day_6'] = '6', - ['day_7'] = '7', - ['day_8'] = '8', - ['day_9'] = '9', - - ['day_10'] = '10', - ['day_11'] = '11', - ['day_12'] = '12', - ['day_13'] = '13', - ['day_14'] = '14', - ['day_15'] = '15', - ['day_16'] = '16', - ['day_17'] = '17', - ['day_18'] = '18', - ['day_19'] = '19', - - ['day_20'] = '20', - ['day_21'] = '21', - ['day_22'] = '22', - ['day_23'] = '23', - ['day_24'] = '24', - ['day_25'] = '25', - ['day_26'] = '26', - ['day_27'] = '27', - ['day_28'] = '28', - ['day_29'] = '29', - - ['day_30'] = '30', - ['day_31'] = '31', - - ['month_0'] = 'Janeiro', - ['month_1'] = 'Fevereiro', - ['month_2'] = 'Março', - ['month_3'] = 'Abril', - ['month_4'] = 'Maio', - ['month_5'] = 'Junho', - ['month_6'] = 'Julho', - ['month_7'] = 'Agosto', - ['month_8'] = 'Setembro', - ['month_9'] = 'Outubro', - ['month_10'] = 'Novembro', - ['month_11'] = 'Dezembro', - - ['toggleui'] = 'Habilita/Desabilita parte da HUD', - -}, - - - --- English -['en'] = { - ['you_are_on_location'] = 'You are on %s', - - ['date_format'] = { - default = 'Today is %s of %s, %s', - simple = 'Today is %s, %s', - simpleWithHours = 'It is %s, %s, %s', - withWeekday = 'Today is %s, %s of %s, %s', - withHours = 'It is %s, %s of %s, %s', - withWeekdayAndHours = 'It is %s, %s, %s of %s, %s' - }, - - ['weekDay_0'] = 'Sunday', - ['weekDay_1'] = 'Monday', - ['weekDay_2'] = 'Tuesday', - ['weekDay_3'] = 'Wednesday', - ['weekDay_4'] = 'Thursday', - ['weekDay_5'] = 'Friday', - ['weekDay_6'] = 'Saturday', - - ['day_1'] = '1st', - ['day_2'] = '2rd', - ['day_3'] = '3rd', - ['day_4'] = '4th', - ['day_5'] = '5th', - ['day_6'] = '6th', - ['day_7'] = '7th', - ['day_8'] = '8th', - ['day_9'] = '9th', - - ['day_10'] = '10th', - ['day_11'] = '11th', - ['day_12'] = '12th', - ['day_13'] = '13th', - ['day_14'] = '14th', - ['day_15'] = '15th', - ['day_16'] = '16th', - ['day_17'] = '17th', - ['day_18'] = '18th', - ['day_19'] = '19th', - - ['day_20'] = '20th', - ['day_21'] = '21th', - ['day_22'] = '22th', - ['day_23'] = '23th', - ['day_24'] = '24th', - ['day_25'] = '25th', - ['day_26'] = '26th', - ['day_27'] = '27th', - ['day_28'] = '28th', - ['day_29'] = '29th', - - ['day_30'] = '30th', - ['day_31'] = '31th', - - ['month_0'] = 'January', - ['month_1'] = 'February', - ['month_2'] = 'March', - ['month_3'] = 'April', - ['month_4'] = 'May', - ['month_5'] = 'June', - ['month_6'] = 'July', - ['month_7'] = 'August', - ['month_8'] = 'September', - ['month_9'] = 'October', - ['month_10'] = 'November', - ['month_11'] = 'December', - - ['toggleui'] = 'Enables/Disables parts of the HUD', - -} - - - - -} - - - - -return Locales \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/readme-en.html b/VRPEX/trew_hud_ui/readme-en.html deleted file mode 100644 index 9dabd21..0000000 --- a/VRPEX/trew_hud_ui/readme-en.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - TREW HUD UI - - - - -
-

Trew HUD UI

- -

User Interface created originally for ESX and then adapted for VRP/VRPEX.

- -

Demo

-

- - -

Installation

-
    -
  1. Extract the .zip or Open the .zip.
  2. -
  3. Place trew_hud_ui in your resources directory.
  4. -
  5. Add start trew_hud_ui to your server.cfg
  6. -
- -

Special Instructions for the ESX version

-

Requirements

- - -

Optional

- - -

What you can disable

- - -

Post Installation

-
    -
  • Go to es_extended config.lua and turn Config.EnableHud to false
  • -
  • If needed, go to esx_basicneeds main.lua and replace this code
  • -
-
-			
-	TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
-		return true
-	end, function(status)
-		status.remove(1000)
-	end)
-	
-	TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
-		return true
-	end, function(status)
-		status.remove(750)
-	end)
-			
-		
- -

for this one

- -
-			
-	TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
-		return false
-	end, function(status)
-		status.remove(1000)
-	end)
-	
-	TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
-		return false
-	end, function(status)
-		status.remove(750)
-	end)
-			
-		
- - -

Special Instructions for the VRP/VRPEX versions

- -

- Inside config.lua you will see a Config.vRP with certain items needed to set up properly, like black money. Since black money is considered an item on VRP/VRPEX versions, you need to put the ID of said item on this configuration. On most VRP versions, the ID is dirty_money. -

- -

- Config.vRP
- Special settings for vRP/vRPEX -

-
    -
  • items -
      -
    • blackMoney: The item ID for Black Money.
    • -
    -
  • -
- - -

Config.lua settings

- -

- Config.Locale
- The language. Default is en. -

- -

- Config.serverLogo
- Logo for your server. It’s suggested that you upload a PNG file to websites like imgur.com and then paste the link there. -

- -

- Config.font
- Font configuration for the UI. Default is Montserrat and the link points up to Google Fonts. It’s suggested that you look up for a font there and place the name and the link on it’s location. -

- -
    -
  • name: The name of the font
  • -
  • link: CSS Stylesheet file link for the font
  • -
- -

- Config.date
- Date format for the GPS location. -

- -
    -
  • -

    format:

    -
      -
    • default: It’s the default format;
    • -
    • withWeekDay: Format that shows week day names, like monday, tuesday, wednesday, etc;
    • -
    • withHours: Format that shows the current time in game;
    • -
    • withWeekAndHours: A mix of withWeekDay and withHours.
    • -
    • simple: Format that shows only day and month;
    • -
    • simpleWithHours: Same as simple, but also showing the time.
    • -
    -
  • -
  • -

    AmPm: set it to true if you want to use AM/PM time format, false if you don’t.

    -
  • -
- -

- Config.voice
- Voice settings for the UI. OneSync compatible -

- - -
    -
  • -

    levels:

    -
      -
    • default: Distance in meters for a default distance. Default is 5.0;
    • -
    • shout: Distance in meters for a shout distance. Default is 12.0;
    • -
    • whisper: Distance in meters for a whisper distance. Default is 1.0;
    • -
    • current: It’s important that this is left unchanged.
    • -
    -
  • -
  • -

    keys:

    -
      -
    • distance: Distance in meters for a default distance. Default is HOME.
    • -
    -
  • -
- - -

- Config.vehicle
- Vehicle and speedometer settings -

- -
    -
  • speedUnit: It should be set either KMH or MPH. Default is KMH;
  • -
  • maxSpeed: The top speed the Speedometer is allowed to go. Default is 240;
  • -
  • keys: -
      -
    • seatbelt: Buckle/unbuckle seatbelt. Default is K;
    • -
    • cruiser: Activate/deactivate cruiser speed. Default is CAPS;
    • -
    • signalLeft: Activate/deactivate car left signal. Default is LEFT;
    • -
    • signalRight: Activate/deactivate car right signal. Default is RIGHT;
    • -
    • signalBoth: Activate/deactivate car danger signal. Default is DOWN;
    • -
    -
  • -
- -

- Config.ui
- Display or hide elements of the HUD -

- -
    -
  • showJob: Displays the job name. Default is true;
  • -
  • showWalletMoney: Displays the money on your wallet. Default is true;
  • -
  • showBankMoney: Displays the money on your bank account. Default is true;
  • -
  • showBlackMoney: Displays the black money you have. Default is true;
  • -
  • showSocietyMoney: If you are the boss of a job, it displays the money you have in the society vault. Default is true; (Society money only works on ESX)
  • -
  • showDate: Displays the date. Default is true;
  • -
  • showLocation: Displays the location. Default is true;
  • -
  • showHealth: Displays your health. Default is true;
  • -
  • showArmor: Displays your armor. Default is true;
  • -
  • showStamina: Displays your stamina. Default is true;
  • -
  • showHunger: Displays hunger. Default is true;
  • -
  • showThirst: Displays thirst. Default is true;
  • -
  • showMinimap: Displays the minimap while off the vehicle. Default is false;
  • -
  • showVoice: Displays/use the voice controller. Default is true;
  • -
  • showWeapons: Displays the weapons you have on your hand, with ammo. Default is true;
  • -
- - - -

Adding Custom Status

-

-

- Check by the thirst indicator -

-

- You can create custom indicators for status you already have, like stress status, drunken, shit, piss, you name it! You would just have to use the new exports functions. I would recommend you create a new script with the code and load it below trew_hud_ui on your server.cfg. -

- -


- -

- exports.trew_hud_ui.createStatus
- Creates a new indicator after the existing ones. -

- -

Example:

-
-			
-	local STRESS_ACTIVE = false
-
-	AddEventHandler('playerSpawned', function()
-		
-		if STRESS_ACTIVE == false then
-			exports.trew_hud_ui:createStatus({
-			    status = 'stress',
-			    color = '#FF0090',
-			    icon = '<i class="fas fa-brain"></i>'
-			});
-			STRESS_ACTIVE = true
-		end
-
-	end)
-			
-		
- -

Usage:

-
    -
  • status: The status ID. It's purely to identify it;
  • -
  • color: The color you want for the status;
  • -
  • icon: The HTML code for the icon. You can search on FontAwesome for an icon and when you find one of your liking, change it there.
  • -
- - -


- -

- exports.trew_hud_ui.setStatus
- It is what makes the status update. It should be set on a Wait() timer to update on whenever your custom status is. The example below ticks while getting from a custom status registered on esx_status. -

- -

Example:

-
-			
-	Citizen.CreateThread(function()
-		while true do
-			Citizen.Wait(1000)
-			
-			local STRESS_STATUS
-	
-			TriggerEvent('esx_status:getStatus', 'stress', function(status)
-			    STRESS_STATUS = status.getPercent()
-			end)
-	
-			exports.trew_hud_ui:setStatus({
-			    name = 'stress',
-			    value = STRESS_STATUS
-			});
-		end
-	end)
-			
-		
- -

Usage:

-
    -
  • name: The name of the status. It should be correspondent with the ID when you created it;
  • -
  • value: The percentage value for the status, from 0 to 100.
  • -
- - -

Chat commands

-

- /toggleui
- Enables/Disables HUD information elements, like and job all types money. Useful for streamers. -

-

Usage example: /toggleui

- - -

Donate

-

This HUD is the product of 4 months of work, craft and creativity. While now I'm giving it for free, if you want to help, consider donating any ammount you want to. It will be really appreciated. :)

-
- - - - - -
- -
- - - - - \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/server/milleniumfalcon.lua b/VRPEX/trew_hud_ui/server/milleniumfalcon.lua deleted file mode 100644 index 5752dc4..0000000 --- a/VRPEX/trew_hud_ui/server/milleniumfalcon.lua +++ /dev/null @@ -1,5 +0,0 @@ - --- --- DO NOT TOUCH THE PART DOWN BELOW! --- Can potentially break the HUD. --- \ No newline at end of file diff --git a/VRPEX/trew_hud_ui/server/server.lua b/VRPEX/trew_hud_ui/server/server.lua deleted file mode 100644 index 0f3cd62..0000000 --- a/VRPEX/trew_hud_ui/server/server.lua +++ /dev/null @@ -1,34 +0,0 @@ -local Tunnel = module('vrp','lib/Tunnel') -local Proxy = module('vrp','lib/Proxy') -vRP = Proxy.getInterface('vRP') -local Config = module('trew_hud_ui', 'config') -local Locales = module('trew_hud_ui', 'locales/languages') - -function _U(entry) - return Locales[ Config.Locale ][entry] -end - -RegisterServerEvent('trew_hud_ui:getServerInfo') -AddEventHandler('trew_hud_ui:getServerInfo', function() - - local source = source - local playerID = vRP.getUserId(source) - - local info = { - hunger = vRP.getHunger(playerID), - thirst = vRP.getThirst(playerID), - - job = vRP.getUserGroupByType(playerID, 'job'), - - money = vRP.getMoney(playerID), - bankMoney = vRP.getBankMoney(playerID), - blackMoney = vRP.getInventoryItemAmount(playerID, Config.vRP.items.blackMoney) - } - - TriggerClientEvent('trew_hud_ui:setInfo', source, info) -end) - -RegisterServerEvent('trew_hud_ui:syncCarLights') -AddEventHandler('trew_hud_ui:syncCarLights', function(status) - TriggerClientEvent('trew_hud_ui:syncCarLights', -1, source, status) -end) \ No newline at end of file