Jump to content
Alloder.pro: about Allods with love
Search In
  • More options...
Find results that contain...
Find results in...

New program for writers

We turn from quantity to quality and tell you how we will supplement the Allods Team program with rewards in rubles.

More

The new Updater

Let us to introduce the new addon updater software and to share the details

Read more

Alloder 2.0

We have started the process of project evolve, and this relates not only, and not even primarily of the site's view

Read more

Сохранение и загрузка данных


Guest telsor
 Share

Recommended Posts

Guest telsor

Всем доброго времени суток).

Собственно сабж. Как в аддоне сохранять и затем загружать данные? Как я понимаю, стандартные функции lua для работы с файлами в аддонах не работают.

common.LogInfo не предлагать)

Link to comment
Share on other sites

/Allods Online/data/Mods/Docs/Modding Docs 120222/LuaApi/CategoryConfig.html

FunctionUserModsGetAvatarConfigSection

FunctionUserModsGetGlobalConfigSection

FunctionUserModsSetAvatarConfigSection

FunctionUserModsSetGlobalConfigSection

Пример:

Code:

local config = userMods.GetAvatarConfigSection( common.GetAddonName() ) or {}

if config and config.size then

local wPos = wTarget:GetPlacementPlain()

wPos.sizeX, wPos.sizeY = config.size, config.size

wTarget:SetPlacementPlain(wPos)

end

function Command(param)

local a, b, size = string.find( userMods.FromWString( param.text ), "/setsize (%d+)" )

if size == nil then a, b, size = string.find( userMods.FromWString( param.text ), "/ыуеышяу (%d+)" ) end

if size ~= nil then 

local wPos = wTarget:GetPlacementPlain()

wPos.sizeX, wPos.sizeY = tonumber(size), tonumber(size)

wTarget:SetPlacementPlain(wPos)

config.size = tonumber(size)

userMods.SetAvatarConfigSection( common.GetAddonName(), config )

end

end

common.RegisterEventHandler( Command, "EVENT_UNKNOWN_SLASH_COMMAND" )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use