• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Log in problem

LUA:
 exhaustion =
{
    check = function (cid, storage)
        if(getPlayerStorageValue(cid, storage) >= os.time(t)) then
            return TRUE
        end

        return FALSE
    end,

    get = function (cid, storage)
        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return FALSE
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return TRUE
        end

        return FALSE
    end
}

LUA:
 <?xml version="1.0" encoding="UTF-8"?>
<mod name="expscroll" author="C" enabled="yes">
    <config name="settings">
        <![CDATA[
            extraExp = 0.20 --extra exp rate percent
            storage = 4567
            time = 12 * 60 * 60 --how many seconds(current is 12hours)
        ]]>
    </config>
    <event type="login" name="scroll" event="script">
        <![CDATA[
            domodlib('settings')
            function onLogin(cid)
                if exhaustion.check(cid, storage) then
                    doPlayerSetExperienceRate(cid, 1+extraExp)
                end
                return true
            end
        ]]>
    </event>
    <action itemid="2110" event="script">
        <![CDATA[
            function onUse(cid, item, fromPosition, itemEx, toPosition)
                domodlib('settings')
                doRemoveItem(item.uid, 1)
                exhaustion.set(cid, storage, time)
                doCreatureSetStorage(cid, storage, 1)
                doPlayerSetExperienceRate(cid, 1+extraExp)
                return true
            end
        ]]>
    </action>       
</mod>
 
LUA:
exhaustion =
{
	check = function (cid, storage)
		return getPlayerStorageValue(cid, storage) >= os.time()
	end,

	get = function (cid, storage)
		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time()
			return left >= 0 and left
		end

	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time() + time)
	end,

	make = function (cid, storage, time)
		if not exhaustion.get(cid, storage) then
			exhaustion.set(cid, storage, time)
			return true
		end

	end
}
 
Back
Top