Skip to content

Commit

Permalink
own
Browse files Browse the repository at this point in the history
  • Loading branch information
1nexis committed Oct 22, 2023
1 parent bcc1e87 commit 39c4d6a
Show file tree
Hide file tree
Showing 37 changed files with 3,070 additions and 1,762 deletions.
5 changes: 0 additions & 5 deletions [core]/es_extended/client/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ end)
if GetResourceState('ox_inventory') ~= 'missing' then
Config.OxInventory = true
end

AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
203 changes: 101 additions & 102 deletions [core]/es_extended/client/functions.lua

Large diffs are not rendered by default.

73 changes: 36 additions & 37 deletions [core]/es_extended/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,10 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
end

local playerId = PlayerId()
local metadata = ESX.PlayerData.metadata
if metadata.health then
SetEntityHealth(ESX.PlayerData.ped, metadata.health)
end

if metadata.armor and metadata.armor > 0 then
SetPedArmour(ESX.PlayerData.ped, metadata.armor)
end

-- RemoveHudComponents
for i = 1, #(Config.RemoveHudComponents) do
if Config.RemoveHudComponents[i] then

-- RemoveHudCommonents
for i = 1, #(Config.RemoveHudCommonents) do
if Config.RemoveHudCommonents[i] then
SetHudComponentPosition(i, 999999.0, 999999.0)
end
end
Expand All @@ -92,15 +84,11 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
end)
end

if Config.DisableHealthRegeneration then
SetPlayerHealthRechargeMultiplier(playerId, 0.0)
end

if Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then
if Config.DisableHealthRegeneration or Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then
CreateThread(function()
while true do
if Config.DisableDisplayAmmo then
DisplayAmmoThisFrame(false)
if Config.DisableHealthRegeneration then
SetPlayerHealthRechargeMultiplier(playerId, 0.0)
end

if Config.DisableWeaponWheel then
Expand Down Expand Up @@ -343,7 +331,7 @@ if not Config.OxInventory then
end)

RegisterNetEvent('esx:removeWeapon')
AddEventHandler('esx:removeWeapon', function()
AddEventHandler('esx:removeWeapon', function(weapon)
print("[^1ERROR^7] event ^5'esx:removeWeapon'^7 Has Been Removed. Please use ^5xPlayer.removeWeapon^7 Instead!")
end)

Expand All @@ -361,7 +349,7 @@ end)

