• 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

12:52 Big foot event starting in 2 minutes 0 players have joined. The teleport will be closed when the event start!
and 2 joined event :S
 
Change this
Code:
for x = 1, config.timeToStartEvent - 1 do
     addEvent(doBroadcastMessage, x * 60 * 1000, "Big foot event starting in " .. (config.timeToStartEvent - x) .. " minutes " .. getGlobalStorageValue(config.playerCount) .. " players have joined The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
end
To this
Code:
for x = 1, config.timeToStartEvent - 1 do
     addEvent(doBroadcastAmount, x * 60 * 1000, x)
end


Then add this above function onThink
Code:
local function doBroadcastAmount(x)
     return doBroadcastMessage("Big foot event starting in " .. (config.timeToStartEvent - x) .. " minutes " .. getGlobalStorageValue(config.playerCount) .. " players have joined The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
end
 
13:19 Big foot event starting in 3 minutes. The teleport will be closed when the event start!
13:20 Big foot event starting in 2 minutes 2 players have joined The teleport will be closed when the event start!
13:21 Big foot event starting in 1 minutes 3 players have joined The teleport will be closed when the event start!

You are the best You are the best You are the best .tytytytytytytytytytytytytyty.
 
If a event starts i want a broadcast saying what event is starting and how long til it starts.
to join the event i want a command like !joinevent, but you will have to have no battle.
When you use this command you will be teleportrd to a "waiting room" with the other players.



And when the event starts all players will be teleported into the event, and will also need a team balance.
To be able to leave you shall be able to relog or say!leave.
 
Last edited:
If a event starts i want a broadcast saying what event is starting and how long til it starts.
Isn't it already doing that?

to join the event i want a command like !joinevent, but you will have to have no battle.
When you use this command you will be teleportrd to a "waiting room" with the other players.
Code:
local config = {
     playerCount = 2001, -- Global storage for counting the players in the event
     maxPlayers = 15 -- Max players who can participate
}
   
function onSay(cid, words, param)
     if getGlobalStorageValue(80001) ~= 1 then
         doPlayerSendCancel(cid, "There is no event at the moment.")
         return false
     end
     if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
         setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
         doTeleportThing(cid, {x = 1000, y = 1000, z = 7}) -- waiting room position
         if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
             doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
         else   
             doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(config.playerCount) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED)
         end   
     else
         doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
         return false
     end
     return true
end

Add this under addEvent(startEvent, config.timeToStartEvent * 1000 * 60)
Code:
setGlobalStorageValue(80001, 1)
And this under doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING)
Code:
setGlobalStorageValue(80001, 0)

For the leave talkaction you can check of the player is in the event area with isInRange, then teleport the player to the temple or something.
Code:
function onSay(cid, words, param)
     if isInRange(getPlayerPosition(cid), {x = 1000, y = 1000, z = 7}, {x = 1200, y = 1200, z = 7}) then -- event positions
         doTeleportThing(cid, {x = 100, y = 100, z = 7})
     end
     return true
end
 
thx work fine .... now small edite all player when join event tp to x = 1050, y = 1919, z = 7 i want player tp random like one tp in norst east in area and west north somthing like this
 
add in movement ??
change
Code:
function tpBack(cid, fromPosition)
    doTeleportThing(cid, fromPosition, true)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

to
Code:
function tpBack(cid, fromPosition)
    doTeleportThing(cid, {x = math.random(100, 120), y = math.random(100, 120), z = 7})
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

??
 
2 erro first error in consel and second error player can use command in battel :S
BL45xHE7x.png
 
Show how you changed it.
For the not use in battle.
Code:
if getCreatureCondition(cid, CONDITION_INFIGHT) then
     return doPlayerSendCancel(cid, "You can't join the event when you're in a fight.")
end
 
Code:
local config = {
     playerCount = 2001, -- Global storage for counting the players in the event
     maxPlayers = 15 -- Max players who can participate
}
  
function onSay(cid, words, param)
     if getGlobalStorageValue(80001) ~= 1 then
         doPlayerSendCancel(cid, "There is no event launching.")
         return false
     end
     if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
         setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
         doTeleportThing(cid, {x = math.random(1050, 120), y = math.random(1919, 120), z = 7}) -- waiting room position
         if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
             doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
         else  
         end  
     else
         doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
         return false
     end
     return true
end
 
how and my postion tp is "x = 1050, y = 1919, z = 7"

or u mean change to

x = math.random(1050, 115), y = math.random(1919, 120), z = 7
 
Like this (depens on how big the waiting room is).
Code:
{x = math.random(1048, 1052), y = math.random(1917, 1921), z = 7}
i don't have waiting room if u can make one for me its k i make player tp direct to event and w8ing event start there

first: error when player die in event and say !joinevent he can back event again and its bug
second: player can say !joinevent when he have battel and its bug too
 
Last edited by a moderator:
i don't have waiting room if u can make one for me its k i make player tp direct to event and w8ing event start there
Wherever the player should spawn in the event.
first: error when player die in event and say !joinevent he can back event again and its bug
second: player can say !joinevent when he have battel and its bug too
Then add this.
Show how you changed it.
For the not use in battle.
Code:
if getCreatureCondition(cid, CONDITION_INFIGHT) then
     return doPlayerSendCancel(cid, "You can't join the event when you're in a fight.")
end

And stop double posting...
 
Wherever the player should spawn in the event.

And stop double posting...
player should spawn in x = math.random(978, 1077), y = math.random(1870, 1954), z = 7

about double posting "sorry"

and when player die in event and event still launch he can back again if say !joinevent :S

my script
Code:
local config = {
     playerCount = 2001, -- Global storage for counting the players in the event
     maxPlayers = 15 -- Max players who can participate
}
  
function onSay(cid, words, param)
     if getGlobalStorageValue(80001) ~= 1 then
         doPlayerSendCancel(cid, "There is no event launching.")
         return false
     end
            if getCreatureCondition(cid, CONDITION_INFIGHT) then
     return doPlayerSendCancel(cid, "You can't join the event when you're in a fight.")
end
     if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
         setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
         doTeleportThing(cid, {x = math.random(978, 1077), y = math.random(1870, 1954), z = 7}) -- waiting room position
         if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
             doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
         else 
         end 
     else
         doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
         return false
     end
     return true
end
 
Last edited:
Back
Top