• 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!

TFS 0.X My server doesn't recognize the MOD

lSenturion2

Active Member
Joined
Oct 2, 2019
Messages
124
Reaction score
29
Hello friends, I have a problem. My server does not recognize the following MOD:

Code:
<?xml version='1.0' encoding='UTF-8'?>
<mod name='HappyHours' version='1.0' author='Tomek/Xevis' contact='[email protected]' enabled='yes'>

    <config name='happyHoursConf'>
        <![CDATA[
            HH_STORAGE = 2327 -- nº storage, tenha certeza de colocar uma não usada
            HH_EXTRA_EXP_PERCENT = 100 -- porcentagem à mais de exp, caso queira double, coloque 100
         

            -- CONFIGURAR O DIA E A DURAÇÃO DO EVENTO
            -- EXEMPLO: ['DIA], from = '10:00:00', to = '11:00:00' (formato 24 horas)
            -- EXPLICAÇÃO: ocorrerá no dia tal, das 10 de manhã às 11 da manhã.

            DAYS = {
                ['Friday'] = {
                    {from = '09:00:00', to = '10:00:00'}
                },
                ['Friday'] = {
                    {from = '20:00:00', to = '21:00:00'}
                },
                ['Saturday'] = {
                    {from = '02:17:00', to = '02:30:00'}
                },
                 ['Saturday'] = {
                    {from = '16:00:00', to = '17:00:00'}
                },
                ['Sunday'] = {
                    {from = '14:00:00', to = '15:00:00'}
                },
                 ['Sunday'] = {
                    {from = '22:00:00', to = '21:00:00'}
                }
            }
         
        ]]>
    </config>

    <lib name='happyHoursLib'>
        <![CDATA[
            function doPlayerSetSkills(cid, value)
                for i = 0, 8 do
                    doPlayerSetRate(cid, i, value)
                end
            end

            function stopNewWorld()
                doSetStorage(HH_STORAGE, -1)

                for _, cid in ipairs(getPlayersOnline()) do
                    doPlayerSetSkills(cid, 1)
                end

                doBroadcastMessage('HAPPY HOUR HAS ENDED!')
            end
        ]]>
    </lib>
 
    <globalevent name="happyHoursStop" interval="1000" event="script">
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            local daysOpen = {}
         
            for k, v in pairs(DAYS) do
                table.insert(daysOpen, k)
            end
         
            function onThink(interval)
                if isInArray(daysOpen, os.date('%A')) then
                    for k, v in pairs(DAYS[os.date('%A')]) do
                        if isInArray(v.to, os.date('%X', os.time())) then
                                stopNewWorld()
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </globalevent> 
 
    <globalevent name="happyHoursStart" interval="1000" event="script">
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            local daysOpen = {}
         
            for k, v in pairs(DAYS) do
                table.insert(daysOpen, k)
            end
         
            function onThink(cid, interval)
                if isInArray(daysOpen, os.date('%A')) then
                    for _, d in pairs(DAYS[os.date('%A')]) do
                        if isInArray(d.from, os.date('%X', os.time())) then
                            local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)

                            for _, cid in ipairs(getPlayersOnline()) do
                                doPlayerSetSkills(cid, newRate)
                            end
                         
                            doSetStorage(HH_STORAGE, 1)
                         
                            doBroadcastMessage('HAPPY HOUR IS NOW ACTIVE, ENJOY 1 HOUR OF +100% EXP.', MESSAGE_STATUS_WARNING)
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </globalevent>

    <event type='login' name='happyHoursLogin' event='script'>
        <![CDATA[
            domodlib('happyHoursConf')
            domodlib('happyHoursLib')

            function onLogin(cid)
                if getStorage(HH_STORAGE) == 1 then
                    local newRate = 1 + (HH_EXTRA_EXP_PERCENT/100)
                    doPlayerSetSkills(cid, newRate)
                    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'HAPPY HOUR IS ACTIVE, ENJOY 1 HOUR OF DOUBLE EXP.')
                else
                    doPlayerSetSkills(cid, 1)                 
                end
                return true
            end
        ]]>
    </event>
</mod>

I have TFS 0.4 and no error appears on the console, it pretends the mod doesn't exist, but it loads it and everything. Which may be?
 
You can try to add a print, to see if there server parses the file or not.

Just after:
Code:
<![CDATA[

Add
Code:
print('Testing mod - CAN YOU SEE ME?')
Now open server and see if message is there.
 
Back
Top