forked from Simnation/Main
ed
This commit is contained in:
parent
9858aec20c
commit
43323f5d5b
26 changed files with 30515 additions and 0 deletions
2
resources/[tools]/uz_PureHud/uz_PureHud-main/.gitattributes
vendored
Normal file
2
resources/[tools]/uz_PureHud/uz_PureHud-main/.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
128
resources/[tools]/uz_PureHud/uz_PureHud-main/Customize.lua
Normal file
128
resources/[tools]/uz_PureHud/uz_PureHud-main/Customize.lua
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
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
|
17
resources/[tools]/uz_PureHud/uz_PureHud-main/README.md
Normal file
17
resources/[tools]/uz_PureHud/uz_PureHud-main/README.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
## 🚀 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
resources/[tools]/uz_PureHud/uz_PureHud-main/Stress.json
Normal file
1
resources/[tools]/uz_PureHud/uz_PureHud-main/Stress.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}
|
534
resources/[tools]/uz_PureHud/uz_PureHud-main/client.lua
Normal file
534
resources/[tools]/uz_PureHud/uz_PureHud-main/client.lua
Normal file
|
@ -0,0 +1,534 @@
|
||||||
|
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)
|
25
resources/[tools]/uz_PureHud/uz_PureHud-main/fxmanifest.lua
Normal file
25
resources/[tools]/uz_PureHud/uz_PureHud-main/fxmanifest.lua
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
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" }
|
23
resources/[tools]/uz_PureHud/uz_PureHud-main/resources/.gitignore
vendored
Normal file
23
resources/[tools]/uz_PureHud/uz_PureHud-main/resources/.gitignore
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# 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*
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
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/uz_PureHud-main/resources/package-lock.json
generated
Normal file
28656
resources/[tools]/uz_PureHud/uz_PureHud-main/resources/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!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>
|
|
@ -0,0 +1,36 @@
|
||||||
|
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;
|
|
@ -0,0 +1,358 @@
|
||||||
|
@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; }
|
||||||
|
}
|
Binary file not shown.
|
@ -0,0 +1,171 @@
|
||||||
|
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
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
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>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,20 @@
|
||||||
|
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>
|
||||||
|
)
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,3 @@
|
||||||
|
import { GetSVG } from './GetSVG';
|
||||||
|
|
||||||
|
export const Hook = { GetSVG }
|
|
@ -0,0 +1,10 @@
|
||||||
|
import React from 'react'
|
||||||
|
import ReactDOM from 'react-dom'
|
||||||
|
import { Provider } from "./Context";
|
||||||
|
|
||||||
|
ReactDOM.render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<Provider />
|
||||||
|
</React.StrictMode>,
|
||||||
|
document.getElementById('root')
|
||||||
|
)
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
}
|
81
resources/[tools]/uz_PureHud/uz_PureHud-main/server.lua
Normal file
81
resources/[tools]/uz_PureHud/uz_PureHud-main/server.lua
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
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
|
Binary file not shown.
BIN
resources/[tools]/uz_PureHud/uz_PureHud-main/stream/minimap.gfx
Normal file
BIN
resources/[tools]/uz_PureHud/uz_PureHud-main/stream/minimap.gfx
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue