cleopatra Posted December 30, 2018 Posted December 30, 2018 MTA Lua Custom Data System What is this?: MTA's own functions create a high of cpu and high of usage ram. Therefore I keep the element data with the table system. How can I use?: sync_element.lua paste to the file script you want to use, Then add meta.xml: <script src='sync_element.lua' type='shared' /> Note: You can only return data from scripts where you use the library. Download Link: Download Here - GitHub 1 1 1
Tony Brand Posted December 30, 2018 Posted December 30, 2018 it is great bro but can you add some examples too?
cleopatra Posted December 30, 2018 Author Posted December 30, 2018 (edited) First download the script and open files, find the files: sync_element.lua And import the your third party resource, then use: getElementData(element, data, value) setElementData(element, data, value) removeElementData(element, data, value) or you can use export: exports.custom_data:getElementData(element, data, value) exports.custom_data:setElementData(element, data, value) exports.custom_data:removeElementData(element, data, value) Edited December 30, 2018 by yourpalenes 1
AlexRazor Posted January 6, 2019 Posted January 6, 2019 Any exapmles with performance before and after?
[IR-DK] Mr Player Posted January 11, 2019 Posted January 11, 2019 Can i use this method for save the players money and skin and .... ??
cleopatra Posted February 5, 2019 Author Posted February 5, 2019 (edited) function getPlayerMoney(player) return exports.custom_data:getElementData(player, "money") end function setPlayerMoney(player, value) return exports.custom_data:setElementData(player, "money", value) end Edited February 5, 2019 by yourpalenes
Moderators Patrick Posted August 19, 2020 Moderators Posted August 19, 2020 The repository is no longer available. I'm gonna close this thread to avoid future inconveniences/bumps. @yourpalenes Please send me a private message, if you want to reopen it, thanks.
Recommended Posts