• 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.3] Save every 15 minutes

Jarhead

New Member
Joined
Feb 2, 2012
Messages
81
Reaction score
2
Location
Poland
TFS 0.3.0 I need working save.lua script every 15 minutes and broadcast msg.
I've got this in ots files:

Code:
function onThink(interval, lastExecution)
    saveServer()
    return TRUE
end

Thanks!
 
save.lua
Code:
function onThink(interval, lastExecution)
    doBroadcastMessage("Server is being saved, next save in 15 minutes.")
    saveServer()
    return TRUE
end

globalevents.xml
Code:
<globalevent name="save" interval="900" script="save.lua"/>
 
save.lua
Code:
function onThink(interval, lastExecution)
    doBroadcastMessage("Server is being saved, next save in 15 minutes.")
    saveServer()
    return TRUE
end

globalevents.xml
Code:
<globalevent name="save" interval="900" script="save.lua"/>

Can you make notification one minute before save?
 
Can you make notification one minute before save?
make the interval 1 minute before it should save
1000 * 60 * 14
doBroadcastMessage('Server will save in 1 minute.')
then use addEvent(function() doBroadcastMessage('Server is being saved, next save in 15 minutes.') saveServer() end, 60000) inside the script
will run the script at 14 mins then at 15 the save will execute
 
@Xeraphus
I have a question: -20 is minimal damage hit?
ethernal spear.lua:

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.4, -20, 0.6, 0)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Back
Top