Ez HUD is an advanced hud system for RedM VORP servers. It is designed with minimalism in mind, while still providing all the necessary information to the player.
Read the config file for to understand all features.
We recommend to download and use Ez_Consumables, a free resource.
STEP 1 - Unzip and Add Script To Server
Unzip the script folder within your server resources folder. Ensure script in server.cfg ... "ensure ez_hud".
STEP 2 - Script Configuration
Script config located in config.lua. It is well documented with comments to ensure you know what each attribute does.
Interval Loop & Temperature System
Within the config file, there is a table called Config.UpdateInterval.
Config.UpdateInterval = { -- Update Temp, Food and Water
Time = 1, -- Minutes every update (Recommended: 1)
Effect = { -- Regular changes every update
Thirst = -2.0, -- Decreases every update
Hunger = -1.0, -- Decreases every update
Stress = 0, -- Increases every update
},
Temperature = { -- Temperature Changes (Celcius)
Min = -12, -- Minimum Temperature
Max = 50, -- Maximum Temperature
Effect = { -- Temperature Effects: How below or above the min/max temperature affects the player
Thirst = -2.0, -- Thirst Decrease
Stress = 2.0, -- Stress Increase
Hunger = -2.0, -- Hunger Decrease
},
Clothing = { -- Clothes give extra protection against the temperature (Increases Temp)
Hat = 0.7,
Shirt = 1,
Pants = 1,
Boots = 0.7,
Coat = 3,
ClosedCoat = 5,
Gloves = 0.7,
Vest = 1,
Poncho = 2,
},
Waist = { -- Waist size affects the temperature
["-10"] = -1.0, -- Skinny
["-9"] = -0.9,
["-8"] = -0.8,
["-7"] = -0.7,
["-6"] = -0.6,
["-5"] = -0.5,
["-4"] = -0.4,
["-3"] = -0.3,
["-2"] = -0.2,
["-1"] = -0.1,
["0"] = 0, -- Normal
["1"] = 0.1,
["2"] = 0.2,
["3"] = 0.3,
["4"] = 0.4,
["5"] = 0.5,
["6"] = 0.6,
["7"] = 0.7,
["8"] = 0.8,
["9"] = 0.9,
["10"] = 1.0, -- Fat
},
},
}
This is checked every Time minute(s). We recommend to keep time 1. It must be an integer.
Effects holds what happens every interval. On default thirst level (100 = good, 0 = bad) is reduced by 2 and hunger by 1 every interval.
The script includes a temperature system, where depending on the atmosphere temperature, the clothes you wear and how fat you are, it calculates your body temperature. Your temperature is gotten efficiently every 750 milliseconds to update on the user interface in near real time. If below min or above max, every interval it calls the effects of it for hunger, thirst and stress, the same way as described above. On default: thirst is reduced by 2, hunger is reduced by 2 and stress is increased by 2.
ALL TEMPERATURE BOUNDS IN THE CONFIG FILE MUST BE IN CELSIUS! DO NOT WORRY, IF PLAYERS HAVE FAHRENHEIT SELECTED IN GAME SETTINGS AS TEMP SYSTEM, IT WILL CONVERT FOR THEM.
Stress System
Within the config file, there is a table called Config.Stress.
Config.Stress = {
Horse = { -- Horse Stress
Enabled = true, -- Enable Horse Stress
Interval = 1, -- Stress Increase Interval (Seconds)
Speed = 20, -- Speed(MPH) of the horse when to increase stress. When it is greater or equal too..
Chance = 70, -- Chance of stress increase (1-100)%
Increase = 0.2, -- Stress Increase
},
WhitelistedJobs = { -- Jobs which do not take stress
["police"] = true,
["doctor"] = true
},
WhitelistedGroups = { -- Character groups which do not take stress
["example1"] = true,
},
Shooting = { -- Shooting Stress (Runs every 0-100ms REQUIRED TO DETECT)
Enabled = true, -- Enable Shooting Stress
Chance = 10, -- Chance of stress increase (1-100)%
Increase = 1, -- Stress Increase
},
MinimumStress = 50, -- Minimum Stress Level For Screen Shaking/ Blacking out (Blackout only when stress is 100)
Intensity = { -- Stress Intensity: Screen Shaking
[1] = {min = 50, max = 60, intensity = 0.12},
[2] = {min = 60, max = 70, intensity = 0.17},
[3] = {min = 70, max = 80, intensity = 0.22},
[4] = {min = 80, max = 90, intensity = 0.28},
[5] = {min = 90, max = 100, intensity = 0.32}
},
EffectInterval = { -- Stress Effect Interval: How often the screen shakes
[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)}
}
}
Stress increases when player is seen riding a horse at a fast speed or shooting. Each one or both can be disabled if you want.
For when stress is above a certain amount, it causes screen to blackout and shake. This idea was inspired by qb-hud.
Set certain jobs like police and doctors not to gain stress.
Health System
Config.Health = { -- Health Changes (Health is out of 100)
Time = 5, -- Seconds every update (Recommended: 5)
Effect = -8, -- Health Decrease every update if conditions are met below
Hunger = { -- Food Health Changes
Min = 0, -- Minimum Food Level
},
Thirst = { -- Water Health Changes
Min = 0, -- Minimum Water Level
},
Temperature = { -- Temperature Health Changes
Min = -12, -- Minimum Temperature
Max = 50, -- Maximum Temperature
},
}
Make sure the Config.Health.Time < Config.UpdateInterval.Time. If hunger or thirst is at minimum, the health decreases every Time. Same goes for the temperature bounds.
Metabolism System
-- Metabolism is between -1000(skinny) to 1000(fat), 0 is normal and default for new character.
Config.Metabolism = {
Time = 5, -- Check interval (Seconds)
Running = -0.5, -- How much to increase (Decrease if negative) the metabolism when running
notRunning = -0.2, -- How much to increase (Decrease if negative) the metabolism when not running
}
Metabolism is between -1000 to 1000 where...
-1000 = skinny
0 = Normal (Default)
1000 = Fat
You have options to decide what you want to happen when player is running or not, makes sense to decrease hence negative.
For food metabolism, we recommend you use ez_consumables or other.
STEP 3 [Optional] - Update Respawn Player
For VORP, when player respawns, it gets full hunger and thirst. You may update the function so that it removes any stress from the player.
In vorp_core/client/respawnsystem.lua, update the following function...
function CoreAction.Player.RespawnPlayer(allowCleanItems)
if allowCleanItems then
TriggerServerEvent("vorp:PlayerForceRespawn") -- inventory clean items
end
TriggerEvent("vorp:PlayerForceRespawn") -- inventory dead handler and metabolism , this need to be changed to the new events
local closestDistance = math.huge
local closestLocation = ""
local coords = nil
local pedCoords = GetEntityCoords(PlayerPedId())
for key, location in pairs(Config.Hospitals) do
local locationCoords = vector3(location.pos.x, location.pos.y, location.pos.z)
local currentDistance = #(pedCoords - locationCoords)
if currentDistance < closestDistance then
closestDistance = currentDistance
closestLocation = location.name
coords = location.pos
end
end
TriggerEvent("vorpmetabolism:changeValue", "Thirst", 1000)
TriggerEvent("vorpmetabolism:changeValue", "Hunger", 1000)
TriggerEvent("vorpmetabolism:changeValue", "Stress", -1000)
CoreAction.Player.ResurrectPlayer(coords, closestLocation, false) -- no need to trigger events repawns even already triggered
end