Mister mox
New Member
- Joined
- Mar 3, 2010
- Messages
- 6
- Reaction score
- 0
Can you post your Zombie_teleport and Zombie_think.lua please
dofile('data/zombie_system.lua')
function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
if not player then
return false
end
if Game.getStorageValue(zeStartedGlobalStorage) == 2 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.')
player:teleportTo(fromPosition, true)
return false
end
if Game.getStorageValue(zeStartedGlobalStorage) == 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has not started yet.')
player:teleportTo(fromPosition, true)
return false
end
if Game.getStorageValue(zeJoinedCountGlobalStorage) > zeMaxPlayers then
player:teleportTo(fromPosition, true)
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. Game.getStorageValue(zeJoinedCountGlobalStorage) ..'/'.. zeMaxPlayers ..']')
return false
end
player:teleportTo(zeWaitingRoomPos)
Game.setStorageValue(zeJoinedCountGlobalStorage, Game.getStorageValue(zeJoinedCountGlobalStorage) + 1)
Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. zeMaxPlayers ..'].', player:getName(), Game.getStorageValue(zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)
player:setStorageValue(zeJoinStorage, 1)
return true
end
function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
if not player then
return false
end
if Game.getStorageValue(zeStartedGlobalStorage) == 2 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.')
player:teleportTo(fromPosition, true)
return false
end
if Game.getStorageValue(zeStartedGlobalStorage) == 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has not started yet.')
player:teleportTo(fromPosition, true)
return false
end
if Game.getStorageValue(zeJoinedCountGlobalStorage) > zeMaxPlayers then
player:teleportTo(fromPosition, true)
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. Game.getStorageValue(zeJoinedCountGlobalStorage) ..'/'.. zeMaxPlayers ..']')
return false
end
player:teleportTo(zeWaitingRoomPos)
Game.setStorageValue(zeJoinedCountGlobalStorage, Game.getStorageValue(zeJoinedCountGlobalStorage) + 1)
Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. zeMaxPlayers ..'].', player:getName(), Game.getStorageValue(zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)
player:setStorageValue(zeJoinStorage, 1)
return true
end
dofile('data/zombie_system.lua')
function onThink(interval, lastExecution, thinkInterval)
if Game.getStorageValue(zeStartedGlobalStorage) < 1 then
local teleport = Game.createItem(1387, 1, zeCreateTeleportPosition)
if teleport then
teleport:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 7000)
end
Game.setStorageValue(zeStartedGlobalStorage, 1)
print('Zombie Event has started & waiting for players to join! Min: '.. zeMinPlayers ..'/'.. zeMaxPlayers ..'.')
Game.broadcastMessage('The Zombie Event has started! You have '.. zeWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
addEvent(startZombie, zeWaitMinutes * 60 * 1000)
end
return true
end
function onThink(interval, lastExecution, thinkInterval)
if Game.getStorageValue(zeStartedGlobalStorage) < 1 then
local teleport = Game.createItem(1387, 1, zeCreateTeleportPosition)
if teleport then
teleport:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 7000)
end
Game.setStorageValue(zeStartedGlobalStorage, 1)
print('Zombie Event has started & waiting for players to join! Min: '.. zeMinPlayers ..'/'.. zeMaxPlayers ..'.')
Game.broadcastMessage('The Zombie Event has started! You have '.. zeWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
addEvent(startZombie, zeWaitMinutes * 60 * 1000)
end
return true
end