Giter Site home page Giter Site logo

esx-framework / esx_core Goto Github PK

View Code? Open in Web Editor NEW
335.0 15.0 734.0 31.6 MB

Official Repo For core resources for esx-legacy

Home Page: https://documentation.esx-framework.org/

License: GNU General Public License v3.0

Lua 91.25% CSS 1.70% JavaScript 4.38% HTML 2.67%
fivem esx-framework grandtheftauto5 roleplay esx core lua server rp

esx_core's Introduction

ESX Legacy

Discord - Website - Documentation

Want more resources? You can browse the Cfx.re Releases board for more!

ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM


💗 Supporters

Interested in helping us? Take a look at our patreon

We would like to sincerely thank the following donors who helped fund the development of ESX.
Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong
Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol
Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum
CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community


Legal Notices

ESX Core (ESX-legacy)

Copyright (C) 2015-2024 ESX-Framework

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

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 https://www.gnu.org/licenses/

Powered by Oxygenserv

esx_core's People

Contributors

adrinex avatar arctos2win avatar arkseyonet avatar benzo00 avatar bitpredator avatar csokihun avatar ddh3 avatar egultratm avatar elpumpo avatar fiveeyz avatar gellipapa avatar hariboinc avatar indilo53 avatar itschip avatar jackdupmodz avatar majormarcin avatar moskalyka avatar mycroft-studios avatar nearbyplayer avatar rav3n95 avatar renaiku avatar rex2630 avatar rikodev avatar roadtosixx avatar romainlanz avatar taavi-au avatar thefantomas avatar thefourcraft avatar thekuca avatar thelindat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esx_core's Issues

esx society

problem is..

reproduce the problem : when you set job boss on ambulance and other boss and employee list see each other every department .... is not seperated each society like mechanic , police , ambulance

Rules about issues!

Hi, thanks for helping our community by reporting issues!

Please follow our guidelines:

  • Only post issues that you're having while using the newest version of ESX Legacy and its components. Make sure your changes haven't caused the error.
  • Make sure your database is connected and functioning properly.
  • Make sure this issue hasn't already been posted, duplicate issues cause delays.
  • Provide any other evidence you have: screenshots of errors, what caused the error, etc.

Thanks,

The ESX Team

Problem with esx_datastore

I can't get the Clothing to save in the Database Permanetly. If i delete the clothing from the datastore_data and restart esx_clotheshop it temporarily saves an i can acces it for the session but if i restart it isn't there anymore. If i try to save it again it give this error. I did everything as discribed.

[script:esx_datastore] SCRIPT ERROR: @esx_datastore/server/classes/datastore.lua:25: attempt to index a string value (upvalue 'data')
[script:esx_datastore] > ref (@esx_datastore/server/classes/datastore.lua:25)
[script:esx_datastore] > ref (@esx_accessories/server/main.lua:15)
[script:esx_datastore] > handler (@esx_datastore/server/main.lua:58)
[script:esx_datastore] > handler (@esx_accessories/server/main.lua:14)
[script:esx_datastore] SCRIPT ERROR: error object is not a string


@esx_datastore/server/classes/datastore.lua:24-27:

24 self.set = function(key, val)
25 data[key] = val
26 self.save()
27 end

@esx_accessories/server/main.lua:14-24)

14 TriggerEvent('esx_datastore:getDataStore', 'user_' .. string.lower(accessory), xPlayer.identifier, function(store)
15 store.set('has' .. accessory, true)
16
17 local itemSkin = {}
18 local item1 = string.lower(accessory) .. '_1'
19 local item2 = string.lower(accessory) .. '_2'
20 itemSkin[item1] = skin[item1]
21 itemSkin[item2] = skin[item2]
22
23 store.set('skin', itemSkin)
24 end)

@esx_datastore/server/main.lua:58

58 AddEventHandler('esx_datastore:getDataStore', function(name, owner, cb)
59 cb(GetDataStore(name, owner))
60 end)

