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

MOD Zombie event

You can change the talkaction script to a globalevent, just remove all the parts/lines with cid then.
Thanks! But do I have to remove all cid in every single script or just in the talkaction script? and then change this function to onThink?
Code:
function onSay(cid, words, param, channel)
 
Yes, in the talkaction script and change the main function indeed.
I changed the function now... but then I can just remove all the other stuffs too? they are params etc... things that happens when I made the talkaction before
Code:
function onThink(interval, channel)
    if(getStorage(ZE_STATUS) ~= 2) then
        local players_on_arena_count = #getZombiesEventPlayers()
        if(param == 'force') then
            if(players_on_arena_count > 0) then
                setZombiesEventPlayersLimit(players_on_arena_count  )
                addZombiesEventBlockEnterPosition()
                doSetStorage(ZE_STATUS, 2)
                doBroadcastMessage("Zombie Arena Event started.")
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event started.")
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start Zombies event. There is no players on arena.")
            end
        else
            if(param ~= '' and tonumber(param) > 0) then
                setZombiesEventPlayersLimit(tonumber(param))
            end
            removeZombiesEventBlockEnterPosition()
            doSetStorage(ZE_STATUS, 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.")
            doPlayerBroadcastMessage(cid, "Zombie Arena Event teleport is opened. We are waiting for " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players to start.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event is already running.")
    end
    return true
end

then I can just use something like this instea?
Code:
 local createpos = {x=586,y=932,z=7} -- Every 2h where will the Teleport Appear 
 local topos = {x=728,y=964,z=7} -- Where will the Teleport take you 
 local msg = "Zombie event TP has now been closed! It will open again in 2 hours! All participants get Ready for a Fight!" 
 local timetoclose = 300 -- in second 

 local function remove() 
 local tp = getTileItemById(createpos,1387).uid 
 if tp ~= 0 then 
 doRemoveItem(tp) 
 doBroadcastMessage(msg) 
 end
 end

  function onThink(interval) 
 doCreateTeleport(1387, topos, createpos) 
 doBroadcastMessage("ZOMBIEEVENT teleport is now open!\nCatch the teleport within "..timetoclose.." seconds! Teleport is Located in Events Room.") 
 addEvent(remove,timetoclose*1000) 
 return true 

 end
 
Last edited:
I changed the function now... but then I can just remove all the other stuffs too? they are params etc... things that happens when I made the talkaction before
Code:
function onThink(interval, channel)
    if(getStorage(ZE_STATUS) ~= 2) then
        local players_on_arena_count = #getZombiesEventPlayers()
        if(param == 'force') then
            if(players_on_arena_count > 0) then
                setZombiesEventPlayersLimit(players_on_arena_count  )
                addZombiesEventBlockEnterPosition()
                doSetStorage(ZE_STATUS, 2)
                doBroadcastMessage("Zombie Arena Event started.")
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event started.")
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start Zombies event. There is no players on arena.")
            end
        else
            if(param ~= '' and tonumber(param) > 0) then
                setZombiesEventPlayersLimit(tonumber(param))
            end
            removeZombiesEventBlockEnterPosition()
            doSetStorage(ZE_STATUS, 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.")
            doPlayerBroadcastMessage(cid, "Zombie Arena Event teleport is opened. We are waiting for " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players to start.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event is already running.")
    end
    return true
end

then I can just use something like this instea?
Code:
local createpos = {x=586,y=932,z=7} -- Every 2h where will the Teleport Appear
local topos = {x=728,y=964,z=7} -- Where will the Teleport take you
local msg = "Zombie event TP has now been closed! It will open again in 2 hours! All participants get Ready for a Fight!"
local timetoclose = 300 -- in second

local function remove()
local tp = getTileItemById(createpos,1387).uid
if tp ~= 0 then
doRemoveItem(tp)
doBroadcastMessage(msg)
end
end

  function onThink(interval)
doCreateTeleport(1387, topos, createpos)
doBroadcastMessage("ZOMBIEEVENT teleport is now open!\nCatch the teleport within "..timetoclose.." seconds! Teleport is Located in Events Room.")
addEvent(remove,timetoclose*1000)
return true

end

I use this right now...
Code:
 local createpos = {x=586,y=932,z=7} -- Every 2h where will the Teleport Appear 
 local topos = {x=634, y=1038, z=7} -- Where will the Teleport take you 
 local msg = "Zombie-event teleport has now been closed! It will open again in 2 hours! All participants get Ready for a Fight!" 
 local timetoclose = 300 -- in second 



 local function remove() 
 local tp = getTileItemById(createpos,1387).uid 
 if tp ~= 0 then 
 doRemoveItem(tp) 
 doBroadcastMessage(msg) 
 end
 end

  function onThink(interval) 
 doCreateTeleport(1387, topos, createpos) 
 doBroadcastMessage("Zombie-event teleport is now open!\nCatch the teleport within "..timetoclose.." seconds! Teleport is Located in Events Room.") 
 addEvent(remove,timetoclose*1000) 
 return true 

 end

The thing is... it create the teleports and everything but it does not count when players go into the teleport and it also don't start :/
 
Yes, you have to be in PZ to use talkaction. !zombie join
You can also start it with "God" / !startzombie
Code:
<talkaction words="!startzombie" access="5" event="script">
You have to config-
PHP:
delayTime = 1.0, -- time in which players who joined to event are teleporting to teleport position [minutes]
startEvent = 1, -- time from teleport to start event [seconds]

Config it.
PHP:
 Put DAY/HOUR and then will start automatically. (Example: ['Monday'] = {'00:00:00'}
[LIST=1]
[*]days = {
[*]                                        ['Tuesday'] = {'21:59:20'},
[*]                                        ['Sunday'] = {'21:59:20'}
[/LIST]
 
Yes, you have to be in PZ to use talkaction. !zombie join
You can also start it with "God" / !startzombie
Code:
<talkaction words="!startzombie" access="5" event="script">
You have to config-
PHP:
delayTime = 1.0, -- time in which players who joined to event are teleporting to teleport position [minutes]
startEvent = 1, -- time from teleport to start event [seconds]

Config it.
PHP:
 Put DAY/HOUR and then will start automatically. (Example: ['Monday'] = {'00:00:00'}
[LIST=1]
[*]days = {
[*]                                        ['Tuesday'] = {'21:59:20'},
[*]                                        ['Sunday'] = {'21:59:20'}
[/LIST]
But how do I config it to be every 2 hours? do I need to write down every 2 hour? haha
 
Every two hours.

EASY Way. (Clean way)

PHP:
['Tuesday'] = {'00:00:00'},
['Tuesday'] = {'02:00:00'},
['Tuesday'] = {'04:00:00'},
['Tuesday'] = {'06:00:00'},
['Tuesday'] = {'08:00:00'},
['Tuesday'] = {'10:00:00'},
['Tuesday'] = {'12:00:00'},
['Tuesday'] = {'14:00:00'},
...
 
Every two hours.

EASY Way. (Clean way)

PHP:
['Tuesday'] = {'00:00:00'},
['Tuesday'] = {'02:00:00'},
['Tuesday'] = {'04:00:00'},
['Tuesday'] = {'06:00:00'},
['Tuesday'] = {'08:00:00'},
['Tuesday'] = {'10:00:00'},
['Tuesday'] = {'12:00:00'},
['Tuesday'] = {'14:00:00'},
...
It doesn't start with the time I choose :/ is this a zombie event where you kill the zombies or just move away from them?
 
Back
Top