ed
433
resources/[tools]/jordqn_hud/cl_main.lua
Normal file
|
@ -0,0 +1,433 @@
|
|||
local playerId = PlayerId()
|
||||
local playerPed = PlayerPedId()
|
||||
local playerCoords = GetEntityCoords(playerPed)
|
||||
local inVehicle = IsPedInAnyVehicle(playerPed)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
playerPed = PlayerPedId()
|
||||
playerCoords = GetEntityCoords(playerPed)
|
||||
inVehicle = IsPedInAnyVehicle(playerPed)
|
||||
|
||||
Citizen.Wait(100)
|
||||
end
|
||||
end)
|
||||
|
||||
local hudVisible = true
|
||||
local QBCore = nil
|
||||
|
||||
exports('hudVisibility', function(toggle)
|
||||
hudVisible = toggle
|
||||
end)
|
||||
|
||||
--
|
||||
-- HIDE HEALTH
|
||||
--
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
local scaleform = RequestScaleformMovie('minimap')
|
||||
|
||||
SetRadarBigmapEnabled(true, false)
|
||||
|
||||
Citizen.Wait(0)
|
||||
|
||||
SetRadarBigmapEnabled(false, false)
|
||||
|
||||
while true do
|
||||
BeginScaleformMovieMethod(scaleform, 'SETUP_HEALTH_ARMOUR')
|
||||
|
||||
if Config.vanilla then
|
||||
ScaleformMovieMethodAddParamInt(1)
|
||||
EndScaleformMovieMethod()
|
||||
return
|
||||
end
|
||||
|
||||
ScaleformMovieMethodAddParamInt(3)
|
||||
EndScaleformMovieMethod()
|
||||
SetRadarBigmapEnabled(false, false)
|
||||
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
end)
|
||||
|
||||
--
|
||||
-- HUD COMPONENTS
|
||||
--
|
||||
|
||||
if Config.componentsDisabler then
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
HideHudComponentThisFrame(1)
|
||||
HideHudComponentThisFrame(3)
|
||||
HideHudComponentThisFrame(4)
|
||||
HideHudComponentThisFrame(6)
|
||||
HideHudComponentThisFrame(8)
|
||||
HideHudComponentThisFrame(7)
|
||||
HideHudComponentThisFrame(9)
|
||||
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
--
|
||||
-- RADAR IN VEHICLE
|
||||
--
|
||||
|
||||
local bypass = false
|
||||
|
||||
exports('bypassRadar', function(toggle)
|
||||
bypass = toggle
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
DisplayRadar(true)
|
||||
|
||||
if not Config.radarOnlyInCar then
|
||||
return
|
||||
end
|
||||
|
||||
while true do
|
||||
if bypass then
|
||||
DisplayRadar(true)
|
||||
else
|
||||
if not inVehicle then
|
||||
DisplayRadar(false)
|
||||
else
|
||||
DisplayRadar(true)
|
||||
end
|
||||
end
|
||||
|
||||
Citizen.Wait(1000)
|
||||
end
|
||||
end)
|
||||
|
||||
--
|
||||
-- HUD LOCATION
|
||||
--
|
||||
|
||||
local activeCoords = vec2(0.0, 0.0)
|
||||
local postalText = 'CP 0000'
|
||||
local directionText = 'N'
|
||||
local postals = {}
|
||||
local zones = {}
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
local postalsJson = LoadResourceFile(GetCurrentResourceName(), 'zips.json')
|
||||
postalsJson = json.decode(postalsJson)
|
||||
|
||||
for i, postal in ipairs(postalsJson) do
|
||||
postals[i] = { vec2(postal.x, postal.y), code = postal.code }
|
||||
end
|
||||
|
||||
local zonesJson = LoadResourceFile(GetCurrentResourceName(), 'zones.json')
|
||||
zonesJson = json.decode(zonesJson)
|
||||
|
||||
for _, zone in pairs(zonesJson) do
|
||||
zones[zone.zone] = zone.name
|
||||
end
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while not postals do
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
while true do
|
||||
local nearestIndex, nearestDist
|
||||
|
||||
for i = 1, #postals do
|
||||
local dist = #(playerCoords.xy - postals[i][1])
|
||||
|
||||
if not nearestDist or dist < nearestDist then
|
||||
nearestIndex = i
|
||||
nearestDist = dist
|
||||
activeCoords = postals[i][1]
|
||||
end
|
||||
end
|
||||
|
||||
local code = postals[nearestIndex].code
|
||||
|
||||
postalText = string.format('CP %s', code)
|
||||
|
||||
Citizen.Wait(1000)
|
||||
end
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
local directions = { [0] = 'N', [45] = 'NW', [90] = 'W', [135] = 'SW', [180] = 'S', [225] = 'SE', [270] = 'E', [315] = 'NE', [360] = 'N', }
|
||||
|
||||
while true do
|
||||
for k, v in pairs(directions) do
|
||||
direction = GetEntityHeading(playerPed)
|
||||
|
||||
if math.abs(direction - k) < 22.5 then
|
||||
directionText = v
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
Citizen.Wait(500)
|
||||
end
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
if not IsRadarHidden() and Config.location.enabled and hudVisible then
|
||||
local zone = GetNameOfZone(playerCoords.x, playerCoords.y, playerCoords.z)
|
||||
local streetname, _ = GetStreetNameAtCoord(playerCoords.x, playerCoords.y, playerCoords.z)
|
||||
local streetnameText = GetStreetNameFromHashKey(streetname)
|
||||
local dist = #(playerCoords.xy - activeCoords)
|
||||
local distanceText = string.format('%sm', math.floor(dist))
|
||||
local zoneText = streetnameText
|
||||
|
||||
if zones[string.upper(zone)] then
|
||||
zoneText = zones[string.upper(zone)]
|
||||
end
|
||||
|
||||
SendNUIMessage({
|
||||
component = 'position',
|
||||
heading = GetEntityHeading(playerPed),
|
||||
postal = postalText,
|
||||
direction = directionText,
|
||||
distance = distanceText,
|
||||
street = streetnameText,
|
||||
zone = zoneText
|
||||
})
|
||||
else
|
||||
SendNUIMessage({
|
||||
component = 'position',
|
||||
visible = false
|
||||
})
|
||||
end
|
||||
|
||||
Citizen.Wait(Config.globalUpdateTime)
|
||||
end
|
||||
end)
|
||||
|
||||
--
|
||||
-- HUD STATUS
|
||||
--
|
||||
|
||||
local hunger = 100
|
||||
local thirst = 100
|
||||
local voice_type = 'mic_mute.png'
|
||||
local voice_talking = false
|
||||
local voice_radio = false
|
||||
|
||||
exports('setThirst', function(val)
|
||||
thirst = val
|
||||
end)
|
||||
|
||||
exports('setHunger', function(val)
|
||||
hunger = val
|
||||
end)
|
||||
|
||||
exports('setVoiceDistance', function(val)
|
||||
if val == 0 then
|
||||
voice_type = 'mic_mute.png'
|
||||
elseif val == 1 then
|
||||
voice_type = 'mic_one.png'
|
||||
elseif val == 2 then
|
||||
voice_type = 'mic_two.png'
|
||||
elseif val == 3 then
|
||||
voice_type = 'mic_three.png'
|
||||
end
|
||||
end)
|
||||
|
||||
exports('setVoiceRadio', function(toggle)
|
||||
voice_radio = toggle
|
||||
end)
|
||||
|
||||
exports('setVoiceTalking', function(toggle)
|
||||
voice_talking = toggle
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
if Config.framework == 'esx' then
|
||||
AddEventHandler('esx_status:onTick', function(data)
|
||||
for i = 1, #data do
|
||||
if data[i].name == 'thirst' then
|
||||
thirst = math.floor(data[i].percent)
|
||||
end
|
||||
|
||||
if data[i].name == 'hunger' then
|
||||
hunger = math.floor(data[i].percent)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if Config.framework == 'qbcore' then
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
end
|
||||
|
||||
while true do
|
||||
::redo::
|
||||
|
||||
Citizen.Wait(Config.globalUpdateTime)
|
||||
|
||||
local voice = voice_type
|
||||
|
||||
if voice_radio then
|
||||
voice = 'mic_radio.png'
|
||||
end
|
||||
|
||||
if Config.status.enabled and hudVisible then
|
||||
if Config.framework == 'qbcore' then
|
||||
local PlayerData = QBCore.Functions.GetPlayerData()
|
||||
|
||||
if (PlayerData.metadata ~= nil) then
|
||||
hunger = PlayerData.metadata['hunger']
|
||||
thirst = PlayerData.metadata['thirst']
|
||||
else
|
||||
SendNUIMessage({
|
||||
component = 'status',
|
||||
visible = false
|
||||
})
|
||||
|
||||
goto redo
|
||||
end
|
||||
end
|
||||
|
||||
if Config.pmaVoice then
|
||||
exports['jordqn_hud']:setVoiceDistance(LocalPlayer.state.proximity.index)
|
||||
|
||||
if not MumbleIsPlayerTalking(playerId) then
|
||||
voice_talking = false
|
||||
else
|
||||
voice_talking = true
|
||||
end
|
||||
end
|
||||
|
||||
SendNUIMessage({
|
||||
component = 'status',
|
||||
framework = Config.framework,
|
||||
hungerVisible = Config.enableHunger,
|
||||
thirstVisible = Config.enableThirst,
|
||||
voiceVisible = Config.enableVoice,
|
||||
voiceType = voice,
|
||||
voiceTalking = voice_talking,
|
||||
health = GetEntityHealth(playerPed),
|
||||
maxhealth = GetEntityMaxHealth(playerPed),
|
||||
armor = GetPedArmour(playerPed),
|
||||
hunger = hunger,
|
||||
thirst = thirst,
|
||||
oxygen = GetPlayerUnderwaterTimeRemaining(playerId)
|
||||
})
|
||||
else
|
||||
SendNUIMessage({
|
||||
component = 'status',
|
||||
visible = false
|
||||
})
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
--
|
||||
-- PMA VOICE
|
||||
--
|
||||
|
||||
if Config.pmaVoice then
|
||||
AddEventHandler('pma-voice:radioActive', function(toggle)
|
||||
voice_radio = toggle
|
||||
end)
|
||||
end
|
||||
|
||||
--
|
||||
-- HUD SPEEDOMETER
|
||||
--
|
||||
|
||||
local seatbelt = false
|
||||
|
||||
exports('setSeatBelt', function(toggle)
|
||||
seatbelt = toggle
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
if Config.speedometer.enabled and hudVisible then
|
||||
if inVehicle then
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
|
||||
if DoesEntityExist(vehicle) then
|
||||
local multipler = Config.useMiles and 2.236936 or 3.6
|
||||
local maxSpeed = GetVehicleEstimatedMaxSpeed(vehicle) * multipler
|
||||
local speed = GetEntitySpeed(vehicle) * multipler
|
||||
local maxFuel = GetVehicleHandlingFloat(vehicle, 'CHandlingData', 'fPetrolTankVolume')
|
||||
local fuel = GetVehicleFuelLevel(vehicle)
|
||||
local hasMotor = true
|
||||
local isElectric = false
|
||||
|
||||
if maxFuel < 5.0 then
|
||||
hasMotor = false
|
||||
end
|
||||
|
||||
if Config.LegacyFuel then
|
||||
fuel = math.floor(exports['LegacyFuel']:GetFuel(vehicle))
|
||||
end
|
||||
|
||||
local model = GetEntityModel(vehicle)
|
||||
|
||||
for _, v in pairs(Config.electricVehicles) do
|
||||
if v == model then
|
||||
isElectric = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local _, _, highbeams = GetVehicleLightsState(vehicle)
|
||||
|
||||
SendNUIMessage({
|
||||
component = 'speedometer',
|
||||
framework = Config.framework,
|
||||
seatbeltVisible = Config.enableSeatBelt,
|
||||
fuelVisible = Config.enableFuel,
|
||||
useMiles = Config.useMiles,
|
||||
speed = speed,
|
||||
maxspeed = maxSpeed,
|
||||
fuel = fuel,
|
||||
hasmotor = hasMotor,
|
||||
iselectric = isElectric,
|
||||
maxfuel = maxFuel,
|
||||
highbeams = highbeams,
|
||||
engine = GetIsVehicleEngineRunning(vehicle),
|
||||
seatbelt = seatbelt
|
||||
})
|
||||
else
|
||||
SendNUIMessage({
|
||||
component = 'speedometer',
|
||||
visible = false
|
||||
})
|
||||
end
|
||||
else
|
||||
SendNUIMessage({
|
||||
component = 'speedometer',
|
||||
visible = false
|
||||
})
|
||||
end
|
||||
else
|
||||
SendNUIMessage({
|
||||
component = 'speedometer',
|
||||
visible = false
|
||||
})
|
||||
end
|
||||
|
||||
Citizen.Wait(Config.globalUpdateTime)
|
||||
end
|
||||
end)
|
||||
|
||||
--
|
||||
-- CONFIGURATION
|
||||
--
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
SendNUIMessage({
|
||||
component = 'configuration',
|
||||
locationleft = Config.location.left,
|
||||
locationbottom = Config.location.bottom,
|
||||
statusright = Config.status.right,
|
||||
statusbottom = Config.status.bottom,
|
||||
speedometerbottom = Config.speedometer.bottom
|
||||
})
|
||||
end)
|
86
resources/[tools]/jordqn_hud/config.lua
Normal file
|
@ -0,0 +1,86 @@
|
|||
Config = {}
|
||||
|
||||
-- Can be 'qbcore', 'esx' or 'standalone'.
|
||||
Config.framework = 'standalone' -- Default = 'standalone'
|
||||
|
||||
-- Toggle LegacyFuel hook.
|
||||
Config.LegacyFuel = false -- Default = false
|
||||
|
||||
-- Toggle pmaVoice hook.
|
||||
Config.pmaVoice = false -- Default = false
|
||||
|
||||
-- Configure the location component.
|
||||
Config.location = {
|
||||
enabled = true, -- Default = true
|
||||
left = 310, -- Default = 310
|
||||
bottom = 30 -- Default = 30
|
||||
}
|
||||
|
||||
-- Defines the hud update time, a higher value may reduce script consumption.
|
||||
Config.globalUpdateTime = 1 -- Default = 1
|
||||
|
||||
-- Configure the speedometer component.
|
||||
Config.speedometer = {
|
||||
enabled = true, -- Default = true
|
||||
bottom = -50 -- Default = -50
|
||||
}
|
||||
|
||||
-- Configure the status component.
|
||||
Config.status = {
|
||||
enabled = true, -- Default = true
|
||||
right = 20, -- Default = 20
|
||||
bottom = 30 -- Default = 30
|
||||
}
|
||||
|
||||
-- Activates/deactivates GTA's vanilla hud for life and armor. [default = false]
|
||||
Config.vanilla = false
|
||||
|
||||
-- Enables/disables components that may interfere with the use of this HUD. [default = true]
|
||||
Config.componentsDisabler = true
|
||||
|
||||
-- Enables/disables radar display only in vehicle (also affects position hud). [default = true]
|
||||
Config.radarOnlyInCar = true
|
||||
|
||||
-- Activates/deactivates the hunger bar display. [default = true]
|
||||
Config.enableHunger = true
|
||||
|
||||
-- Activates/deactivates the thirst bar display. [default = true]
|
||||
Config.enableThirst = true
|
||||
|
||||
-- Activates/deactivates the seat belt display. [default = true]
|
||||
Config.enableSeatBelt = true
|
||||
|
||||
-- Activates/deactivates the fuel level display. [default = true]
|
||||
Config.enableFuel = true
|
||||
|
||||
-- Activates/deactivates the voice display. [default = true]
|
||||
Config.enableVoice = true
|
||||
|
||||
-- Determines whether you want to use miles or kilometers. [default = true]
|
||||
Config.useMiles = true
|
||||
|
||||
-- List of electric vehicles.
|
||||
Config.electricVehicles = {
|
||||
`buffalo5`,
|
||||
`cyclone`,
|
||||
`cyclone2`,
|
||||
`dilettante`,
|
||||
`dilettante2`,
|
||||
`iwagen`,
|
||||
`imorgon`,
|
||||
`khamelion`,
|
||||
`coureur`,
|
||||
`neon`,
|
||||
`omnisegt`,
|
||||
`powersurge`,
|
||||
`raiden`,
|
||||
`voltic2`,
|
||||
`surge`,
|
||||
`tezeract`,
|
||||
`virtue`,
|
||||
`voltic`,
|
||||
`caddy`,
|
||||
`caddy2`,
|
||||
`caddy3`,
|
||||
`airtug`
|
||||
}
|
20
resources/[tools]/jordqn_hud/fxmanifest.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
fx_version 'cerulean'
|
||||
game 'gta5'
|
||||
|
||||
ui_page 'web/index.html'
|
||||
|
||||
files {
|
||||
'zips.json',
|
||||
'zones.json',
|
||||
'web/*.html',
|
||||
'web/*.js',
|
||||
'web/*.css',
|
||||
'web/*.png'
|
||||
}
|
||||
|
||||
client_script {
|
||||
'config.lua',
|
||||
'cl_*.lua'
|
||||
}
|
||||
|
||||
lua54 'yes'
|
BIN
resources/[tools]/jordqn_hud/web/armor.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
resources/[tools]/jordqn_hud/web/arrow.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
resources/[tools]/jordqn_hud/web/battery.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
resources/[tools]/jordqn_hud/web/beam.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
resources/[tools]/jordqn_hud/web/engine.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
resources/[tools]/jordqn_hud/web/food.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
resources/[tools]/jordqn_hud/web/gas.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
resources/[tools]/jordqn_hud/web/health.png
Normal file
After Width: | Height: | Size: 17 KiB |
71
resources/[tools]/jordqn_hud/web/index.html
Normal file
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
||||
<link href="./style.css" rel="stylesheet">
|
||||
<script defer src="script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section id="speedometer">
|
||||
<span id="speedtextkm">0</span>
|
||||
<span id="speedtextmiles">0</span>
|
||||
<img id="fuel-icon" class="fuel" src="gas.png">
|
||||
<img id="beam" class="beam" src="beam.png">
|
||||
<img id="engine" class="engine" src="engine.png">
|
||||
<img id="seatbelt" class="seatbelt" src="seatbelt.png">
|
||||
<svg id="speed" viewbox="0 0 200 120">
|
||||
<path class="speedpath" d="M 20 90 A 50 50 0 1 1 100 90" fill='none' />
|
||||
<path id="speed-svg" fill='none' class="speedvalue" d="M 20 90 A 50 50 0 1 1 100 90" />
|
||||
<path id="fuel-path" class="fuelpath" d="M 109 90 A 20 20 0 1 0 118 58" fill='none' />
|
||||
<path id="fuel-svg" fill='none' class="fuelvalue" d="M 109 90 A 20 20 0 1 0 118 58" />
|
||||
</svg>
|
||||
</section>
|
||||
<section id="location">
|
||||
<img id="arrow" src="arrow.png">
|
||||
<span id="zone">Terminal</span>
|
||||
<span id="streetname">Buccaneer Way</span>
|
||||
<div class="bottom">
|
||||
<span id="direction">NW</span>
|
||||
<span id="zipcode">CP 8090</span>
|
||||
<span id="distance">20m</span>
|
||||
</div>
|
||||
</section>
|
||||
<section id="status">
|
||||
<img id="voice" class="voice" src="mic_mute.png">
|
||||
<div id="oxygencontainer" class="oxygen">
|
||||
<span class="title">Oxygen</span>
|
||||
<img src="oxygen.png">
|
||||
<hr id="oxygen">
|
||||
<span id="oxygentext">100%</span>
|
||||
</div>
|
||||
<div id="armorcontainer" class="armor">
|
||||
<span class="title">Armor</span>
|
||||
<img src="armor.png">
|
||||
<hr id="armor">
|
||||
<span id="armortext">100%</span>
|
||||
</div>
|
||||
<div id="thirstcontainer" class="thirst">
|
||||
<span class="title">Thirst</span>
|
||||
<img src="thirst.png">
|
||||
<hr id="thirst">
|
||||
<span id="thirsttext">100%</span>
|
||||
</div>
|
||||
<div id="foodcontainer" class="food">
|
||||
<span class="title">Hunger</span>
|
||||
<img src="food.png">
|
||||
<hr id="food">
|
||||
<span id="foodtext">100%</span>
|
||||
</div>
|
||||
<div id="healthcontainer" class="health">
|
||||
<span class="title">Health</span>
|
||||
<img src="health.png">
|
||||
<hr id="health">
|
||||
<span id="healthtext">100%</span>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
BIN
resources/[tools]/jordqn_hud/web/mic_mute.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
resources/[tools]/jordqn_hud/web/mic_one.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
resources/[tools]/jordqn_hud/web/mic_radio.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
resources/[tools]/jordqn_hud/web/mic_three.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
resources/[tools]/jordqn_hud/web/mic_two.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
resources/[tools]/jordqn_hud/web/oxygen.png
Normal file
After Width: | Height: | Size: 35 KiB |
227
resources/[tools]/jordqn_hud/web/script.js
Normal file
|
@ -0,0 +1,227 @@
|
|||
const locationWindow = document.getElementById("location");
|
||||
const statusWindow = document.getElementById("status");
|
||||
const speedometerWindow = document.getElementById("speedometer");
|
||||
|
||||
const arrow = document.getElementById("arrow");
|
||||
const direction = document.getElementById("direction");
|
||||
const zipcode = document.getElementById("zipcode");
|
||||
const distance = document.getElementById("distance");
|
||||
const streetname = document.getElementById("streetname");
|
||||
const zone = document.getElementById("zone");
|
||||
|
||||
const thirstcontainer = document.getElementById("thirstcontainer");
|
||||
const foodcontainer = document.getElementById("foodcontainer");
|
||||
const armorcontainer = document.getElementById("armorcontainer");
|
||||
const oxygencontainer = document.getElementById("oxygencontainer");
|
||||
|
||||
const healthtext = document.getElementById("healthtext")
|
||||
const armortext = document.getElementById("armortext")
|
||||
const thirsttext = document.getElementById("thirsttext")
|
||||
const foodtext = document.getElementById("foodtext")
|
||||
const oxygentext = document.getElementById("oxygentext")
|
||||
const healthbar = document.getElementById("health")
|
||||
const armorbar = document.getElementById("armor")
|
||||
const thirstbar = document.getElementById("thirst")
|
||||
const foodbar = document.getElementById("food")
|
||||
const oxygenbar = document.getElementById("oxygen")
|
||||
const voice = document.getElementById("voice")
|
||||
|
||||
const speed = document.getElementById("speed-svg");
|
||||
const speedtextkm = document.getElementById("speedtextkm")
|
||||
const speedtextmiles = document.getElementById("speedtextmiles")
|
||||
const fuel = document.getElementById("fuel-svg");
|
||||
const fuel_path = document.getElementById("fuel-path");
|
||||
const fuel_icon = document.getElementById("fuel-icon");
|
||||
|
||||
const seatbelt = document.getElementById("seatbelt");
|
||||
const engine = document.getElementById("engine");
|
||||
const highbeams = document.getElementById("beam");
|
||||
|
||||
let left = 0
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
if (event.data.component == "position") {
|
||||
if (event.data.visible == null) {
|
||||
left = 1
|
||||
locationWindow.style.opacity = 1
|
||||
arrow.style.rotate = -event.data.heading + "deg"
|
||||
|
||||
direction.innerText = event.data.direction
|
||||
zipcode.innerText = event.data.postal
|
||||
distance.innerText = event.data.distance
|
||||
streetname.innerText = event.data.street
|
||||
zone.innerText = event.data.zone
|
||||
} else {
|
||||
left = 0
|
||||
locationWindow.style.opacity = 0
|
||||
}
|
||||
}
|
||||
|
||||
if (event.data.component == "status") {
|
||||
if (event.data.visible == null) {
|
||||
statusWindow.style.opacity = 1
|
||||
if (event.data.hungerVisible) { foodcontainer.style.display = "block" } else { foodcontainer.style.display = "none" }
|
||||
if (event.data.thirstVisible) { thirstcontainer.style.display = "block" } else { thirstcontainer.style.display = "none" }
|
||||
if (event.data.voiceVisible) { voice.style.display = "block" } else { voice.style.display = "none" }
|
||||
|
||||
if (event.data.voiceTalking == true) {
|
||||
if (voice.classList.contains("disabled")) {
|
||||
voice.classList.remove("disabled")
|
||||
}
|
||||
} else {
|
||||
if (!voice.classList.contains("disabled")) {
|
||||
voice.classList.add("disabled")
|
||||
}
|
||||
}
|
||||
|
||||
voice.src = event.data.voiceType
|
||||
|
||||
let health = Math.round((event.data.health * 100) / event.data.maxhealth)
|
||||
if (health > 100) { health = 100 }
|
||||
let armor = Math.round((event.data.armor * 100) / 100)
|
||||
if (armor > 0) {
|
||||
armorcontainer.style.display = "block"
|
||||
} else {
|
||||
armorcontainer.style.display = "none"
|
||||
}
|
||||
let thirst = Math.round((event.data.thirst * 100) / 100)
|
||||
let food = Math.round((event.data.hunger * 100) / 100)
|
||||
|
||||
let oxygen = Math.round((event.data.oxygen * 100) / 40)
|
||||
|
||||
if (event.data.framework == "qbcore" || event.data.framework == "esx") {
|
||||
oxygen = Math.round((event.data.oxygen * 100) / 10)
|
||||
}
|
||||
|
||||
if (oxygen < 0) { oxygen = 0 }
|
||||
|
||||
if (oxygen != 100) {
|
||||
oxygencontainer.style.display = "block"
|
||||
} else {
|
||||
oxygencontainer.style.display = "none"
|
||||
}
|
||||
|
||||
healthtext.innerText = health + "%"
|
||||
healthbar.style.width = (health * 150) / 100 + "px"
|
||||
healthbar.style.setProperty('--size', 150 - ((health * 150) / 100) + "px");
|
||||
armortext.innerText = armor + "%"
|
||||
armorbar.style.width = (armor * 150) / 100 + "px"
|
||||
armorbar.style.setProperty('--size', 150 - ((armor * 150) / 100) + "px");
|
||||
|
||||
thirsttext.innerText = thirst + "%"
|
||||
thirstbar.style.width = (thirst * 150) / 100 + "px"
|
||||
thirstbar.style.setProperty('--size', 150 - ((thirst * 150) / 100) + "px");
|
||||
|
||||
foodtext.innerText = food + "%"
|
||||
foodbar.style.width = (food * 150) / 100 + "px"
|
||||
foodbar.style.setProperty('--size', 150 - ((food * 150) / 100) + "px");
|
||||
|
||||
oxygentext.innerText = oxygen + "%"
|
||||
oxygenbar.style.width = (oxygen * 150) / 100 + "px"
|
||||
oxygenbar.style.setProperty('--size', 150 - ((oxygen * 150) / 100) + "px");
|
||||
} else {
|
||||
if (event.data.visible == true) {
|
||||
statusWindow.style.opacity = 1
|
||||
} else {
|
||||
statusWindow.style.opacity = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.data.component == "speedometer") {
|
||||
if (event.data.visible == null) {
|
||||
if (event.data.seatbeltVisible) { seatbelt.style.display = "block" } else { seatbelt.style.display = "none" }
|
||||
if (event.data.fuelVisible) { speedometerWindow.style.marginLeft = '0px'; fuel.style.display = "block"; fuel_path.style.display = "block"; fuel_icon.style.display = "block"; } else { speedometerWindow.style.marginLeft = '10px'; fuel.style.display = "none"; fuel_path.style.display = "none"; fuel_icon.style.display = "none"; }
|
||||
speedometerWindow.style.opacity = 1
|
||||
let percent_speed = (event.data.speed * 100) / (event.data.maxspeed + 50)
|
||||
let percent_fuel = (event.data.fuel * 100) / (event.data.maxfuel)
|
||||
if (event.data.framework == "qbcore") {
|
||||
percent_fuel = event.data.fuel
|
||||
}
|
||||
setDashedGaugeValue(speed, percent_speed, 219.911485751);
|
||||
setDashedGaugeValue(fuel, percent_fuel, 87.9645943005);
|
||||
speedtextkm.innerText = Math.round(event.data.speed)
|
||||
speedtextmiles.innerText = Math.round(event.data.speed)
|
||||
|
||||
if (event.data.iselectric == true) {
|
||||
fuel_icon.src = "battery.png"
|
||||
} else {
|
||||
fuel_icon.src = "gas.png"
|
||||
}
|
||||
|
||||
if (event.data.useMiles == true) {
|
||||
speedtextkm.style.display = "none"
|
||||
speedtextmiles.style.display = "block"
|
||||
} else {
|
||||
speedtextkm.style.display = "block"
|
||||
speedtextmiles.style.display = "none"
|
||||
}
|
||||
|
||||
if (event.data.hasmotor == true) {
|
||||
highbeams.style.display = "block"
|
||||
engine.style.display = "block"
|
||||
speedometerWindow.style.marginLeft = '0px'
|
||||
speedometerWindow.style.marginBottom = '0px'
|
||||
} else {
|
||||
highbeams.style.display = "none"
|
||||
engine.style.display = "none"
|
||||
seatbelt.style.display = "none"
|
||||
fuel.style.display = "none"
|
||||
fuel_path.style.display = "none"
|
||||
fuel_icon.style.display = "none"
|
||||
speedometerWindow.style.marginLeft = '10px'
|
||||
speedometerWindow.style.marginBottom = '-10px'
|
||||
}
|
||||
|
||||
if (event.data.highbeams == 1) {
|
||||
if (highbeams.classList.contains("disabled")) {
|
||||
highbeams.classList.remove("disabled")
|
||||
}
|
||||
} else {
|
||||
if (!highbeams.classList.contains("disabled")) {
|
||||
highbeams.classList.add("disabled")
|
||||
}
|
||||
}
|
||||
|
||||
if (event.data.engine == 1) {
|
||||
if (engine.classList.contains("disabled")) {
|
||||
engine.classList.remove("disabled")
|
||||
}
|
||||
} else {
|
||||
if (!engine.classList.contains("disabled")) {
|
||||
engine.classList.add("disabled")
|
||||
}
|
||||
}
|
||||
|
||||
if (event.data.seatbelt == true) {
|
||||
if (seatbelt.classList.contains("disabled")) {
|
||||
seatbelt.classList.remove("disabled")
|
||||
}
|
||||
} else {
|
||||
if (!seatbelt.classList.contains("disabled")) {
|
||||
seatbelt.classList.add("disabled")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
speedometerWindow.style.opacity = 0
|
||||
}
|
||||
}
|
||||
|
||||
if (event.data.component == "configuration") {
|
||||
locationWindow.style.left = event.data.locationleft + "px"
|
||||
locationWindow.style.bottom = event.data.locationbottom + "px"
|
||||
statusWindow.style.right = event.data.statusright + "px"
|
||||
statusWindow.style.bottom = event.data.statusbottom + "px"
|
||||
speedometerWindow.style.bottom = event.data.speedometerbottom + "px"
|
||||
}
|
||||
})
|
||||
|
||||
function setDashedGaugeValue(gaugeDOMElement, percentage, arcLength) {
|
||||
const emptyDashLength = 500;
|
||||
const filledArcLength = arcLength * (percentage / 100);
|
||||
gaugeDOMElement.style.strokeDasharray = `${filledArcLength} ${emptyDashLength}`;
|
||||
gaugeDOMElement.style.strokeDashoffset = filledArcLength;
|
||||
}
|
||||
|
||||
setDashedGaugeValue(speed, 0, 219.911485751);
|
||||
setDashedGaugeValue(fuel, 0, 87.9645943005);
|
BIN
resources/[tools]/jordqn_hud/web/seatbelt.png
Normal file
After Width: | Height: | Size: 11 KiB |
19
resources/[tools]/jordqn_hud/web/style.css
Normal file
|
@ -0,0 +1,19 @@
|
|||
*{
|
||||
--variable-main-color: #ffffff;
|
||||
--variable-zonename-color: #ffffff;
|
||||
--variable-streetname-color: #ffffff;
|
||||
--variable-direction-color: #ffffff;
|
||||
--variable-zipcode-color: #ffffff;
|
||||
--variable-distance-color: #ffffff;
|
||||
|
||||
--variable-health-color: #ffffff;
|
||||
--variable-hunger-color: #ffffff;
|
||||
--variable-thirst-color: #ffffff;
|
||||
--variable-armor-color: #ffffff;
|
||||
--variable-oxygen-color: #ffffff;
|
||||
|
||||
--variable-speed-color: #ffffff;
|
||||
--variable-fuel-color: #ffffff;
|
||||
}
|
||||
|
||||
* {--size: 0px;-webkit-user-drag: none;user-select: none;}body {overflow: hidden;}#location {display: flex;position: absolute;bottom: 30px;left: 310px;padding: 10px 20px;opacity: 0;transition: .2s;width: 300px;}#location > img {width: 40px;height: 40px;}#location > #zone {font-family: 'Hanken Grotesk';font-weight: 200;font-style: italic;font-size: 12px;color: var(--variable-zonename-color);position: absolute;left: 70px;top: 0px;}#location > #streetname {font-family: 'Hanken Grotesk';font-weight: 600;color: var(--variable-streetname-color);position: absolute;padding-bottom: 2px;left: 70px;top: 15px;border-bottom: 1px solid rgba(255, 255, 255, 0.425);}.bottom {position: absolute;top: 40px;left: 70px;}.bottom > #direction {font-family: 'Hanken Grotesk';font-weight: 200;font-size: 12px;color: var(--variable-direction-color);}.bottom > #zipcode {font-family: 'Hanken Grotesk';font-weight: 200;font-size: 12px;color: var(--variable-zipcode-color);margin-left: 10px;}.bottom > #distance {font-family: 'Hanken Grotesk';font-weight: 300;font-size: 12px;color: var(--variable-distance-color);margin-left: 10px;}#status {width: 300px;height: 150px;border-radius: 10px;position: absolute;bottom: 30px;right: 20px;overflow: hidden;display: flex;justify-content: flex-end;flex-direction: column;opacity: 0;}#status img {height: 20px;width: 20px;}#status > .health, #status > .thirst, #status > .food, #status > .armor, #status > .oxygen {position: relative;height: 30px;}.health > img, .armor > img, .thirst > img, .food > img, .oxygen > img {position: absolute;right: 10px;top: 4px;}.health > hr, .armor > hr, .thirst > hr, .food > hr, .oxygen > hr {position: absolute;transition: .2s;right: 40px;top: 13px;width: 150px;height: 2px;border-radius: 10px;outline: none;border: none;overflow: visible;background-color: var(--variable-main-color);}.health > hr::before, .armor > hr::before, .thirst > hr::before, .food > hr::before, .oxygen > hr::before {content: "";position: absolute;left: calc(-1 * var(--size));transition: .2s;width: var(--size);height: 2px;border-radius: 10px;outline: none;border: none;background-color: #6b6b6bbe;}.health > span, .armor > span, .thirst > span, .food > span, .oxygen > span {position: absolute;font-family: 'Hanken Grotesk';font-weight: 400;font-size: 12px;color: var(--variable-main-color);right: 40px;top: 3px;}.health > .title, .armor > .title, .thirst > .title, .food > .title, .oxygen > .title {position: absolute;font-family: 'Hanken Grotesk';font-weight: 200;font-size: 12px;color: var(--variable-main-color);left: 110px;top: 3px;}.health > hr {background-color: var(--variable-health-color);}.armor > hr {background-color: var(--variable-armor-color);}.food > hr {background-color: var(--variable-hunger-color);}.thirst > hr {background-color: var(--variable-thirst-color);}.oxygen > hr {background-color: var(--variable-oxygen-color);}#speedometer {position: absolute;bottom: -50px;left: calc(50% - 125px);width: 250px;transform: scale(0.5);transition: .2s;opacity: 0;}#speedometer #speed {height: 200px;margin: 20px auto;display: block;}#speedometer .fuel {position: absolute;bottom: 77px;right: 25px;height: 30px;width: 30px;}#speedometer .beam {position: absolute;bottom: 30px;right: 90px;height: 30px;width: 30px;}#speedometer .engine {position: absolute;bottom: 30px;right: 180px;height: 30px;width: 30px;}#speedometer .seatbelt {position: absolute;bottom: 20px;right: 135px;height: 30px;width: 30px;}.disabled {opacity: 0.4;}#speedometer .speedpath {stroke: #6b6b6bbe;stroke-width: 4;stroke-linecap: round;}#speedometer .fuelpath {stroke: #6b6b6bbe;stroke-width: 3;stroke-linecap: round;}#speedometer .fuelvalue {stroke-width: 4;stroke: var(--variable-fuel-color);stroke-dasharray: 126 500;stroke-dashoffset: 126;animation: dash 3s 0.5s cubic-bezier(0.7, 0, 0.3, 1) forwards;stroke-linecap: round;}#speedometer .speedvalue {stroke-width: 5;stroke: var(--variable-speed-color);stroke-dasharray: 126 500;stroke-dashoffset: 126;animation: dash 3s 0.5s cubic-bezier(0.7, 0, 0.3, 1) forwards;stroke-linecap: round;}#speedometer span {position: absolute;font-family: 'Hanken Grotesk';font-weight: 400;font-size: 40px;left: 30px;top: 85px;width: 140px;text-align: center;color: var(--variable-speed-color);}#speedometer #speedtextkm::after {content: "kmh";font-weight: 300;font-style: italic;font-size: 20px;}#speedometer #speedtextmiles::after {content: "mph";font-weight: 300;font-style: italic;font-size: 20px;}@keyframes dash {to {stroke-dashoffset: 1;}}#status > .voice {width: 25px;height: 17px;align-self: flex-end;margin-bottom: 20px;margin-right: 20px;}
|
BIN
resources/[tools]/jordqn_hud/web/thirst.png
Normal file
After Width: | Height: | Size: 14 KiB |
8442
resources/[tools]/jordqn_hud/zips.json
Normal file
370
resources/[tools]/jordqn_hud/zones.json
Normal file
|
@ -0,0 +1,370 @@
|
|||
[
|
||||
{
|
||||
"zone": "AIRP",
|
||||
"name": "Los Santos International Airport"
|
||||
},
|
||||
{
|
||||
"zone": "ALAMO",
|
||||
"name": "Alamo Sea"
|
||||
},
|
||||
{
|
||||
"zone": "ALTA",
|
||||
"name": "Alta"
|
||||
},
|
||||
{
|
||||
"zone": "ARMYB",
|
||||
"name": "Fort Zancudo"
|
||||
},
|
||||
{
|
||||
"zone": "BANHAMC",
|
||||
"name": "Banham Canyon Dr"
|
||||
},
|
||||
{
|
||||
"zone": "BANNING",
|
||||
"name": "Banning"
|
||||
},
|
||||
{
|
||||
"zone": "BEACH",
|
||||
"name": "Vespucci Beach"
|
||||
},
|
||||
{
|
||||
"zone": "BHAMCA",
|
||||
"name": "Banham Canyon"
|
||||
},
|
||||
{
|
||||
"zone": "BRADP",
|
||||
"name": "Braddock Pass"
|
||||
},
|
||||
{
|
||||
"zone": "BRADT",
|
||||
"name": "Braddock Tunnel"
|
||||
},
|
||||
{
|
||||
"zone": "BURTON",
|
||||
"name": "Burton"
|
||||
},
|
||||
{
|
||||
"zone": "CALAFB",
|
||||
"name": "Calafia Bridge"
|
||||
},
|
||||
{
|
||||
"zone": "CANNY",
|
||||
"name": "Raton Canyon"
|
||||
},
|
||||
{
|
||||
"zone": "CCREAK",
|
||||
"name": "Cassidy Creek"
|
||||
},
|
||||
{
|
||||
"zone": "CHAMH",
|
||||
"name": "Chamberlain Hills"
|
||||
},
|
||||
{
|
||||
"zone": "CHIL",
|
||||
"name": "Vinewood Hills"
|
||||
},
|
||||
{
|
||||
"zone": "CHU",
|
||||
"name": "Chumash"
|
||||
},
|
||||
{
|
||||
"zone": "CMSW",
|
||||
"name": "Chiliad Mountain State Wilderness"
|
||||
},
|
||||
{
|
||||
"zone": "CYPRE",
|
||||
"name": "Cypress Flats"
|
||||
},
|
||||
{
|
||||
"zone": "DAVIS",
|
||||
"name": "Davis"
|
||||
},
|
||||
{
|
||||
"zone": "DELBE",
|
||||
"name": "Del Perro Beach"
|
||||
},
|
||||
{
|
||||
"zone": "DELPE",
|
||||
"name": "Del Perro"
|
||||
},
|
||||
{
|
||||
"zone": "DELSOL",
|
||||
"name": "La Puerta"
|
||||
},
|
||||
{
|
||||
"zone": "DESRT",
|
||||
"name": "Grand Senora Desert"
|
||||
},
|
||||
{
|
||||
"zone": "DOWNT",
|
||||
"name": "Downtown"
|
||||
},
|
||||
{
|
||||
"zone": "DTVINE",
|
||||
"name": "Downtown Vinewood"
|
||||
},
|
||||
{
|
||||
"zone": "EAST_V",
|
||||
"name": "East Vinewood"
|
||||
},
|
||||
{
|
||||
"zone": "EBURO",
|
||||
"name": "El Burro Heights"
|
||||
},
|
||||
{
|
||||
"zone": "ELGORL",
|
||||
"name": "El Gordo Lighthouse"
|
||||
},
|
||||
{
|
||||
"zone": "ELYSIAN",
|
||||
"name": "Elysian Island"
|
||||
},
|
||||
{
|
||||
"zone": "GALFISH",
|
||||
"name": "Galilee"
|
||||
},
|
||||
{
|
||||
"zone": "GOLF",
|
||||
"name": "GWC and Golfing Society"
|
||||
},
|
||||
{
|
||||
"zone": "GRAPES",
|
||||
"name": "Grapeseed"
|
||||
},
|
||||
{
|
||||
"zone": "GREATC",
|
||||
"name": "Great Chaparral"
|
||||
},
|
||||
{
|
||||
"zone": "HARMO",
|
||||
"name": "Harmony"
|
||||
},
|
||||
{
|
||||
"zone": "HAWICK",
|
||||
"name": "Hawick"
|
||||
},
|
||||
{
|
||||
"zone": "HORS",
|
||||
"name": "Vinewood Racetrack"
|
||||
},
|
||||
{
|
||||
"zone": "HUMLAB",
|
||||
"name": "Humane Labs and Research"
|
||||
},
|
||||
{
|
||||
"zone": "JAIL",
|
||||
"name": "Bolingbroke Penitentiary"
|
||||
},
|
||||
{
|
||||
"zone": "KOREAT",
|
||||
"name": "Little Seoul"
|
||||
},
|
||||
{
|
||||
"zone": "LACT",
|
||||
"name": "Land Act Reservoir"
|
||||
},
|
||||
{
|
||||
"zone": "LAGO",
|
||||
"name": "Lago Zancudo"
|
||||
},
|
||||
{
|
||||
"zone": "LDAM",
|
||||
"name": "Land Act Dam"
|
||||
},
|
||||
{
|
||||
"zone": "LEGSQU",
|
||||
"name": "Legion Square"
|
||||
},
|
||||
{
|
||||
"zone": "LMESA",
|
||||
"name": "La Mesa"
|
||||
},
|
||||
{
|
||||
"zone": "LOSPUER",
|
||||
"name": "La Puerta"
|
||||
},
|
||||
{
|
||||
"zone": "MIRR",
|
||||
"name": "Mirror Park"
|
||||
},
|
||||
{
|
||||
"zone": "MORN",
|
||||
"name": "Morningwood"
|
||||
},
|
||||
{
|
||||
"zone": "MOVIE",
|
||||
"name": "Richards Majestic"
|
||||
},
|
||||
{
|
||||
"zone": "MTCHIL",
|
||||
"name": "Mount Chiliad"
|
||||
},
|
||||
{
|
||||
"zone": "MTGORDO",
|
||||
"name": "Mount Gordo"
|
||||
},
|
||||
{
|
||||
"zone": "MTJOSE",
|
||||
"name": "Mount Josiah"
|
||||
},
|
||||
{
|
||||
"zone": "MURRI",
|
||||
"name": "Murrieta Heights"
|
||||
},
|
||||
{
|
||||
"zone": "NCHU",
|
||||
"name": "North Chumash"
|
||||
},
|
||||
{
|
||||
"zone": "NOOSE",
|
||||
"name": "N.O.O.S.E"
|
||||
},
|
||||
{
|
||||
"zone": "OCEANA",
|
||||
"name": "Pacific Ocean"
|
||||
},
|
||||
{
|
||||
"zone": "PALCOV",
|
||||
"name": "Paleto Cove"
|
||||
},
|
||||
{
|
||||
"zone": "PALETO",
|
||||
"name": "Paleto Bay"
|
||||
},
|
||||
{
|
||||
"zone": "PALFOR",
|
||||
"name": "Paleto Forest"
|
||||
},
|
||||
{
|
||||
"zone": "PALHIGH",
|
||||
"name": "Palomino Highlands"
|
||||
},
|
||||
{
|
||||
"zone": "PALMPOW",
|
||||
"name": "Palmer-Taylor Power Station"
|
||||
},
|
||||
{
|
||||
"zone": "PBLUFF",
|
||||
"name": "Pacific Bluffs"
|
||||
},
|
||||
{
|
||||
"zone": "PBOX",
|
||||
"name": "Pillbox Hill"
|
||||
},
|
||||
{
|
||||
"zone": "PROCOB",
|
||||
"name": "Procopio Beach"
|
||||
},
|
||||
{
|
||||
"zone": "RANCHO",
|
||||
"name": "Rancho"
|
||||
},
|
||||
{
|
||||
"zone": "RGLEN",
|
||||
"name": "Richman Glen"
|
||||
},
|
||||
{
|
||||
"zone": "RICHM",
|
||||
"name": "Richman"
|
||||
},
|
||||
{
|
||||
"zone": "ROCKF",
|
||||
"name": "Rockford Hills"
|
||||
},
|
||||
{
|
||||
"zone": "RTRAK",
|
||||
"name": "Redwood Lights Track"
|
||||
},
|
||||
{
|
||||
"zone": "SANAND",
|
||||
"name": "San Andreas"
|
||||
},
|
||||
{
|
||||
"zone": "SANCHIA",
|
||||
"name": "San Chianski Mountain Range"
|
||||
},
|
||||
{
|
||||
"zone": "SANDY",
|
||||
"name": "Sandy Shores"
|
||||
},
|
||||
{
|
||||
"zone": "SKID",
|
||||
"name": "Mission Row"
|
||||
},
|
||||
{
|
||||
"zone": "SLAB",
|
||||
"name": "Stab City"
|
||||
},
|
||||
{
|
||||
"zone": "STAD",
|
||||
"name": "Maze Bank Arena"
|
||||
},
|
||||
{
|
||||
"zone": "STRAW",
|
||||
"name": "Strawberry"
|
||||
},
|
||||
{
|
||||
"zone": "TATAMO",
|
||||
"name": "Terminal"
|
||||
},
|
||||
{
|
||||
"zone": "TEXTI",
|
||||
"name": "Textile City"
|
||||
},
|
||||
{
|
||||
"zone": "TONGVAH",
|
||||
"name": "Tongva Hills"
|
||||
},
|
||||
{
|
||||
"zone": "TONGVAV",
|
||||
"name": "Tongva Valley"
|
||||
},
|
||||
{
|
||||
"zone": "VCANA",
|
||||
"name": "Vespucci Canals"
|
||||
},
|
||||
{
|
||||
"zone": "VESP",
|
||||
"name": "Vespucci"
|
||||
},
|
||||
{
|
||||
"zone": "VINE",
|
||||
"name": "Vinewood"
|
||||
},
|
||||
{
|
||||
"zone": "WINDF",
|
||||
"name": "Ron Alternates Wind Farm"
|
||||
},
|
||||
{
|
||||
"zone": "WVINE",
|
||||
"name": "West Vinewood"
|
||||
},
|
||||
{
|
||||
"zone": "ZANCUDO",
|
||||
"name": "Zancudo River"
|
||||
},
|
||||
{
|
||||
"zone": "ZP_ORT",
|
||||
"name": "Port of South Los Santos"
|
||||
},
|
||||
{
|
||||
"zone": "ZQ_UAR",
|
||||
"name": "Davis Quartz"
|
||||
},
|
||||
{
|
||||
"zone": "PROL",
|
||||
"name": "North Yankton"
|
||||
},
|
||||
{
|
||||
"zone": "ISHEIST",
|
||||
"name": "Cayo Perico Island"
|
||||
},
|
||||
{
|
||||
"zone": "GALLI",
|
||||
"name": "Galileo"
|
||||
},
|
||||
{
|
||||
"zone": "OBSERV",
|
||||
"name": "Galileo"
|
||||
}
|
||||
]
|
2
resources/[tools]/uz_PureHud/.gitattributes
vendored
|
@ -1,2 +0,0 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
|
@ -1,128 +0,0 @@
|
|||
Customize = {
|
||||
Framework = "QBCore", -- QBCore | ESX | NewESX | OldQBCore (Write the framework you used as in the example)
|
||||
|
||||
SpeedometerTypeKMH = true, -- kmh | mph
|
||||
AlwaysOnMinimap = false, -- Specifies whether the minimap should be visible outside the vehicle
|
||||
StreetDisplay = true,
|
||||
ServerName = 'uz rp',
|
||||
MoneyType = '$',
|
||||
OnlinePlayersRefreshTime = 25000,
|
||||
|
||||
GetVehFuel = function(Veh)
|
||||
return GetVehicleFuelLevel(Veh) -- exports["LegacyFuel"]:GetFuel(Veh) - GetVehicleFuelLevel(Veh) - exports["uz_fuel"]:GetFuel(Veh)
|
||||
end,
|
||||
|
||||
Display = {
|
||||
PlayerDisplay = true,
|
||||
MoneyDisplay = true
|
||||
},
|
||||
|
||||
UIColor = {
|
||||
Health = '#F3163E',
|
||||
Armour = '#00A3FF',
|
||||
Hunger = '#ADFE00',
|
||||
Thirst = '#00FFF0',
|
||||
Stamina = '#FFA048',
|
||||
Stress = '#FF0099',
|
||||
Location = '#FFFFFF',
|
||||
MoneyBackground = '#FFFFFF',
|
||||
ServersBackground = '#FFFFFF',
|
||||
ServerDetails = '#F3163E',
|
||||
MoneyIcon = '#F3163E',
|
||||
},
|
||||
|
||||
|
||||
Stress = true, -- true | false
|
||||
StressChance = 0.1, -- Default: 10% -- Percentage Stress Chance When Shooting (0-1)
|
||||
MinimumStress = 50, -- Minimum Stress Level For Screen Shaking
|
||||
MinimumSpeed = 100, -- Going Over This Speed Will Cause Stress
|
||||
MinimumSpeedUnbuckled = 50, -- Going Over This Speed Will Cause Stress
|
||||
DisableJobsStress = { 'police', 'ambulance'}, -- Add here jobs you want to disable stress - OLD: -- DisablePoliceStress = true, -- If true will disable stress for people with the police job
|
||||
|
||||
WhitelistedWeaponStress = {
|
||||
`weapon_petrolcan`,
|
||||
`weapon_hazardcan`,
|
||||
`weapon_fireextinguisher`
|
||||
},
|
||||
|
||||
Intensity = {
|
||||
[1] = {
|
||||
min = 50,
|
||||
max = 60,
|
||||
intensity = 1500,
|
||||
},
|
||||
[2] = {
|
||||
min = 60,
|
||||
max = 70,
|
||||
intensity = 2000,
|
||||
},
|
||||
[3] = {
|
||||
min = 70,
|
||||
max = 80,
|
||||
intensity = 2500,
|
||||
},
|
||||
[4] = {
|
||||
min = 80,
|
||||
max = 90,
|
||||
intensity = 2700,
|
||||
},
|
||||
[5] = {
|
||||
min = 90,
|
||||
max = 100,
|
||||
intensity = 3000,
|
||||
},
|
||||
},
|
||||
|
||||
EffectInterval = {
|
||||
[1] = {
|
||||
min = 50,
|
||||
max = 60,
|
||||
timeout = math.random(50000, 60000)
|
||||
},
|
||||
[2] = {
|
||||
min = 60,
|
||||
max = 70,
|
||||
timeout = math.random(40000, 50000)
|
||||
},
|
||||
[3] = {
|
||||
min = 70,
|
||||
max = 80,
|
||||
timeout = math.random(30000, 40000)
|
||||
},
|
||||
[4] = {
|
||||
min = 80,
|
||||
max = 90,
|
||||
timeout = math.random(20000, 30000)
|
||||
},
|
||||
[5] = {
|
||||
min = 90,
|
||||
max = 100,
|
||||
timeout = math.random(15000, 20000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function GetFramework()
|
||||
local Get = nil
|
||||
if Customize.Framework == "NewESX" then
|
||||
Get = exports['es_extended']:getSharedObject()
|
||||
end
|
||||
if Customize.Framework == "QBCore" then
|
||||
Get = exports["qb-core"]:GetCoreObject()
|
||||
end
|
||||
if Customize.Framework == "ESX" then
|
||||
while Get == nil do
|
||||
TriggerEvent('esx:getSharedObject', function(Set) Get = Set end)
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
end
|
||||
if Customize.Framework == "OldQBCore" then
|
||||
while Get == nil do
|
||||
TriggerEvent('QBCore:GetObject', function(Set) Get = Set end)
|
||||
Citizen.Wait(200)
|
||||
end
|
||||
end
|
||||
return Get
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
## 🚀 Get the Latest Version
|
||||
The latest version of Pure Hud is available for download on [**Latest Version**](https://www.uzscripts.com/scripts/pure-hud)
|
||||
|
||||
<div align="center">
|
||||
<h1>UZ Scripts</h1>
|
||||
</div>
|
||||
|
||||
## 📌 Quick Access
|
||||
- [**🎥 Watch Video**](https://youtu.be/xs9HUHDtX_o)
|
||||
- [**💻 Download Latest Version**](https://www.uzscripts.com/scripts/pure-hud)
|
||||
- [**💬 Join Discord**](https://discord.uzscripts.com/)
|
||||
|
||||
<div align="center">
|
||||
<a href="https://youtu.be/xs9HUHDtX_o">
|
||||
<img src="https://img.youtube.com/vi/xs9HUHDtX_o/0.jpg" alt="UZ Scripts hud video" width="600">
|
||||
</a>
|
||||
</div>
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1,534 +0,0 @@
|
|||
Framework, PlayerLoaded, SpeedType, PlayerPed, stress, seatbeltOn = nil, false, nil, nil, 0, false
|
||||
Framework = GetFramework()
|
||||
Callback = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Framework.TriggerServerCallback or Framework.Functions.TriggerCallback
|
||||
|
||||
-- Optimization
|
||||
Citizen.CreateThread(function()
|
||||
Citizen.Wait(1)
|
||||
while true do
|
||||
PlayerPed = PlayerPedId()
|
||||
Citizen.Wait(4500)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('PlayerLoaded', function(set)
|
||||
stress = Customize.Stress and set or 0
|
||||
FirstSetUp()
|
||||
LoadRectMinimap()
|
||||
end)
|
||||
|
||||
|
||||
function FirstSetUp()
|
||||
SpeedType = Customize.SpeedometerTypeKMH and 3.6 or 2.23694
|
||||
SendReactMessage('setFirstSetUp', {
|
||||
ID = GetPlayerServerId(PlayerId()),
|
||||
ServerName = Customize.ServerName,
|
||||
AlwaysOnMinimap = Customize.AlwaysOnMinimap,
|
||||
SpeedType = Customize.SpeedometerTypeKMH and 'km/h' or 'mp/h',
|
||||
MoneyType = Customize.MoneyType,
|
||||
StreetDisplay = Customize.StreetDisplay,
|
||||
UIColor = Customize.UIColor,
|
||||
Display = Customize.Display,
|
||||
StressDisplay = Customize.Stress,
|
||||
setVisible = true
|
||||
})
|
||||
if (Customize.Framework == "ESX" or Customize.Framework == "NewESX") then
|
||||
Callback('GetMoney', function(bank) SendReactMessage('setMoney', bank) end)
|
||||
else
|
||||
TriggerServerEvent('QBCore:UpdatePlayer')
|
||||
SendReactMessage('setMoney', Framework.Functions.GetPlayerData().money.bank)
|
||||
end
|
||||
SendReactMessage('setUpdateStress', math.ceil(stress))
|
||||
PlayerLoaded = true
|
||||
end
|
||||
|
||||
Citizen.CreateThread(function() -- Online Players
|
||||
local wait
|
||||
while true do
|
||||
if Optimize() then
|
||||
Callback('Players', function(Get) SendReactMessage('setPlayersUpdate', Get) end)
|
||||
wait = Customize.OnlinePlayersRefreshTime or 25000
|
||||
else
|
||||
wait = 2000
|
||||
end
|
||||
Citizen.Wait(wait)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
function Optimize()
|
||||
if Framework == nil or not PlayerLoaded or PlayerPed == nil then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- ! Health
|
||||
local LastHealth
|
||||
Citizen.CreateThread(function()
|
||||
local wait
|
||||
while true do
|
||||
if Optimize() then
|
||||
local Health = math.floor((GetEntityHealth(PlayerPed)/2))
|
||||
if IsPedInAnyVehicle(PlayerPed) then wait = 250 else wait = 650 end
|
||||
if Health ~= LastHealth then
|
||||
if GetEntityModel(PlayerPed) == `mp_f_freemode_01` and Health ~= 0 then Health = (Health+13) end
|
||||
SendReactMessage('setHealth', Health)
|
||||
LastHealth = Health
|
||||
else
|
||||
wait = wait + 1200
|
||||
end
|
||||
else
|
||||
Citizen.Wait(2000)
|
||||
end
|
||||
Citizen.Wait(wait)
|
||||
end
|
||||
end)
|
||||
|
||||
-- ! Armour
|
||||
local LastArmour
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
if Optimize() then
|
||||
local Armour = GetPedArmour(PlayerPed)
|
||||
if Armour ~= LastArmour then
|
||||
SendReactMessage('setArmour', Armour)
|
||||
Citizen.Wait(2500)
|
||||
LastArmour = Armour
|
||||
else
|
||||
Citizen.Wait(4321)
|
||||
end
|
||||
else
|
||||
Citizen.Wait(2000)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- ! Stamina
|
||||
Citizen.CreateThread(function()
|
||||
local wait, LastOxygen
|
||||
while true do
|
||||
local Player = PlayerId()
|
||||
local newoxygen = GetPlayerSprintStaminaRemaining(Player)
|
||||
if IsPedInAnyVehicle(PlayerPed) then wait = 2100 end
|
||||
if LastOxygen ~= newoxygen then
|
||||
wait = 125
|
||||
if IsEntityInWater(PlayerPed) then
|
||||
oxygen = GetPlayerUnderwaterTimeRemaining(Player) * 10
|
||||
else
|
||||
oxygen = 100 - GetPlayerSprintStaminaRemaining(Player)
|
||||
end
|
||||
LastOxygen = newoxygen
|
||||
SendReactMessage('setStamina', math.ceil(oxygen))
|
||||
else
|
||||
wait = 1850
|
||||
end
|
||||
Citizen.Wait(wait)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
-- ? Status
|
||||
RegisterNetEvent('hud:client:UpdateNeeds', function(newHunger, newThirst) -- Triggered in qb-core
|
||||
local Hungerr = 0
|
||||
local Thirstt = 0
|
||||
if math.ceil(newHunger) > 100 then
|
||||
Hungerr = 100
|
||||
else
|
||||
Hungerr = math.ceil(newHunger)
|
||||
end
|
||||
if math.ceil(newThirst) > 100 then
|
||||
Thirstt = 100
|
||||
else
|
||||
Thirstt = math.ceil(newThirst)
|
||||
end
|
||||
SendReactMessage('setUpdateNeeds', { Hunger = Hungerr, Thirst = Thirstt })
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
if Customize.Framework == "NewESX" or Customize.Framework == "ESX" then
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
Citizen.Wait(2500)
|
||||
TriggerEvent('esx_status:getStatus', 'hunger', function(hunger)
|
||||
TriggerEvent('esx_status:getStatus', 'thirst', function(thirst)
|
||||
SendReactMessage('setUpdateNeeds', { Hunger = math.ceil(hunger.getPercent()), Thirst = math.ceil(thirst.getPercent()) })
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx_status:onTick")
|
||||
AddEventHandler("esx_status:onTick", function(data)
|
||||
for _,v in pairs(data) do
|
||||
if v.name == "hunger" then
|
||||
SendReactMessage('setUpdateNeedsHunger', math.ceil(v.percent))
|
||||
elseif v.name == "thirst" then
|
||||
SendReactMessage('setUpdateNeedsThirst', math.ceil(v.percent))
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_status:update')
|
||||
AddEventHandler('esx_status:update', function(data)
|
||||
for _,v in pairs(data) do
|
||||
if v.name == "hunger" then
|
||||
SendReactMessage('setUpdateNeedsHunger', math.ceil(v.percent))
|
||||
elseif v.name == "thirst" then
|
||||
SendReactMessage('setUpdateNeedsThirst', math.ceil(v.percent))
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
-- ? Speedometer
|
||||
local LastSpeed, LastRpm, LastEngine, LastLight, LastSeatbelt
|
||||
local LastFuel = 0
|
||||
Citizen.CreateThread(function()
|
||||
DisplayRadar(false)
|
||||
local wait
|
||||
while true do
|
||||
if Optimize() then
|
||||
if IsPedInAnyVehicle(PlayerPed) then
|
||||
local Vehicle = GetVehiclePedIsIn(PlayerPed, false)
|
||||
if Vehicle then
|
||||
local Plate = GetVehicleNumberPlateText(Vehicle)
|
||||
SendReactMessage('setSpedometer', true)
|
||||
wait = 90
|
||||
local LightVal, LightLights, LightHighlights = GetVehicleLightsState(Vehicle)
|
||||
Light = false
|
||||
if LightLights == 1 and LightHighlights == 0 or LightLights == 1 and LightHighlights == 1 then Light = true end
|
||||
local Speed, Rpm, Fuel, Engine = GetEntitySpeed(Vehicle), GetVehicleCurrentRpm(Vehicle), getFuelLevel(Vehicle), GetIsVehicleEngineRunning(Vehicle)
|
||||
local VehGear = GetVehicleCurrentGear(Vehicle)
|
||||
if (Speed == 0 and VehGear == 0) or (Speed == 0 and VehGear == 1) then VehGear = 'N' elseif Speed > 0 and VehGear == 0 then VehGear = 'R' end
|
||||
if LastSeatbelt ~= seatbeltOn or LastSpeed ~= Speed or LastRpm ~= Rpm or LastFuel ~= Fuel or LastEngine ~= Engine or LastLight ~= Light then
|
||||
SendReactMessage('Speed', {
|
||||
Speed = ("%.1d"):format(math.ceil(Speed * SpeedType)),
|
||||
Rpm = Rpm,
|
||||
Gear = VehGear,
|
||||
Fuel = Fuel,
|
||||
EngineDamage = GetVehicleEngineHealth(Vehicle) / 10,
|
||||
Engine = Engine,
|
||||
Seatbelt = seatbeltOn,
|
||||
Light = Light,
|
||||
})
|
||||
LastSpeed, LastRpm, LastFuel, LastEngine, LastLight = Speed, Rpm, Fuel, Engine, Light
|
||||
LastSeatbelt = seatbeltOn
|
||||
else wait = 175
|
||||
end
|
||||
DisplayRadar(true)
|
||||
end
|
||||
else
|
||||
SendReactMessage('setSpedometer', false)
|
||||
DisplayRadar((Customize.AlwaysOnMinimap) and true or false)
|
||||
-- if not Customize.AlwaysOnMinimap then DisplayRadar((not Customize.AlwaysOnMinimap) and false or true) end
|
||||
wait = 2750
|
||||
end
|
||||
else
|
||||
Citizen.Wait(2000)
|
||||
end
|
||||
Citizen.Wait(wait)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
local lastFuelUpdate = 0
|
||||
function getFuelLevel(vehicle)
|
||||
local updateTick = GetGameTimer()
|
||||
if (updateTick - lastFuelUpdate) > 2000 then
|
||||
lastFuelUpdate = updateTick
|
||||
LastFuel = math.floor(Customize.GetVehFuel(vehicle))
|
||||
end
|
||||
return LastFuel
|
||||
end
|
||||
|
||||
if Customize.StreetDisplay then
|
||||
local LastStreet1, LastStreet1
|
||||
Citizen.CreateThread(function()
|
||||
local wait = 2500
|
||||
while true do
|
||||
local Coords = GetEntityCoords(PlayerPed)
|
||||
local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger())
|
||||
if IsPedInAnyVehicle(PlayerPed) then wait = 1700 else wait = 4000 end
|
||||
StreetName1 = GetLabelText(GetNameOfZone(Coords.x, Coords.y, Coords.z))
|
||||
StreetName2 = GetStreetNameFromHashKey(Street1)
|
||||
if Street1 ~= LastStreet1 or Street2 ~= LastStreet2 then
|
||||
SendReactMessage('setStreet', {
|
||||
Street1 = StreetName1,
|
||||
Street2 = StreetName2
|
||||
})
|
||||
LastStreet1 = StreetName1
|
||||
LastStreet2 = StreetName2
|
||||
else
|
||||
wait = wait + 2100
|
||||
end
|
||||
Citizen.Wait(wait)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- Stress
|
||||
|
||||
-- Stress Gain
|
||||
RegisterNetEvent('UpdateStress', function(newStress) -- Add this event with adding stress elsewhere (QBCore)
|
||||
SendReactMessage('setUpdateStress', math.ceil(newStress))
|
||||
stress = newStress
|
||||
end)
|
||||
|
||||
if Customize.Stress then
|
||||
|
||||
CreateThread(function() -- Speeding
|
||||
while true do
|
||||
if Optimize() then
|
||||
if IsPedInAnyVehicle(PlayerPed, false) then
|
||||
local speed = GetEntitySpeed(GetVehiclePedIsIn(PlayerPed, false)) * SpeedType
|
||||
local stressSpeed = seatbeltOn and Customize.MinimumSpeed or Customize.MinimumSpeedUnbuckled
|
||||
if speed >= stressSpeed then
|
||||
TriggerServerEvent('SetStress', math.random(1, 3))
|
||||
end
|
||||
end
|
||||
end
|
||||
Wait(10000)
|
||||
end
|
||||
end)
|
||||
|
||||
local function IsWhitelistedWeaponStress(weapon)
|
||||
if weapon then
|
||||
for _, v in pairs(Customize.WhitelistedWeaponStress) do
|
||||
if weapon == v then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
CreateThread(function() -- Shooting
|
||||
while true do
|
||||
if Optimize() then
|
||||
local weapon = GetSelectedPedWeapon(PlayerPed)
|
||||
if weapon ~= `WEAPON_UNARMED` then
|
||||
if IsPedShooting(PlayerPed) and not IsWhitelistedWeaponStress(weapon) then
|
||||
if math.random() < Customize.StressChance then
|
||||
TriggerServerEvent('SetStress', math.random(1, 3))
|
||||
end
|
||||
end
|
||||
else
|
||||
Wait(1000)
|
||||
end
|
||||
end
|
||||
Wait(8)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Stress Screen Effects
|
||||
|
||||
function GetBlurIntensity(stresslevel)
|
||||
for _, v in pairs(Customize.Intensity) do
|
||||
if stresslevel >= v.min and stresslevel <= v.max then
|
||||
return v.intensity
|
||||
end
|
||||
end
|
||||
return 1500
|
||||
end
|
||||
|
||||
function GetEffectInterval(stresslevel)
|
||||
for _, v in pairs(Customize.EffectInterval) do
|
||||
if stresslevel >= v.min and stresslevel <= v.max then
|
||||
return v.timeout
|
||||
end
|
||||
end
|
||||
return 60000
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
local effectInterval = GetEffectInterval(stress)
|
||||
if stress >= 100 then
|
||||
local BlurIntensity = GetBlurIntensity(stress)
|
||||
local FallRepeat = math.random(2, 4)
|
||||
local RagdollTimeout = FallRepeat * 1750
|
||||
TriggerScreenblurFadeIn(1000.0)
|
||||
Wait(BlurIntensity)
|
||||
TriggerScreenblurFadeOut(1000.0)
|
||||
|
||||
if not IsPedRagdoll(PlayerPed) and IsPedOnFoot(PlayerPed) and not IsPedSwimming(PlayerPed) then
|
||||
SetPedToRagdollWithFall(PlayerPed, RagdollTimeout, RagdollTimeout, 1, GetEntityForwardVector(PlayerPed), 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
|
||||
end
|
||||
|
||||
Wait(1000)
|
||||
for _ = 1, FallRepeat, 1 do
|
||||
Wait(750)
|
||||
DoScreenFadeOut(200)
|
||||
Wait(1000)
|
||||
DoScreenFadeIn(200)
|
||||
TriggerScreenblurFadeIn(1000.0)
|
||||
Wait(BlurIntensity)
|
||||
TriggerScreenblurFadeOut(1000.0)
|
||||
end
|
||||
elseif stress >= Customize.MinimumStress then
|
||||
local BlurIntensity = GetBlurIntensity(stress)
|
||||
TriggerScreenblurFadeIn(1000.0)
|
||||
Wait(BlurIntensity)
|
||||
TriggerScreenblurFadeOut(1000.0)
|
||||
end
|
||||
Wait(effectInterval)
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
-- ? seatbelt
|
||||
RegisterNetEvent('seatbelt:client:ToggleSeatbelt', function() -- Triggered in smallresources
|
||||
seatbeltOn = not seatbeltOn
|
||||
end)
|
||||
|
||||
exports("SeatbeltState", function(state)
|
||||
seatbeltOn = state
|
||||
end)
|
||||
|
||||
-- ? Money
|
||||
RegisterNetEvent("QBCore:Player:SetPlayerData")
|
||||
AddEventHandler("QBCore:Player:SetPlayerData", function(data)
|
||||
SendReactMessage('setMoney', data.money.bank)
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('esx:setAccountMoney', function(account)
|
||||
if account.name == 'bank' then
|
||||
SendReactMessage('setBankMoney', account.money)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
function SendReactMessage(action, data) SendNUIMessage({ action = action, data = data }) end
|
||||
|
||||
|
||||
-- ? Map
|
||||
|
||||
|
||||
-- Minimap update
|
||||
-- CreateThread(function()
|
||||
-- while true do
|
||||
-- SetRadarBigmapEnabled(false, false)
|
||||
-- SetRadarZoom(1000)
|
||||
-- Wait(500)
|
||||
-- end
|
||||
-- end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
local minimap = RequestScaleformMovie("minimap")
|
||||
SetRadarBigmapEnabled(true, false)
|
||||
Wait(0)
|
||||
SetRadarBigmapEnabled(false, false)
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
local minimap = RequestScaleformMovie("minimap")
|
||||
if not HasScaleformMovieLoaded(minimap) then
|
||||
RequestScaleformMovie(minimap)
|
||||
while not HasScaleformMovieLoaded(minimap) do Wait(1) end
|
||||
end
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Citizen.Wait(1)
|
||||
HideHudComponentThisFrame(6) -- VEHICLE_NAME
|
||||
HideHudComponentThisFrame(7) -- AREA_NAME
|
||||
HideHudComponentThisFrame(8) -- VEHICLE_CLASS
|
||||
HideHudComponentThisFrame(9) -- STREET_NAME
|
||||
HideHudComponentThisFrame(3) -- CASH
|
||||
HideHudComponentThisFrame(4) -- MP_CASH
|
||||
end
|
||||
end)
|
||||
|
||||
function LoadRectMinimap()
|
||||
local defaultAspectRatio = 1920/1080 -- Don't change this.
|
||||
local resolutionX, resolutionY = GetActiveScreenResolution()
|
||||
local aspectRatio = resolutionX/resolutionY
|
||||
local minimapOffset = 0
|
||||
if aspectRatio > defaultAspectRatio then
|
||||
minimapOffset = ((defaultAspectRatio-aspectRatio)/3.6)-0.008
|
||||
end
|
||||
RequestStreamedTextureDict("squaremap", false)
|
||||
while not HasStreamedTextureDictLoaded("squaremap") do
|
||||
Wait(150)
|
||||
end
|
||||
|
||||
SetMinimapClipType(0)
|
||||
AddReplaceTexture("platform:/textures/graphics", "radarmasksm", "squaremap", "radarmasksm")
|
||||
AddReplaceTexture("platform:/textures/graphics", "radarmask1g", "squaremap", "radarmasksm")
|
||||
-- 0.0 = nav symbol and icons left
|
||||
-- 0.1638 = nav symbol and icons stretched
|
||||
-- 0.216 = nav symbol and icons raised up
|
||||
SetMinimapComponentPosition("minimap", "L", "B", 0.0 + minimapOffset, -0.047, 0.1638, 0.183)
|
||||
|
||||
-- icons within map
|
||||
SetMinimapComponentPosition("minimap_mask", "L", "B", 0.0 + minimapOffset, 0.0, 0.128, 0.20)
|
||||
|
||||
-- -0.01 = map pulled left
|
||||
-- 0.025 = map raised up
|
||||
-- 0.262 = map stretched
|
||||
-- 0.315 = map shorten
|
||||
SetMinimapComponentPosition('minimap_blur', 'L', 'B', -0.01 + minimapOffset, 0.025, 0.262, 0.300)
|
||||
|
||||
SetBlipAlpha(GetNorthRadarBlip(), 0)
|
||||
SetRadarBigmapEnabled(true, false)
|
||||
SetMinimapClipType(0)
|
||||
Wait(0)
|
||||
SetRadarBigmapEnabled(false, false)
|
||||
end
|
||||
|
||||
RegisterNetEvent('esx_basicneeds:onEat')
|
||||
AddEventHandler('esx_basicneeds:onEat', function()
|
||||
TriggerServerEvent('SetStress', -math.random(5, 15))
|
||||
end)
|
||||
|
||||
RegisterNetEvent('consumables:client:Eat')
|
||||
AddEventHandler('consumables:client:Eat', function()
|
||||
TriggerServerEvent('SetStress', -math.random(5, 15))
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('consumables:client:Drink')
|
||||
AddEventHandler('consumables:client:Drink', function()
|
||||
TriggerServerEvent('SetStress', -math.random(5, 15))
|
||||
end)
|
||||
RegisterNetEvent('consumables:client:DrinkAlcohol')
|
||||
AddEventHandler('consumables:client:DrinkAlcohol', function()
|
||||
TriggerServerEvent('SetStress', -math.random(5, 15))
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('esx_optionalneeds:onDrink')
|
||||
AddEventHandler('esx_optionalneeds:onDrink', function()
|
||||
TriggerServerEvent('SetStress', -math.random(5, 15))
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('esx_basicneeds:onDrink')
|
||||
AddEventHandler('esx_basicneeds:onDrink', function()
|
||||
TriggerServerEvent('SetStress', -math.random(5, 15))
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:onPlayerDeath', function()
|
||||
TriggerServerEvent('SetStress', -100)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('hospital:client:RespawnAtHospital')
|
||||
AddEventHandler('hospital:client:RespawnAtHospital', function()
|
||||
TriggerServerEvent('SetStress', -100)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('hospital:client:Revive')
|
||||
AddEventHandler('hospital:client:Revive', function()
|
||||
TriggerServerEvent('SetStress', -100)
|
||||
end)
|
|
@ -1,25 +0,0 @@
|
|||
fx_version "cerulean"
|
||||
|
||||
description "UZStore"
|
||||
author "UZ#5751"
|
||||
version "1.0.0"
|
||||
repository "https://discord.gg/8zhnDMMfNk"
|
||||
|
||||
lua54 "yes"
|
||||
|
||||
game "gta5"
|
||||
|
||||
ui_page "resources/build/index.html"
|
||||
|
||||
shared_script "Customize.lua"
|
||||
|
||||
client_script "client.lua"
|
||||
|
||||
server_script "server.lua"
|
||||
|
||||
files {
|
||||
"resources/build/index.html",
|
||||
"resources/build/**/*",
|
||||
}
|
||||
|
||||
escrow_ignore { "Customize.lua" }
|
|
@ -1,23 +0,0 @@
|
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
const path = require("path");
|
||||
module.exports = {
|
||||
webpack: {
|
||||
configure: (webpackConfig) => {
|
||||
// Because CEF has issues with loading source maps properly atm,
|
||||
// lets use the best we can get in line with `eval-source-map`
|
||||
if (webpackConfig.mode === 'development' && process.env.IN_GAME_DEV) {
|
||||
webpackConfig.devtool = 'eval-source-map'
|
||||
webpackConfig.output.path = path.join(__dirname, 'build')
|
||||
}
|
||||
|
||||
return webpackConfig
|
||||
}
|
||||
},
|
||||
|
||||
devServer: (devServerConfig) => {
|
||||
if (process.env.IN_GAME_DEV) {
|
||||
// Used for in-game dev mode
|
||||
devServerConfig.devMiddleware.writeToDisk = true
|
||||
}
|
||||
|
||||
return devServerConfig
|
||||
}
|
||||
}
|
28656
resources/[tools]/uz_PureHud/resources/package-lock.json
generated
|
@ -1,57 +0,0 @@
|
|||
{
|
||||
"name": "resources",
|
||||
"version": "0.1.0",
|
||||
"homepage": "resources/build",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@testing-library/user-event": "^14.2.0",
|
||||
"@types/jest": "^27.5.1",
|
||||
"@types/node": "^17.0.36",
|
||||
"@types/react": "^18.0.9",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"framer-motion": "^6.3.11",
|
||||
"howler": "^2.2.4",
|
||||
"react": "^18.0.0",
|
||||
"react-color": "^2.19.3",
|
||||
"react-dom": "^18.0.0",
|
||||
"react-scripts": "^5.0.1",
|
||||
"rgb-hex": "^4.0.0",
|
||||
"sass": "^1.52.1",
|
||||
"scss": "^0.2.4",
|
||||
"styled-components": "^5.3.5",
|
||||
"typescript": "^4.5.5",
|
||||
"web-vitals": "^2.1.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "cross-env PUBLIC_URL=/ craco start",
|
||||
"start:game": "cross-env IN_GAME_DEV=1 craco start",
|
||||
"build": "rimraf build && craco build",
|
||||
"test": "craco test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@craco/craco": "^6.4.3",
|
||||
"cross-env": "^7.0.3",
|
||||
"rimraf": "^3.0.2"
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<title>UZStore</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,36 +0,0 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import { motion } from "framer-motion";
|
||||
import { MainContext, useContext } from './Context';
|
||||
import { Hook } from './hook/Hook';
|
||||
|
||||
import PlayersHud from './components/PlayerHud';
|
||||
import Status from './components/Status';
|
||||
import Speedometer from './components/Speedometer';
|
||||
|
||||
import './App.scss'
|
||||
|
||||
const App = () => {
|
||||
const { Visible, StreetDisplay } = useContext(MainContext);
|
||||
|
||||
return (
|
||||
<motion.div className="UZStore" animate={Visible.is ? { opacity: 1, zIndex:5 } : { opacity: 0, zIndex:0 } }>
|
||||
<Status/>
|
||||
{StreetDisplay && (<Location/>)}
|
||||
<PlayersHud/>
|
||||
<Speedometer/>
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
export const Location = () => {
|
||||
const { UIColor, Speedometer, AlwaysOnMinimap, Street } = useContext(MainContext);
|
||||
return (
|
||||
<motion.div className="Location" animate={(Speedometer.Visible || AlwaysOnMinimap) ? {bottom: '16.8rem'} : {bottom: '5rem'}}>
|
||||
<div className="Street1"><p style={{color: UIColor.is['Location']}}>{Street.Street1}</p></div>
|
||||
<div className="Street2"><p style={{color: `${UIColor.is['Location']}80`}} id='2'>{Street.Street2}</p></div>
|
||||
{Hook.GetSVG('LocationSVG', UIColor.is['Location'])}
|
||||
</motion.div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App;
|
|
@ -1,358 +0,0 @@
|
|||
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1:wght@100..900&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
|
||||
|
||||
body {
|
||||
user-select: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
* { transition: .2s all linear; }
|
||||
|
||||
|
||||
.UZStore {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 67.5rem;
|
||||
width: 120rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
@mixin Street($top, $height) {
|
||||
position: absolute;
|
||||
width: 13rem;
|
||||
height: $height;
|
||||
left: 2.05rem;
|
||||
top: $top;
|
||||
> p {
|
||||
font-family: 'Montserrat';
|
||||
text-align: left;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-size: .938rem;
|
||||
letter-spacing: .1em;
|
||||
color: #FFFFFF;
|
||||
margin-top: -.1rem;
|
||||
}
|
||||
> p[id="2"] {
|
||||
font-size: .5rem;
|
||||
line-height: .813rem;
|
||||
color: #ffffff80;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.UZStore {
|
||||
.Location {
|
||||
position: absolute;
|
||||
width: 17rem;
|
||||
height: 2.438rem;
|
||||
left: 1.75rem;
|
||||
bottom: 16.8rem;
|
||||
}
|
||||
.Street1 { @include Street($top: .85rem, $height:.938rem); }
|
||||
.Street2 { @include Street($top: 1.8rem, $height:.5rem); }
|
||||
.LocationSVG {
|
||||
position: absolute;
|
||||
left: .5rem;
|
||||
bottom: .2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.UZStore {
|
||||
.Status {
|
||||
position: absolute;
|
||||
width: 19.5rem;
|
||||
height: 2.5rem;
|
||||
left: 1.75rem;
|
||||
bottom: 1.5rem;
|
||||
.Stat {
|
||||
position: relative;
|
||||
width: 2.506rem;
|
||||
height: 2.466rem;
|
||||
margin-left: .625rem;
|
||||
float: left;
|
||||
.Icon {
|
||||
position: absolute;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
margin: auto auto;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.UZStore {
|
||||
.PlayerHud {
|
||||
position: absolute;
|
||||
width: 30rem;
|
||||
height: 12rem;
|
||||
right: 0rem;
|
||||
top: 0rem;
|
||||
.Servers {
|
||||
position: absolute;
|
||||
width: 25.625rem;
|
||||
height: 5.25rem;
|
||||
right: 0;
|
||||
top: 2rem;
|
||||
background: linear-gradient(269.86deg, rgba(255, 255, 255, 0.5) 21.46%, rgba(255, 255, 255, 0) 93.27%);
|
||||
.ServerName {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 12rem;
|
||||
right: 0;
|
||||
top: 0;
|
||||
> p {
|
||||
text-align: right;
|
||||
font-family: 'Montserrat';
|
||||
font-style: italic;
|
||||
font-weight: 500;
|
||||
font-size: 4rem;
|
||||
margin-top: .1rem;
|
||||
letter-spacing: -0.08em;
|
||||
margin-right: .3rem;
|
||||
text-transform: uppercase;
|
||||
color: #F3163E;
|
||||
text-shadow: -.125rem .125rem .313rem #f3163e4f;
|
||||
}
|
||||
}
|
||||
.Time {
|
||||
position: absolute;
|
||||
width: 9rem;
|
||||
height: 1rem;
|
||||
left: 4.7rem;
|
||||
top: 2.4rem;
|
||||
> p {
|
||||
text-align: center;
|
||||
font-family: 'Montserrat';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-size: .875rem;
|
||||
line-height: 0;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.ID {
|
||||
position: absolute;
|
||||
width: 3rem;
|
||||
height: 1rem;
|
||||
left: 5.65rem;
|
||||
top: 1.5rem;
|
||||
> p {
|
||||
text-align: left;
|
||||
font-family: 'Montserrat';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-size: 1.063rem;
|
||||
margin-top: -.1rem;
|
||||
color: #F3163E;
|
||||
text-shadow: 0 0 .188rem rgba(0, 0, 0, 0.52);
|
||||
> span {
|
||||
font-size: .813rem;
|
||||
color: #E7E7E7;
|
||||
}
|
||||
}
|
||||
}
|
||||
.Players {
|
||||
position: absolute;
|
||||
width: 3rem;
|
||||
height: 1rem;
|
||||
left: 9.45rem;
|
||||
top: 1.5rem;
|
||||
> p {
|
||||
text-align: left;
|
||||
font-family: 'Montserrat';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-size: .813rem;
|
||||
text-indent: 1.3rem;
|
||||
margin-top: 0;
|
||||
color: #FFFFFF;
|
||||
text-shadow: 0 0 .188rem rgba(0, 0, 0, 0.52);
|
||||
}
|
||||
}
|
||||
}
|
||||
.Money {
|
||||
position: absolute;
|
||||
width: 15.159rem;
|
||||
height: 2.491rem;
|
||||
right: 0;
|
||||
top: 8.25rem;
|
||||
background: linear-gradient(269.86deg, #ffffff80 21.46%, #ffffff00 93.27%);
|
||||
> p {
|
||||
text-align: right;
|
||||
font-family: 'Montserrat';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-size: 1.063rem;
|
||||
margin-right: 3.45rem;
|
||||
line-height: .5rem;
|
||||
color: #FFFFFF;
|
||||
text-shadow: 0 0 .188rem #00000085;
|
||||
}
|
||||
.MoneySVG {
|
||||
position: absolute;
|
||||
right: 1.4rem;
|
||||
top: .55rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.UZStore {
|
||||
.Speedometer {
|
||||
position: absolute;
|
||||
width: 22rem;
|
||||
height: 17.5rem;
|
||||
right: 3.8rem;
|
||||
bottom: 2rem;
|
||||
transition: opacity .27s linear;
|
||||
// background-color: rgba(51, 153, 76, 0.274);
|
||||
.SpeedText {
|
||||
position: absolute;
|
||||
width: 78.45px;
|
||||
height: 2rem;
|
||||
margin: auto auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 7.75rem;
|
||||
z-index: 2;
|
||||
> p {
|
||||
text-align: center;
|
||||
font-family: 'M PLUS 1';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-size: 1.875rem;
|
||||
margin-top: -.5rem;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.Gear {
|
||||
position: absolute;
|
||||
width: 1rem;
|
||||
height: 1.5rem;
|
||||
margin: auto auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 10.8rem;
|
||||
> p {
|
||||
text-align: center;
|
||||
font-family: 'M PLUS 1';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-size: 1.25rem;
|
||||
margin-top: 0;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.SpeedType {
|
||||
position: absolute;
|
||||
width: 2rem;
|
||||
height: .8rem;
|
||||
margin: auto auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 9.7rem;
|
||||
> p {
|
||||
font-family: 'M PLUS 1';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-size: .5rem;
|
||||
margin-top: 0;
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
}
|
||||
.BackSVG {
|
||||
position: absolute;
|
||||
left: .7rem;
|
||||
top: -1.3rem;
|
||||
z-index: -1;
|
||||
}
|
||||
.SpeedBack2 {
|
||||
position: absolute;
|
||||
left: 4.7rem;
|
||||
top: 2.8rem;
|
||||
}
|
||||
.SpeedRoad {
|
||||
position: absolute;
|
||||
transform: rotate(0deg);
|
||||
width: .313rem;
|
||||
height: .313rem;
|
||||
margin: auto auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 8.6rem;
|
||||
z-index: 1;
|
||||
}
|
||||
.RPMSVG {
|
||||
position: absolute;
|
||||
top: 1.25rem;
|
||||
left: 3.2rem;
|
||||
stroke-dasharray: 650;
|
||||
stroke-dashoffset: 635;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes Flash {
|
||||
0% {
|
||||
opacity: 100%; /* Başlangıç durumu */
|
||||
}
|
||||
50% {
|
||||
opacity: 0%; /* Bitiş durumu */
|
||||
}
|
||||
100% {
|
||||
opacity: 100%; /* Bitiş durumu */
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes Rpm {
|
||||
0% {
|
||||
stroke-dashoffset: 635;
|
||||
}
|
||||
50% {
|
||||
stroke-dashoffset: 625;
|
||||
}
|
||||
100% {
|
||||
stroke-dashoffset: 635;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media screen and (width: 1920px) and (height: 1080px) {
|
||||
html { font-size: 16px; }
|
||||
}
|
||||
|
||||
@media screen and (width: 2560px) and (height: 1440px) {
|
||||
html { font-size: 21.35px; }
|
||||
}
|
||||
|
||||
@media screen and (width: 3840px) and (height: 2160px) {
|
||||
html { font-size: 32px; }
|
||||
}
|
||||
|
||||
@media screen and (width: 7680px) and (height: 4320px) {
|
||||
html { font-size: 64px; }
|
||||
}
|
||||
|
||||
@media screen and (width: 1280px) and (height: 720px) {
|
||||
html { font-size: 10.7px; }
|
||||
}
|
||||
|
||||
@media screen and (width: 854px) and (height: 480px) {
|
||||
html { font-size: 7.15px; }
|
||||
}
|
||||
|
||||
@media screen and (width: 640px) and (height: 360px) {
|
||||
html { font-size: 5.35px; }
|
||||
}
|
|
@ -1,171 +0,0 @@
|
|||
import {createContext, useContext, useState, useEffect} from "react";
|
||||
import App from "./App";
|
||||
|
||||
const MainContext = createContext()
|
||||
|
||||
const Provider = () => {
|
||||
const [isVisible, setVisible] = useState(false);
|
||||
const [isSpeedometerVisible, setSpeedometerVisible] = useState(false);
|
||||
|
||||
const [isMoney, setMoney] = useState('230.000.000');
|
||||
const [isServerName, setServerName] = useState('uz rp');
|
||||
const [isID, setID] = useState('6');
|
||||
const [isOnline, setOnline] = useState('300');
|
||||
|
||||
const [isHealth, setHealth] = useState(50);
|
||||
const [isArmor, setArmor] = useState(100);
|
||||
const [isHunger, setHunger] = useState(100);
|
||||
const [isThirst, setThirst] = useState(100);
|
||||
const [isOxygen, setOxygen] = useState(100);
|
||||
const [isStress, setStress] = useState(50);
|
||||
|
||||
const [isUIColor, setUIColor] = useState({
|
||||
Health: '#F3163E',
|
||||
Armour: '#00A3FF',
|
||||
Hunger: '#ADFE00',
|
||||
Thirst: '#00FFF0',
|
||||
Stamina: '#FFA048',
|
||||
Stress: '#FF0099',
|
||||
|
||||
Location: '#FFFFFF',
|
||||
MoneyBackground: '#FFFFFF',
|
||||
ServersBackground: '#FFFFFF',
|
||||
ServerDetails: '#F3163E',
|
||||
MoneyIcon: '#F3163E',
|
||||
});
|
||||
|
||||
|
||||
const [isSpeed, setSpeed] = useState(320);
|
||||
const [isRpm, setRpm] = useState(700);
|
||||
const [isGear, setGear] = useState(0);
|
||||
const [isFuel, setFuel] = useState(0);
|
||||
const [isEngine, setEngine] = useState(false);
|
||||
const [isSeatbelt, setSeatbelt] = useState(false);
|
||||
const [isLight, setLight] = useState(false);
|
||||
const [isEngineDamage, setEngineDamage] = useState(0);
|
||||
|
||||
const [isAlwaysOnMinimap, setAlwaysOnMinimap] = useState(false);
|
||||
const [isSpeedType, setSpeedType] = useState('mph');
|
||||
const [isMoneyType, setMoneyType] = useState('$');
|
||||
|
||||
const [isStreetDisplay, setStreetDisplay] = useState(true);
|
||||
|
||||
const [isStreet, setStreet] = useState({
|
||||
Street1: 'DOWNTOWN ST.',
|
||||
Street2: 'DOWNTOWN ST.',
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const SendNUIMessage = (event) => {
|
||||
const { action, data } = event.data;
|
||||
if (action === 'setOpen') {
|
||||
setVisible(data.setOpen)
|
||||
} else if (action === 'setHealth') {
|
||||
setHealth(data)
|
||||
} else if (action === 'setArmour') {
|
||||
setArmor(data)
|
||||
} else if (action === 'setStamina') {
|
||||
setOxygen(data)
|
||||
} else if (action === 'setUpdateNeeds') {
|
||||
setHunger(data.Hunger)
|
||||
setThirst(data.Thirst)
|
||||
} else if (action === 'setUpdateNeedsHunger') {
|
||||
setHunger(data)
|
||||
} else if (action === 'setUpdateNeedsThirst') {
|
||||
setThirst(data)
|
||||
} else if (action === 'setSpedometer') {
|
||||
setSpeedometerVisible(data)
|
||||
if (!data) {
|
||||
setSpeed(320)
|
||||
setRpm(700)
|
||||
setFuel(0)
|
||||
}
|
||||
} else if (action === 'Speed') {
|
||||
setSpeed(data.Speed)
|
||||
setRpm(Math.ceil(data.Rpm * 630))
|
||||
setGear(data.Gear)
|
||||
setFuel(data.Fuel)
|
||||
setEngineDamage(data.EngineDamage)
|
||||
setEngine(data.Engine)
|
||||
setSeatbelt(data.Seatbelt)
|
||||
setLight(data.Light)
|
||||
} else if (action === 'setFirstSetUp') {
|
||||
setID(data.ID)
|
||||
setServerName(data.ServerName)
|
||||
setAlwaysOnMinimap(data.AlwaysOnMinimap)
|
||||
setSpeedType(data.SpeedType)
|
||||
setMoneyType(data.MoneyType)
|
||||
setStreetDisplay(data.StreetDisplay)
|
||||
|
||||
setUIColor(data.UIColor)
|
||||
|
||||
setVisible(data.setVisible)
|
||||
} else if (action === 'setMoney') {
|
||||
setMoney(data)
|
||||
} else if (action === 'setPlayersUpdate') {
|
||||
setOnline(data)
|
||||
} else if (action === 'setStreet') {
|
||||
setStreet({
|
||||
Street1: data.Street1,
|
||||
Street2: data.Street2,
|
||||
})
|
||||
} else if (action === 'setUpdateStress') {
|
||||
setStress(data)
|
||||
}
|
||||
}
|
||||
window.addEventListener("message", SendNUIMessage);
|
||||
return () => {
|
||||
window.removeEventListener("message", SendNUIMessage);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<MainContext.Provider
|
||||
value={{
|
||||
Visible: {is: isVisible, set: setVisible},
|
||||
UIColor: {is: isUIColor, set: setUIColor},
|
||||
Status: {
|
||||
Health: isHealth,
|
||||
Armour: isArmor,
|
||||
Hunger: isHunger,
|
||||
Thirst: isThirst,
|
||||
Stamina: isOxygen,
|
||||
Stress: isStress,
|
||||
},
|
||||
PlayerHud: {
|
||||
Money: isMoney,
|
||||
ServerName: isServerName,
|
||||
ID: isID,
|
||||
Online: isOnline,
|
||||
MoneyType: isMoneyType,
|
||||
},
|
||||
Speedometer: {
|
||||
Visible: isSpeedometerVisible,
|
||||
Speed: isSpeed,
|
||||
Rpm: isRpm,
|
||||
Gear: isGear,
|
||||
SpeedType: isSpeedType,
|
||||
Fuel: isFuel,
|
||||
EngineDamage: isEngineDamage,
|
||||
Engine: isEngine,
|
||||
Seatbelt: isSeatbelt,
|
||||
Light: isLight,
|
||||
},
|
||||
AlwaysOnMinimap: isAlwaysOnMinimap,
|
||||
StreetDisplay: isStreetDisplay,
|
||||
Street: isStreet,
|
||||
}}
|
||||
>
|
||||
<App />
|
||||
</MainContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export {
|
||||
MainContext,
|
||||
useContext,
|
||||
Provider
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
import React from 'react'
|
||||
import { MainContext, useContext } from '../Context'
|
||||
import { Hook } from '../hook/Hook';
|
||||
|
||||
export default function PlayersHud() {
|
||||
const { UIColor, PlayerHud } = useContext(MainContext);
|
||||
|
||||
const Time = new Date()
|
||||
return (
|
||||
<div className='PlayerHud'>
|
||||
<div className="Servers" style={{background: `linear-gradient(269.86deg, ${UIColor.is['ServersBackground']}80 21.46%, ${UIColor.is['ServersBackground']}00 93.27%)`}}>
|
||||
<div className="ServerName"><p style={{color: UIColor.is['ServerDetails'], textShadow: `-.125rem .125rem .313rem ${UIColor.is['ServerDetails']}4f`}}>{PlayerHud.ServerName}</p></div>
|
||||
<div className="Time"><p>{Time.getDate()}.{Time.getMonth() + 1}.{Time.getFullYear()} / {Time.getHours()}.{Time.getMinutes()}</p></div>
|
||||
<div className="ID"><p style={{color: UIColor.is['ServerDetails']}}>ID <span>{PlayerHud.ID}</span></p></div>
|
||||
<div className="Players">
|
||||
<p>{PlayerHud.Online}</p>
|
||||
{Hook.GetSVG('OnlineSVG', UIColor.is['ServerDetails'])}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="Money" style={{background: `linear-gradient(269.86deg, ${UIColor.is['MoneyBackground']}80 21.46%, ${UIColor.is['MoneyBackground']}00 93.27%)`}}>
|
||||
<p>{PlayerHud.MoneyType}{PlayerHud.Money}</p>
|
||||
{Hook.GetSVG('MoneySVG', UIColor.is['MoneyIcon'])}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import React from 'react'
|
||||
import { motion } from "framer-motion";
|
||||
import { Hook } from '../hook/Hook';
|
||||
import { MainContext, useContext } from '../Context';
|
||||
|
||||
const StatusTable = ['Health','Armour','Hunger','Thirst','Stamina','Stress']
|
||||
|
||||
export default function Status() {
|
||||
const { Status, UIColor } = useContext(MainContext);
|
||||
return (
|
||||
<div className='Status'>
|
||||
{StatusTable.map((index,s) => (
|
||||
<motion.div className="Stat" animate={{animation: ((Status[index] < 17 && index !== 'Armour' && Status[index] < 17 && index !== 'Stress')) && 'Flash .7s infinite alternate'}} >
|
||||
<div className="Icon" style={{filter:`drop-shadow(0 0 .25rem ${UIColor.is[index]}40)`}}>{Hook.GetSVG(`Icon${index}`, UIColor.is[index])}</div>
|
||||
{Hook.GetSVG('StatusSVG', UIColor.is[index], Status[index])}
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { GetSVG } from './GetSVG';
|
||||
|
||||
export const Hook = { GetSVG }
|
|
@ -1,10 +0,0 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { Provider } from "./Context";
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<Provider />
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
)
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
Framework = nil
|
||||
PlayerStress = json.decode(LoadResourceFile(GetCurrentResourceName(), "./Stress.json"))
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while Framework == nil do Citizen.Wait(750) end
|
||||
Citizen.Wait(2500)
|
||||
for _,v in pairs(GetPlayers()) do
|
||||
local ID = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Framework.GetPlayerFromId(tonumber(v))?.identifier or Framework.Functions.GetPlayer(tonumber(v))?.PlayerData?.citizenid
|
||||
if Player ~= nil then
|
||||
if not PlayerStress[ID] then PlayerStress[ID] = 0 end
|
||||
TriggerClientEvent('PlayerLoaded', tonumber(v), tonumber(PlayerStress[ID]))
|
||||
Wait(74)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
Framework = GetFramework()
|
||||
Callback = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Framework.RegisterServerCallback or Framework.Functions.CreateCallback
|
||||
Citizen.Wait(2000)
|
||||
|
||||
Callback('Players', function(source, cb)
|
||||
local count = 0
|
||||
local plyr = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Framework.GetPlayers() or Framework.Functions.GetPlayers()
|
||||
for k,v in pairs(plyr) do
|
||||
if v ~= nil then count = count + 1 end
|
||||
end
|
||||
cb(count)
|
||||
end)
|
||||
|
||||
Callback('GetMoney', function(source, cb)
|
||||
cb(Framework.GetPlayerFromId(source).getAccount("bank").money)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded')
|
||||
AddEventHandler('esx:playerLoaded', function(src)
|
||||
Wait(700)
|
||||
local ID = Framework.GetPlayerFromId(src)?.identifier
|
||||
if not PlayerStress[ID] then PlayerStress[ID] = 0 end
|
||||
TriggerClientEvent('PlayerLoaded', src, tonumber(PlayerStress[ID]))
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Server:OnPlayerLoaded')
|
||||
AddEventHandler('QBCore:Server:OnPlayerLoaded', function()
|
||||
local source = source
|
||||
Wait(700)
|
||||
local ID = Framework.Functions.GetPlayer(source)?.PlayerData?.citizenid
|
||||
if not PlayerStress[ID] then PlayerStress[ID] = 0 end
|
||||
TriggerClientEvent('PlayerLoaded', source, tonumber(PlayerStress[ID]))
|
||||
end)
|
||||
|
||||
|
||||
-- PlayerStress = {}
|
||||
|
||||
RegisterNetEvent('SetStress', function(amount)
|
||||
local Player = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Framework.GetPlayerFromId(source) or Framework.Functions.GetPlayer(source)
|
||||
local JobName = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Player.job.label or Player.PlayerData.job.label
|
||||
local ID = (Customize.Framework == "ESX" or Customize.Framework == "NewESX") and Player.identifier or Player.PlayerData.citizenid
|
||||
local newStress
|
||||
if not Player or IsWhitelisted(Player, JobName) then return end -- OLD: if not Player or (Customize.DisablePoliceStress and JobName == 'police') then return end
|
||||
if not PlayerStress[ID] then PlayerStress[ID] = 0 end
|
||||
newStress = PlayerStress[ID] + amount
|
||||
if newStress <= 0 then newStress = 0 end
|
||||
if newStress > 100 then newStress = 100 end
|
||||
PlayerStress[ID] = newStress
|
||||
TriggerClientEvent('UpdateStress', source, PlayerStress[ID])
|
||||
SaveResourceFile(GetCurrentResourceName(), "./Stress.json", json.encode(PlayerStress), -1)
|
||||
end)
|
||||
|
||||
function IsWhitelisted(Player, JobName)
|
||||
if Player then
|
||||
for _, v in pairs(Customize.DisableJobsStress) do
|
||||
if jobName == v then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|