TFS 04 8.70
I found this event by Printer, problem is no matter how you set time it only says double exp is off
Example:
<globalevent name="2xExp1" time="05:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp2" time="06:00" event="script" value="doubleexp.lua"/>
the above will say off at both 05 and 06
any suggestions on a fix?
This added to login.lua
globalevents.xml
doubleexp.lua
I found this event by Printer, problem is no matter how you set time it only says double exp is off
Example:
<globalevent name="2xExp1" time="05:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp2" time="06:00" event="script" value="doubleexp.lua"/>
the above will say off at both 05 and 06
any suggestions on a fix?
This added to login.lua
Code:
local cyko = {
new_rate = 2,
old_rate = 1
}
if getStorage(3000) == 1 then
doPlayerSetRate(cid, SKILL__LEVEL, cyko.new_rate)
else
doPlayerSetRate(cid, SKILL__LEVEL, cyko.old_rate)
end
globalevents.xml
Code:
<!--////////////////////////////05:00-06:00//////////////////////////////////////-->
<globalevent name="2xExp1" time="05:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp2" time="06:00" event="script" value="doubleexp.lua"/>
<!--////////////////////////////15:00-16:00//////////////////////////////////////-->
<globalevent name="2xExp3" time="17:35" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp4" time="17:40" event="script" value="doubleexp.lua"/>
<!--////////////////////////////20:00-21:00//////////////////////////////////////-->
<globalevent name="2xExp5" time="20:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp6" time="21:00" event="script" value="doubleexp.lua"/>
doubleexp.lua
Code:
local cyko = {
new_rate = 2,
old_rate = 1
}
function onTime()
if getStorage(3000) == -1 then
doSetStorage(3000, 1)
doBroadcastMessage("Double Exp event is on.")
for _, on in ipairs(getPlayersOnline()) do
doPlayerSetRate(on, SKILL__LEVEL, cyko.new_rate)
end
else
doSetStorage(3000, -1)
doBroadcastMessage("Double Exp event is off.")
for _, off in ipairs(getPlayersOnline()) do
doPlayerSetRate(off, SKILL__LEVEL, cyko.old_rate)
end
end
return true
end