if not Config.OxInventory then
RegisterNetEvent('esx:createPickup')
AddEventHandler('esx:createPickup', function(pickupId, label, coords, itemType, name, components, tintIndex)
AddEventHandler('esx:createPickup', function(pickupId, label, coords, type, name, components, tintIndex)
local function setObjectProperties(object)
SetEntityAsMissionEntity(object, true, false)
PlaceObjectOnGroundProperly(object)
Expand All @@ -372,11 +360,11 @@ if not Config.OxInventory then
obj = object,
label = label,
inRange = false,
coords = coords
coords = vector3(coords.x, coords.y, coords.z)
}
end

if itemType == 'item_weapon' then
if type == 'item_weapon' then
local weaponHash = joaat(name)
ESX.Streaming.RequestWeaponAsset(weaponHash)
local pickupObject = CreateWeaponObject(weaponHash, 50, coords.x, coords.y, coords.z, true, 1.0, 0)
Expand All @@ -396,7 +384,7 @@ if not Config.OxInventory then
RegisterNetEvent('esx:createMissingPickups')
AddEventHandler('esx:createMissingPickups', function(missingPickups)
for pickupId, pickup in pairs(missingPickups) do
TriggerEvent('esx:createPickup', pickupId, pickup.label, vector3(pickup.coords.x, pickup.coords.y, pickup.coords.z - 1.0), pickup.type, pickup.name
TriggerEvent('esx:createPickup', pickupId, pickup.label, pickup.coords - vector3(0, 0, 1.0), pickup.type, pickup.name
, pickup.components, pickup.tintIndex)
end
end)
Expand Down Expand Up @@ -515,7 +503,7 @@ if not Config.OxInventory then
end)
end

----- Admin commands from esx_adminplus
----- Admin commnads from esx_adminplus

RegisterNetEvent("esx:tpm")
AddEventHandler("esx:tpm", function()
Expand Down Expand Up @@ -667,7 +655,7 @@ AddEventHandler("esx:noclip", function()
CreateThread(noclipThread)
end

ESX.ShowNotification(TranslateCap('noclip_message', noclip and Translate('enabled') or Translate('disabled')), true, false, 140)
ESX.ShowNotification(TranslateCap('noclip_message', noclip and "enabled" or "disabled"), true, false, 140)
end)
end)

Expand All @@ -676,16 +664,6 @@ AddEventHandler("esx:killPlayer", function()
SetEntityHealth(ESX.PlayerData.ped, 0)
end)

RegisterNetEvent("esx:repairPedVehicle")
AddEventHandler("esx:repairPedVehicle", function()
local ped = ESX.PlayerData.ped
local vehicle = GetVehiclePedIsIn(ped, false)
SetVehicleEngineHealth(vehicle, 1000)
SetVehicleEngineOn(vehicle, true, true)
SetVehicleFixed(vehicle)
SetVehicleDirtLevel(vehicle, 0)
end)

RegisterNetEvent("esx:freezePlayer")
AddEventHandler("esx:freezePlayer", function(input)
local player = PlayerId()
Expand All @@ -704,6 +682,27 @@ ESX.RegisterClientCallback("esx:GetVehicleType", function(cb, model)
cb(ESX.GetVehicleType(model))
end)

AddStateBagChangeHandler('metadata', 'player:' .. tostring(GetPlayerServerId(PlayerId())), function(_, key, val)
local DoNotUse = {
'essentialmode',
'es_admin2',
'basic-gamemode',
'mapmanager',
'fivem-map-skater',
'fivem-map-hipster',
'qb-core',
'default_spawnpoint',
}

for i = 1, #DoNotUse do
if GetResourceState(DoNotUse[i]) == 'started' or GetResourceState(DoNotUse[i]) == 'starting' then
print("[^1ERROR^7] YOU ARE USING A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5" .. DoNotUse[i] .. "^7")
end
end

RegisterNetEvent('esx:updatePlayerData', function(key, val)
ESX.SetPlayerData(key, val)
end)

AddEventHandler("esx:getSharedObject", function(cb)
cb(ESX)
end)
6 changes: 1 addition & 5 deletions [core]/es_extended/client/modules/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ local function GetData(vehicle)
end
local model = GetEntityModel(vehicle)
local displayName = GetDisplayNameFromVehicleModel(model)
local netId = vehicle
if NetworkGetEntityIsNetworked(vehicle) then
netId = VehToNet(vehicle)
end
local netId = VehToNet(vehicle)
return displayName, netId
end

CreateThread(function()
while true do
ESX.SetPlayerData('coords',GetEntityCoords(playerPed))
if playerPed ~= PlayerPedId() then
playerPed = PlayerPedId()
ESX.SetPlayerData('ped', playerPed)
Expand Down
6 changes: 4 additions & 2 deletions [core]/es_extended/config.logs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ Config.DiscordLogs = {
default = '',
test = '',
Chat = '',
UserActions = '',
UserActions = 'https://discord.com/api/webhooks/1128002948014817450/nc068--kUU-sropH7XfcJUhz6Klj5YCm9klhGRLQepqaWlVgpRud6dqoysLQs_3valqy',
Resources = '',
Paycheck = ''
Paycheck = '',
TXUnbans = 'https://discord.com/api/webhooks/1139944266047692860/AhwNRPrfs8lSpa3FB1kkG6UJTDdI_I8x0WE6cOFwDJkg8zWiV_Xt7I0h2ZlM3rfMDxoF',
Keys = 'https://discord.com/api/webhooks/937401687868604456/xEO7Hj_SEC_Q81Px6dlfQ9C-DNwjveJujzY8wRS0NAJ1nDTmMd6Uq4mZS2hCI_4rYuhx',
},

Colors = { -- https://www.spycolor.com/
Expand Down
32 changes: 16 additions & 16 deletions [core]/es_extended/config.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Config = {}
Config.Locale = GetConvar('esx:locale', 'en')
Config.Locale = GetConvar('esx:locale', 'de')

Config.Accounts = {
bank = {
Expand All @@ -18,37 +18,38 @@ Config.Accounts = {

Config.StartingAccountMoney = { bank = 50000 }

Config.StartingInventoryItems = false -- table/false

Config.DefaultSpawns = { -- If you want to have more spawn positions and select them randomly uncomment commented code or add more locations
{ x = 222.2027, y = -864.0162, z = 30.2922, heading = 1.0 },
{ x = -269.4, y = -955.3, z = 31.2, heading = 205.8 },
--{x = 224.9865, y = -865.0871, z = 30.2922, heading = 1.0},
--{x = 227.8436, y = -866.0400, z = 30.2922, heading = 1.0},
--{x = 230.6051, y = -867.1450, z = 30.2922, heading = 1.0},
--{x = 233.5459, y = -868.2626, z = 30.2922, heading = 1.0}
}

Config.AdminGroups = {
['owner'] = true,
['admin'] = true
['projektleitung'] = true,
['entwickler'] = true,
['super_admin'] = true,
['admin'] = true,
}


Config.EnablePaycheck = true -- enable paycheck
Config.LogPaycheck = false -- Logs paychecks to a nominated Discord channel via webhook (default is false)
Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society
Config.MaxWeight = 24 -- the max inventory weight without backpack
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
Config.MaxWeight = 200 -- the max inventory weight without backpack
Config.PaycheckInterval = 60 * 60000 -- how often to recieve pay checks in milliseconds
Config.EnableDebug = false -- Use Debug options?
Config.EnableDefaultInventory = true -- Display the default Inventory ( F2 )
Config.EnableDefaultInventory = false -- Display the default Inventory ( F2 )
Config.EnableWantedLevel = false -- Use Normal GTA wanted Level?
Config.EnablePVP = true -- Allow Player to player combat

Config.Multichar = GetResourceState("esx_multicharacter") ~= "missing"
Config.Multichar = true
Config.Identity = true -- Select a characters identity data before they have loaded in (this happens by default with multichar)
Config.DistanceGive = 4.0 -- Max distance when giving items, weapons etc.

Config.AdminLogging = false -- Logs the usage of certain commands by those with group.admin ace permissions (default is false)
Config.AdminLogging = true -- Logs the usage of certain commands by those with group.admin ace permissions (default is false)

Config.DisableHealthRegeneration = false -- Player will no longer regenerate health
Config.DisableVehicleRewards = false -- Disables Player Recieving weapons from vehicles
Expand All @@ -57,9 +58,8 @@ Config.DisableDispatchServices = false -- Disable Dispatch services
Config.DisableScenarios = false -- Disable Scenarios
Config.DisableWeaponWheel = false -- Disables default weapon wheel
Config.DisableAimAssist = false -- disables AIM assist (mainly on controllers)
Config.DisableVehicleSeatShuff = false -- Disables vehicle seat shuff
Config.DisableDisplayAmmo = false -- Disable ammunition display
Config.RemoveHudComponents = {
Config.DisableVehicleSeatShuff = true -- Disables vehicle seat shuff
Config.RemoveHudCommonents = {
[1] = false, --WANTED_STARS,
[2] = false, --WEAPON_ICON
[3] = false, --CASH
Expand All @@ -68,7 +68,7 @@ Config.RemoveHudComponents = {
[6] = false, --VEHICLE_NAME
[7] = false, -- AREA_NAME
[8] = false, -- VEHICLE_CLASS
[9] = false, --STREET_NAME
[9] = true, --STREET_NAME
[10] = false, --HELP_TEXT
[11] = false, --FLOATING_HELP_TEXT_1
[12] = false, --FLOATING_HELP_TEXT_2
Expand All @@ -84,8 +84,8 @@ Config.RemoveHudComponents = {
[22] = false, --HUD_WEAPONS
}

Config.SpawnVehMaxUpgrades = true -- admin vehicles spawn with max vehcle settings
Config.CustomAIPlates = '........' -- Custom plates for AI vehicles
Config.SpawnVehMaxUpgrades = false -- admin vehicles spawn with max vehcle settings
Config.CustomAIPlates = 'AAA 111' -- Custom plates for AI vehicles
-- Pattern string format
--1 will lead to a random number from 0-9.
--A will lead to a random letter from A-Z.
Expand Down
Loading

0 comments on commit 39c4d6a

Please sign in to comment.