You'll probably hate me because I pasted the code in that way

If you need anymore infos i can give it to ya hopefully.

Database Error from es_extended query

Describe the bug
A database error on player login is produced to the console.

To Reproduce
Start the server and login.

Screenshots / Logs

[      script:hardcap] Connecting: x0Z3ro0x
[txAdmin:WebCtxUtils] [x0Z3ro0x] logged in via in-game ui
[  script:mysql-async] [MariaDB:10.6.5-MariaDB] [es_extended] [1ms] SELECT 1 FROM users WHERE identifier = 'EDITED'
[  script:es_extended] [INFO]  Player 1 Has been granted admin permissions via Ace Perms.
[  script:es_extended] SCRIPT ERROR: @mysql-async/lib/MySQL.lua:132: The SQL Query must be a string
[  script:es_extended] > execute (@mysql-async/lib/MySQL.lua:132)
[  script:es_extended] > createESXPlayer (@es_extended/server/main.lua:80)
[  script:es_extended] > ref (@es_extended/server/main.lua:57)
[  script:es_extended] > <unknown> (@mysql-async/mysql-async.js:15916)
[  script:mysql-async]

Software:

  • OS: Windows Server 2019
  • Version of the resource: Master Clone as of Yesterday Jan. 13th at 3pm.
  • Database Version MariaDB 10.6.5 (Also tried this on MySQL 8)

Additional context
I am able to change the error when I change my connection string. For example, if I use my old connection string from years ago, I can change the error into the following -

[      script:hardcap] Connecting: x0Z3ro0x
[txAdmin:WebCtxUtils] [x0Z3ro0x] logged in via in-game ui
[  script:mysql-async] SCRIPT ERROR in call ref: TypeError: Cannot read properties of null (reading 'execute')
[  script:mysql-async] > Object.callback (@mysql-async/mysql-async.js:5144)
[  script:mysql-async] > fetchScalar (@mysql-async/lib/MySQL.lua:161)
[  script:mysql-async] > onPlayerJoined (@es_extended/server/main.lua:52)
[  script:mysql-async] > handler (@es_extended/server/main.lua:41)
[  script:mysql-async]
[  script:es_extended] SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:841: An error occurred while calling export mysql_fetch_scalar of resource mysql-async
[  script:es_extended] nil
[  script:es_extended] (nil stack trace)[txAdmin:WebCtxUtils] x0Z3ro0x executing:  STOP SERVER
-> Quitting: Server shutting down (x0Z3ro0x).

[txAdmin:FXRunner] >> [9348] FXServer Exited.
[txAdmin:FXRunner] >> [9348] FXServer Closed. (code 1)

Following instructions and using the connection string in the server.cfg provided gives the error I reported above. I have other servers using the database without issue. I normally use MySQL, however I switched in an attempt to solve the error. It remained the same.

Here are those connection strings I mentioned:

Old one from years prior -

#set mysql_connection_string "server=localhost;port=EDITED;database=es_extended;userid=EDITED;password=EDITED;ssl=none;charset=utf8mb4"

Current one provided from this github -

set mysql_connection_string "mysql://EDITED:EDITED@localhost/es_extended?waitForConnections=true&charset=utf8mb4"

If I've left out something important, it wasn't on purpose. Let me know and I will be happy to provide a log / information.

esx_society

I got the error when trying to deposit/withdraw society money while use the oxmysql
s
.

error with mask

Hello,
I have a problem with esx_datastore and es_extended

Esx_datastore tell me:
SCRIPT ERROR: @esx_datastore/server/main.lua:36: attempt to get length of a nil value (field '?')

and es_extended tell me :
SCRIPT ERROR: error object is not a string

this message appear when i trying to remove a mask

esx_status server/main.lua FIX

Error: SCRIPT ERROR: @esx_status/server/main.lua:58: attempt to index a nil value (global 'status')

On line 56 Change

