<?xml version="1.0" encoding="UTF-8"?>
<mod name="command-save" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
<config name="command-save-config"><![CDATA[
exhaust = 3 -- in minutes
storage = 3003 -- storage value used to save exhaustion
]]></config>
<talkaction words="!save" event="script"><![CDATA[
domodlib('command-save-config')
local config = {
exhaustion = exhaust,
storage = storage
}
function onSay(cid, words, param, channel)
if(exhaustion.check(cid, config.storage)) then
doPlayerSendCancel(cid, "You can save yourself only once per " .. config.exhaustion .. " minutes.")
return true
end
if(doPlayerSave(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your character has been succesfully saved.")
exhaustion.set(cid, config.storage, config.exhaustion * 60)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error while saving your character. Please try again later.")
end
return true
end
]]></talkaction>
</mod>