LucasFerraz
Systems Analyst
Why does this script don't works? Can someone fix this script?
Is possible add this 2 minutes before change?
Is possible add this 2 minutes before change?
XML:
doBroadcastMessage('The map will change in 2 minutes.')
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="ChangeMap" version="1.0" author="LucasOlzon" contact="otland.net" enabled="yes">
<config name="map_func"><![CDATA[
info = {
[0] = {x=160,y=54,z=7},
[1] = {x=205,y=30,z=6},
[2] = {x=1102,y=1001,z=7}
}
storage = 34544
]]></config>
<event type="login" name="Check Map" event="script"><![CDATA[
domodlib('map_func')
function onLogin(cid)
if getGlobalStorageValue(storage) == -1 then
setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)
end
doTeleportThing(cid,info[getGlobalStorageValue(storage)])
return true
end
]]></event>
<globalevent name="ChangeMap" interval="1500000" event="script"><![CDATA[
domodlib('map_func')
function onThink(interval, lastExecution)
doBroadcastMessage('The map will change again in 25 minutes.')
if getGlobalStorageValue(storage) < #info then
setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)
else
setGlobalStorageValue(storage,getGlobalStorageValue(storage)-#info)
end
for _, pid in ipairs(getPlayersOnline()) do
doRemoveConditions(pid, true)
doTeleportThing(pid,info[getGlobalStorageValue(storage)])
end
return TRUE
end]]></globalevent>
</mod>