AddEventHandler('esx_status:getStatus', function(playerId, statusName, cb)
	for i=1, #ESX.Players, 1 do
		if status[i].name == statusName then
			cb(status[i])
			break
		end
	end
end)

to

AddEventHandler('esx_status:getStatus', function(playerId, statusName, cb)
	local xPlayer = ESX.GetPlayerFromId(playerId)
	local status = xPlayer.get('status')

	for i=1, #status, 1 do
		if status[i].name == statusName then
			cb(status[i])
			break
		end
	end
end)

Unless there is another way to get the status of a player but when i try to use esx_policejobs to check a player there error above is what i get.

[feat/bug] Death sync

Currently sync between clients entering an area on the esx_ambulancejob is an issue and has been for a long time, the current common fix is to rag doll a player every so often. Its gross, forcing a ped into an animation and setting invincible while disabling input seems to be done on qb and private frameworks. Requesting forcing animation be put in not as a feature but as a bug fix.

How to Remove Player name & ID above head?

I have looked through almost every file, and even downloaded a script to try and remove playernames and ids above there head, with no success. I was hoping someone could help me or guide me through these files to try remove that. Picture of my players for example. Any help would be great! Thank you
Desktop_Screenshot_2021 09 20_-_19 44 50 14

ESX Society

Can you add a security check at server main.lua if the player isBoss before withdrawing money, do be more modder save

Line 67
if xPlayer.job.name == society.name then

Like in 253ff

local isBoss = xPlayer.job.grade_name == 'boss'
	if isBoss then

		local xTarget = ESX.GetPlayerFromIdentifier(identifier)

Backpack iventory

with the legacy version , it have a way to add backpack weight , i know is enable into the esx2 but it is possible into the legacy one ?

thank you very much

esx status

[ script:esx_status] SCRIPT ERROR: @esx_status/server/main.lua:104: attempt to index a nil value (global 'Status')

Players Buying Things with $0

So, say a player has $20 and spends it at the 24/7. They then have $0 that player can still buy things but then just go into the negatives (Example: -$14) and why they die or leave it just goes back to 0 how can I fix this?

nill value "coords"

i have a problem where players spawn randomly on the map instead of last potition.
i get an error on f8 saying es_extended nill value "Coords" at line 26 if i can recall. i am not home right know but i will update.
any guess ? jsut noticed there is already a "issue report at #52. exact same problem. i guess it cant load coords and thats why i random spawn. maybe conected maybe not

ESX-Skin Menu Closing after Creating a Char

Hello,
So I have a Problem with the Skin Menu closing after making a Char, I dont know what happends and no error happen in the Console over txAdmin or F8. Also when trying to move it does not let you.
We are also using the Multi Char system from ESX-Leagcy

hm

Error in a script

Hello. I have a Error in the Script from es_extended i dont know where it comes from.

The error is:
SCRIPT ERROR: @es_extended/client/main.lua:26: attempt to index a nil value (field ‘coords’)

The Code from the Es_Extended:

