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

Solved Zombile event

i want event brodcast say how many player still live in event but brodcast for player in event only not all players
 
Change the doBroadcastMessage line to this
Code:
for _, pid in ipairs(getPlayersOnline()) do
     if isInRange(getPlayerPosition(pid), config.fromPosition, config.toPosition) then
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "The text you want.")
     end
end
 
chnage
Code:
 doBroadcastMessage("A Big foot has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " Big foot in the Big foot event!", MESSAGE_STATUS_CONSOLE_RED)
to
Code:
local players = getPlayersOnline()
for _, pid in ipairs(players) do
     if isInRange(getPlayerPosition(pid), config.fromPosition, config.toPosition) then
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "The text you want.")
     end
end
???? i have alot dobroadcast msg
in creaturescripts or in globalevents
 
The message you want only for players in that area, change that.
Also change the "The text you want." to the actual broadcast message.
 
so where i can add this

Code:
local players = getPlayersOnline()
for _, pid in ipairs(players) do
     if isInRange(getPlayerPosition(pid), config.fromPosition, config.toPosition) then
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "The text you want.")
     end
end
 
BUGS in Big foot event

*the winner of the event can't teleport auto to temple must monster kill him to teleport to temple.
*every 1 min brodcast who is live in event but this brodcast for player in event only

*if we can make channel for events will be better :D and brodcast who is live and how many Big foots spwans
 
Last edited:
i need to make this script don't work in event too :S this for house teleport
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    return
    hasCondition(cid, CONDITION_INFIGHT) and
        doPlayerSendCancel(cid, "Sorry, you are in a fight.")
    or getPlayerLevel(cid) < getConfigInfo("levelToBuyHouse") and
        doPlayerSendCancel(cid, "Sorry, not possible.")
    or not getHouseByPlayerGUID(getPlayerGUID(cid)) and
        doPlayerSendCancel(cid, "Sorry, but you do not own a house.")
    or doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
end
 
Code:
local cfg = {
fromPosition = {x = 978, y = 1870, z = 7}, -- top left cornor of the playground
     toPosition = {x = 1077, y = 1954, z = 7}, -- bottom right cornor of the playground
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInRange(getPlayerPosition(cid), cfg.fromPosition, cfg.toPosition) then
     return doPlayerSendCancel(cid, "You can't use this items in event.")
end
    return
    hasCondition(cid, CONDITION_INFIGHT) and
        doPlayerSendCancel(cid, "Sorry, you are in a fight.")
    or getPlayerLevel(cid) < getConfigInfo("levelToBuyHouse") and
        doPlayerSendCancel(cid, "Sorry, not possible.")
    or not getHouseByPlayerGUID(getPlayerGUID(cid)) and
        doPlayerSendCancel(cid, "Sorry, but you do not own a house.")
    or doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
end
 
Thx bro what about 2 tp's when event start .... now when event start just one tp is appear in temple i want 2 tp's appear for player

anyway thx for help but i relly want this edite for event :S
 
Last edited by a moderator:
so its will be like this?
Code:
   teleportPosition = {x = 1003, y = 996, z = 7, stackpos = 1}, -- Where the teleport will be created
    teleportPosition = {x = 997, y = 996, z = 7, stackpos = 1}, -- Where the teleport will be created
no work just one tp work

???????????
 
Last edited by a moderator:
so how i can edite this i tried everything nothing work :S
Code:
local config = {
    playerCount = 2001, -- Global storage for counting the players left/entered in the event
    zombieCount = 2002, -- Global storage for counting the zombies in the event
    teleportActionId = 2000, -- Action id of the teleport needed for the movement script
    teleportPosition = {x = 1003, y = 996, z = 7, stackpos = 1}, -- Where the teleport will be created
    teleportToPosition = {x = 1050, y = 1919, z = 7}, -- Where the teleport will take you
    teleportId = 1387, -- Id of the teleport
    timeToStartEvent = 3, -- Minutes, after these minutes the teleport will be removed and the event will be declared started
    timeBetweenSpawns = 20, -- Seconds between each spawn of zombie
    zombieName = "Big foot", -- Name of the zombie that should be summoned
    playersNeededToStartEvent = 2, -- Players needed before the zombies can spawn.
   
    -- Should be the same as in the creaturescript!
    -- The zombies will spawn randomly inside this area
     fromPosition = {x = 978, y = 1870, z = 7}, -- top left cornor of the playground
    toPosition = {x = 1077, y = 1954, z = 7}, -- bottom right cornor of the playground
    }

function onThink(interval, lastExecution, thinkInterval)
    local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition)
    doItemSetAttribute(tp, "aid", config.teleportActionId)
    doBroadcastMessage("Big foot event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
    for x = 1, config.timeToStartEvent - 1 do
     addEvent(doBroadcastMessage, x * 60 * 1000, "Big foot event starting in " .. (config.timeToStartEvent - x) .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
end
    setGlobalStorageValue(config.playerCount, 0)
    setGlobalStorageValue(config.zombieCount, 0)
    addEvent(startEvent, config.timeToStartEvent * 1000 * 60)
    print(getGlobalStorageValue(2001))
end

function startEvent()
    local get = getTileItemById(config.teleportPosition, config.teleportId).uid
if get > 0 then
     doRemoveItem(get, 2)
end
   
    local fromp, top = config.fromPosition, config.toPosition

    if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then
        addEvent(spawnZombie, config.timeBetweenSpawns * 1000)
        doBroadcastMessage("Good luck in the Big foot event people! The teleport has closed!", MESSAGE_STATUS_WARNING)
       
        for x = fromp.x, top.x do
            for y = fromp.y, top.y do
                for z = fromp.z, top.z do
                    areapos = {x = x, y = y, z = z, stackpos = 253}
                   getPlayers = getTopplayer(areapos)
                   print(getPlayers.uid)
                    if isPlayer(getPlayers.uid) then
                        doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first Big foot will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!")
                    end
                end
            end
        end
    else
        doBroadcastMessage("The Big foot event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING)
        for x = fromp.x, top.x do
            for y = fromp.y, top.y do
                for z = fromp.z, top.z do
                    areapos = {x = x, y = y, z = z, stackpos = 253}
                    getPlayers = getTopplayer(areapos)
                    print(getPlayers.uid)
                    if isPlayer(getPlayers.uid) then
                        doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false)
                        doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT)
                    end
                end
            end
        end
    end
end

function spawnZombie()
    if getGlobalStorageValue(config.playerCount) >= 2 then
       pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)}
        doSummonCreature(config.zombieName, pos)
        doSendMagicEffect(pos, CONST_ME_MORTAREA)
        setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1)
        doBroadcastMessage("A Big foot has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " Big foot in the Big foot event!", MESSAGE_STATUS_CONSOLE_RED)
        addEvent(spawnZombie, config.timeBetweenSpawns * 1000)
    end
end
 
Code:
local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition)
doItemSetAttribute(tp, "aid", config.teleportActionId)
Copy this, add it under it, change tp to something else and change tp position.

Then to remove the tp, you can do it same way as this.
Code:
local get = getTileItemById(config.teleportPosition, config.teleportId).uid
if get > 0 then
     doRemoveItem(get, 1)
end
With right position.
 
Back
Top