example
example

已解决√ 求助 求一些好看的进度条和好点的毒品

在论坛自行搜索,有很多
 
可以的話,發sever和client的代碼 這個只是getSharedObject新版不支持,改一下就好了。
想自己修可以看看論壇,我記得有人有發
 

esx:getSharedObject Deprecation​

Hello! This Event has been in ESX for around 5 years and should no longer be used since we now have way better ways to import the ESX object into your script!

Import​

The import can be used by simply adding this into the :fxmanifest.lua

shared_script '@es_extended/imports.lua'


The import is the best and recommended way to use ESX within a script, this is because it will automatically sync data between ESX and the script, meaing the script will have automatic knowlege of ESX.PlayerData aswell as if you are loaded in aswell as the ability to detect when you are Relogging and/or switching characters, meaning no vulnerable events needed, to having to grab the entire playerdata table every time you want to use it, its just there, and working and amazing.

Export​

The Export can be simply used by doing:

ESX = exports["es_extended"]:getSharedObject()


This Is great if your working on a multi-framework script so that the user does not have to change anything to switch between the frameworks. It Also has the benifit of not requiring you to wait into it has recived the object and prevents Race conditions.

Example​

We will show how exactly this is done in the following example. I don't recommend this script to anyone, but we'll show it anyway.

We will demonstrate this on the deprecated esx_communityservice.

Import​

First, we will show the recommended and most advantageous method, the import method.

Delete lines and -> from the file.132833client/main.lua

ESX = nil

Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)


Subsequently, we will also remove the lines and from the .13server/main.lua

ESX = nil

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)


We then import the es_extended tables into the resource. This Can be done by adding the follow line into the or the :fxmanifest.lua__resource.lua

shared_script '@es_extended/imports.lua'


Export​

As the second and last option, we will show the export method. We will again delete the same lines from the client and server file as the method above.import

However, unlike the import, we now export the ESX table into our resource. We add this export to the very beginning of the and the .client/main.luaserver/main.lua

ESX = exports["es_extended"]:getSharedObject()
 
你發一下sever跟client吧

前面一段部分代碼就好了,很多時候需要按照原有代碼去修改
不能只根據官方文檔
 
3508
關於下方的esx_illegal,我認為也是getshart0bject的問題,上面修好下面因該也好了。
 
浏览附件3508加了个毒品这样报错怎么修 站长
 
后退
顶部