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