RegisterNetEvent(‘esx:playerLoaded’)
AddEventHandler(‘esx:playerLoaded’, function(xPlayer, isNew, skin)
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer

FreezeEntityPosition(PlayerPedId(), true)

if Config.Multichar then
	Citizen.Wait(3000)
else
	exports.spawnmanager:spawnPlayer({
		x = ESX.PlayerData.coords.x,
		y = ESX.PlayerData.coords.y,
		z = ESX.PlayerData.coords.z + 0.25,
		heading = ESX.PlayerData.coords.heading,
		model = `mp_m_freemode_01`,
		skipFade = false
	}, function()
		TriggerServerEvent('esx:onPlayerSpawn')
		TriggerEvent('esx:onPlayerSpawn')
		TriggerEvent('playerSpawned') -- compatibility with old scripts
		TriggerEvent('esx:restoreLoadout')
		if isNew then
			if skin.sex == 0 then
				TriggerEvent('skinchanger:loadDefaultModel', true)
			else
				TriggerEvent('skinchanger:loadDefaultModel', false)
			end
		elseif skin then TriggerEvent('skinchanger:loadSkin', skin) end
		TriggerEvent('esx:loadingScreenOff')
		ShutdownLoadingScreen()
		ShutdownLoadingScreenNui()
		FreezeEntityPosition(ESX.PlayerData.ped, false)
	end)
end

In my SQL the Position is “null” and i dont know why. I think it is because the Position is null and idk why it doesnt overwrite the position.

ESX Basicneeds, the reset status function in "onPlayerSpawn" should not be used when spawned for the first time.

I ran into a problem, when first "spawned" if last game status dead is true when we enter game 2 it shouldn't reset status.
I am not good at English

I'll look at the code as an example.
File client/main.lua
Original

AddEventHandler('esx:onPlayerSpawn', function(spawn)
	if IsDead then
		TriggerEvent('esx_basicneeds:resetStatus')
	end

	IsDead = false
end)

Fix by my coding

local firstSpawn = true
AddEventHandler('esx:onPlayerSpawn', function()
	if(firstSpawn) then
		firstSpawn = false
		return
	end

	if (IsDead) then
		TriggerEvent('esx_basicneeds:resetStatus')
	end
	IsDead = false
end)

I hope this post is helpful.
and i newbie✌️😁

Money Hud

Every time i restart/reload into the server the money hud moves up and down so some times dirty money will be at the top

Admin Group order

Hi, my problem is that I want to create my own groups such as supporters or superadmin. But the problem is, when I give myself the group, the admin rank is always at the top. I would make it so that the top tier is superadmin and then admin and so on. but admin remains the highest rank all the time and I don't know how to change that ...

My Order that i want to have:
highest group:
superadmin
admin
mod
supporter
guide

The Order that i have now
highest group:
admin
...

I don't even know if supporter is higher than guide or the other way around

我有新的问题

我有一些问题需要您的帮助,您的脚本真是太赞了,在我安装脚本后,为什么我犯罪不被警察通缉?是我开启了那个插件导致的?希望能得到您的回复!谢谢

Attemt to nil value

Hello,

i installed the script and set up all Shops to false exepted the Truck-Shop.

When I try to start the script I get following error:
[script:esx_advancedv] SCRIPT ERROR: @esx_advancedvehicleshop/server/main.lua:52: attempt to call a nil value (global 'mysqlTruck')

When i´m activating the Boat-Shop and deactivate the Truckshop I´ll get the same error, just with the mysqlBoat

Can someone help me?

Troubleshooting ESX Legacy Addons

Describe the bug
New players are not given the esx_identity registration screen, or the esx_skin screen.

To Reproduce
Start the server and login as a new player with no database entry.

Screenshots / Logs
No errors are produced client or server side.

Software:
OS: Windows Server 2019
Version of the resource: Master Clone as of Jan. 13th at 3pm.
Database Version MariaDB 10.6.5

Additional context
Sadly I have no errors to provide making this harder to track down. When a new player logs into the server, they are placed at the job site as expected. However their mouse is stuck on the screen with no html window to register their name, age, etc.

Restarting the script esx_identity causes the html window to appear properly and then users can create their identity. However upon submitting, no skin window appears to then setup their character model. Restarting that along with the other resources that are shutdown as a result of the esx_skin restart, forces the esx_skin html window to popup for those new players and they can then create their skin.

I verified my load order to the letter. Aside from having extra startups, the orders are the exact same. Here is a copy -

# Server Prep

ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure rconlog
ensure scoreboard

ensure mysql-async
ensure cron
ensure skinchanger
ensure es_extended
ensure esx_menu_default
ensure esx_menu_dialog
ensure esx_menu_list
ensure esx_identity
ensure esx_skin

# ESX Scripts

#ensure esx_multicharacter   # es_extended requires Config.Multichar = true
ensure instance
ensure esx_rpchat
#ensure esx_phone
ensure esx_voice
ensure esx_sit
ensure esx_animations
ensure esx_addonaccount
ensure esx_addoninventory
ensure esx_datastore
#ensure esx_property
#ensure esx_garage
ensure esx_society
ensure esx_service
ensure esx_billing
ensure esx_license
ensure esx_dmvschool
ensure esx_status
ensure esx_basicneeds
ensure esx_optionalneeds
ensure esx_shops
ensure esx_weaponshop
ensure esx_clotheshop
ensure esx_barbershop
ensure esx_accessories
ensure esx_vehicleshop
#ensure esx_boat
ensure esx_jobs
ensure esx_joblisting
ensure esx_cruisecontrol
ensure esx_atm
#ensure esx_drugs
ensure esx_holdup
ensure esx_lscustom
#ensure esx_ambulancejob
#ensure esx_mechanicjob
#ensure esx_ambulancejob
#ensure esx_policejob
#ensure esx_bankerjob
#ensure esx_realestateagentjob
#ensure esx_taxijob
#ensure esx_whitelist

# Custom Scripts

#start DKGRP
start addon1
start addon2
start addon3
start addon4
start addon5
start addon6
start emergency
start nonemergency

Bug LSPD

Hello, we have a bug with esx_police addon. Indeed, when we are in LSPD job and we disconnect from server, when we re-connect to server we haven't access to interaction points in the commisariat and to F6 menu. However, we still have access to the LSPD business management menu from the F5 menu.

Old repositories and esx-legacy triage

@FuraXx Considering the point of this consolidated repo was to force people to use these files instead of the old ones (such as es_extended repo), perhaps make them private as planned? Causing way too much confusion and I need to direct people to download the correct version of Legacy.

Since txAdmin uses this repository and is against forking it for the official Plume recipe it may be a smart idea to let somebody you trust handle simple maintenance tasks - I have some things I'd like to fix for several resources and in ESX itself but getting anything merged will take a long time.

To clarify, anything that is a new feature should not and will not be accepted; this is solely for resolving bugs.

esx_holdup issue

esx_holdup dont works on this legacy esx version. i cant rob. no errors. no notify in circle that can rob this. cops set to 0 to test. same isue

Giving account money ox_inventory

I have a custom account setted up in es_extended/config.lua and when i do the command "giveaccountmoney" it gives me the account money but not the item in ox_inventory. When i do the command "giveitem [account name]" (already created the item and configured in ox_inventory/modules/bridge/server.lua as server account) it gives me the item and the account money...

ESX Shops

Can you add a security check at esx_shops:

Line 15ff

	-- get price
	local price = 0
	local itemLabel = ''

	for i=1, #Config.Zones[zone].Items, 1 do
		local item = Config.Zones[zone].Items[i]
		if item.name == itemName then
			price = item.price
			itemLabel = item.label
			break
		end
	end

	price = price * amount

If the shop does not sell an item, a modder can get any item with price 0

if itemLabel == '' then
	print('esx_shops: ' .. xPlayer.identifier .. ' attempted to exploit the shop!')
	return
end

esx_status (Wrong code)

Hi ,

Open esx_status/server/main.lua

in line 24 (esx_status:load event) How do you think data is transmitted?

AddEventHandler('onResourceStart', function(resourceName)
	if (GetCurrentResourceName() ~= resourceName) then
	  	return
	end
	
	for _, xPlayer in pairs(ESX.Players) do
		local status = xPlayer.get('status')
		if status then
			ESX.Players[xPlayer.source] = status
		else
			MySQL.Async.fetchAll('SELECT status FROM users WHERE identifier = @identifier', {
				['@identifier'] = xPlayer.identifier
			}, function(result)
				local data = {}
		
				if result[1].status then
					data = json.decode(result[1].status)
				end
			
				xPlayer.set('status', data)	-- save to xPlayer for compatibility
				ESX.Players[xPlayer.source] = data -- save locally for performance
			end)
		end
		TriggerClientEvent('esx_status:load', xPlayer.source, data)
	end
end)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.