Skip to content

Commit

Permalink
Merge branch 'main' into alert-autofix-569
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator authored Dec 8, 2024
2 parents bf16aa9 + 9cad1d9 commit b003e7c
Show file tree
Hide file tree
Showing 95 changed files with 10,765 additions and 666 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
# EMPIRETOWN

![](https://img.shields.io/github/downloads/bitpredator/empiretown/total?logo=github)
![](https://img.shields.io/github/downloads/bitpredator/empiretown/latest/total?logo=github)
![](https://img.shields.io/github/contributors/bitpredator/empiretown?logo=github)
![](https://img.shields.io/github/v/release/bitpredator/empiretown?logo=github)

This program is a project for the fivem community, you have legal permission to distribute and / or modify it .
Source code of my Fivem Empiretown server, this server aims to simulate real life as much as possible.

ATTENTION: You are not authorized to change the name of the resources present within it.
# ATTENTION:
You are not authorized to sell this software this is a free and open source project, if you want to contribute to it feel free to fork and forward your pull requests, report any bugs or improvements to be made.
You can use this software as the basis for your fivem server and customize it as you see fit.

Database Installation: https://bitpredator.github.io/bptdevelopment/docs/empiretown/database

Server installation procedure: https://bitpredator.github.io/bptdevelopment/docs/empiretown/install-server

You are not authorized to sell this software (this is a free project).
This program is distributed in the hope that it will be useful, WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
You should have received a copy of the GNU General Public License with this program. If not, see http://www.gnu.org/licenses/.

### 📌 License

Expand Down
18 changes: 10 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"devDependencies": {
"eslint": "^9.15.0"
"eslint": "^9.16.0"
},
"dependencies": {
"dompurify": "^3.2.1"
Expand Down
Binary file added server-data/empiretown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions server-data/resources/[bpt_addons]/bpt_hud/client/carhud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ CreateThread(function()

-- Display Location and time when in any vehicle or on foot (if enabled)
if pedInVeh or locationAlwaysOn then
-- Get time and display
DrawTxt(timeText, 4, locationColorText, 0.4, screenPosX, screenPosY + 0.048)

-- Display remainder of HUD when engine is on and vehicle is not a bicycle
local vehicleClass = GetVehicleClass(vehicle)
if pedInVeh and GetIsVehicleEngineRunning(vehicle) and vehicleClass ~= 13 then
Expand Down
135 changes: 135 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_hud/client/hud.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
ESX = exports["es_extended"]:getSharedObject()
PlayerData = {}

local ShowHUD = true
HUD = {}


RegisterNetEvent("esx:playerLoaded")
AddEventHandler("esx:playerLoaded", function(xPlayer)
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer

Cash = ESX.PlayerData.money
end)

RegisterNetEvent("esx:playerLoaded")
AddEventHandler("esx:playerLoaded", function(xPlayer)
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer

Cash = ESX.PlayerData.money

PlayerData = xPlayer
if PlayerData.job.grade_name == "boss" then
Boss = true
else
Boss = false
end
end)

function Roundxx(num, numDecimalPlaces)
local mult = 10 ^ (numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end

function DrawRct2(x, y, width, height, r, g, b, a)
DrawRect(x + width / 4, y + height / 1, width, height, r, g, b, a)
end

function DrawTxt3(x, y, width, height, scale, text, r, g, b, a)
SetTextFont(6)
SetTextProportional(0)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x - width / 5.5, y - height / 20000)
end

RegisterNetEvent("sendWeight")
AddEventHandler("sendWeight", function(mm)
Weight = mm
end)

RegisterNetEvent("showhud:toggle")
AddEventHandler("showhud:toggle", function(m)
ShowHUD = m
end)

local rdy = true
function ShowHud()
ShowHUD = not ShowHUD
end

RegisterNetEvent("esx:playerLoaded")
AddEventHandler("esx:playerLoaded", function()
rdy = true
end)

local faimVal = 0
local soifVal = 0
Citizen.CreateThread(function()
while true do
Citizen.Wait(5000)

TriggerEvent("bpt_status:getStatus", "hunger", function(status)
faimVal = status.val / 1000000 * 100
end)
TriggerEvent("bpt_status:getStatus", "thirst", function(status)
soifVal = status.val / 1000000 * 100
end)
end
end)

Citizen.CreateThread(function()
Hea = 200
while true do
Citizen.Wait(0)
if rdy then
if ShowHUD then
local myPed = GetPlayerPed(-1)
local veh = GetVehiclePedIsIn(myPed, true)
local health = GetEntityHealth(myPed) - 100
local armor = GetPedArmour(myPed)
local vitesse = GetEntitySpeed(veh) * 3.6
local plate = GetVehicleNumberPlateText(veh)
if health < 0 then
health = GetEntityHealth(myPed)
end
local armor = GetPedArmour(myPed)
DrawTxt3(0.200, 0.963, 1.0, 1.0, 0.40, "" .. "❤️", 255, 255, 255, 255) -- -20
DrawTxt3(0.220, 0.963, 1.0, 1.0, 0.50, "" .. math.ceil(health) .. "", 255, 255, 255, 255)

DrawTxt3(0.250, 0.963, 1.0, 1.0, 0.40, "" .. "🛡", 255, 255, 255, 255)
DrawTxt3(0.270, 0.963, 1.0, 1.0, 0.50, "" .. math.ceil(armor) .. "", 255, 255, 255, 255)

DrawTxt3(0.290, 0.963, 1.0, 1.0, 0.40, "" .. "🍔", 255, 255, 255, 255)
DrawTxt3(0.310, 0.963, 1.0, 1.0, 0.50, "" .. math.ceil(faimVal) .. "", 255, 255, 255, 255)

DrawTxt3(0.330, 0.963, 1.0, 1.0, 0.40, "" .. "🥤", 255, 255, 255, 255)
DrawTxt3(0.350, 0.963, 1.0, 1.0, 0.50, "" .. math.ceil(soifVal) .. "", 255, 255, 255, 255)
end
end
end
end)

function DrawTxt(text, font, centre, x, y, scale, r, g, b, a)
SetTextFont(font)
SetTextProportional(false)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow(0)
SetTextOutline(0)
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x, y)
end

SendNUIMessage({ hud = ShowHUD })
35 changes: 0 additions & 35 deletions server-data/resources/[bpt_addons]/bpt_hud/client/status.lua

This file was deleted.

3 changes: 0 additions & 3 deletions server-data/resources/[bpt_addons]/bpt_hud/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ ui_page("html/ui.html")
shared_script("@es_extended/imports.lua")

files({
"html/*.css",
"html/*.js",
"html/*.png",
"html/ui.html",
})

client_scripts({
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b003e7c

Please sign in to comment.