Witam,
mam problem z areną jak gracz wchodzi na arenę to wywala raz normalnie po 5 albo 20 min (zależy czy ma Vip coins). Ale nieraz może siedzieć i bez limitu czasu (nie mam pojecia dlaczego) może ktoś z was miał podobny problem ? Area jest z tego forum z 2010 roku. o to ten mods.
Dodawałem już nawet
if isPlayer(cid) then
stopEvent(pauseKick)
end
że przed wejściem zeruje nie pomaga brakuje mi pomysłów ;p
To jest ta arena -> http://otland.net/f81/huntarea-system-142402/
mam problem z areną jak gracz wchodzi na arenę to wywala raz normalnie po 5 albo 20 min (zależy czy ma Vip coins). Ale nieraz może siedzieć i bez limitu czasu (nie mam pojecia dlaczego) może ktoś z was miał podobny problem ? Area jest z tego forum z 2010 roku. o to ten mods.
Dodawałem już nawet
if isPlayer(cid) then
stopEvent(pauseKick)
end
że przed wejściem zeruje nie pomaga brakuje mi pomysłów ;p
To jest ta arena -> http://otland.net/f81/huntarea-system-142402/
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="HuntArea System" version="Tested only on 0.4" author="Hugq" contact="[email protected]" enabled="yes">
<config name="HuntAreaFunctions"><![CDATA[
config = {
exhaustionInSeconds = 10,
storage = 34560,
-- 1 tp gdzie wejscie
-- 2 tp podaje sie srodek gdzie jest hunting arena (do sciany sam liczy)
-- 3 tp wywala po minucie na jakie pos
-- 4 minuty
-- 5 level
-- 6 na boki ile kratek
-- 7 gora dol ile kratek
[10001] = {{x = 765, y = 1084, z = 7}, {x = 766, y = 1081, z = 7}, {x = 766, y = 1088, z = 7}, 10, 8, 4, 4},
[10002] = {{x = 779, y = 1084, z = 7}, {x = 780, y = 1081, z = 7}, {x = 780, y = 1088, z = 7}, 10, 8, 4, 4},
[10003] = {{x = 793, y = 1084, z = 7}, {x = 794, y = 1081, z = 7}, {x = 794, y = 1088, z = 7}, 10, 8, 4, 4},
[10004] = {{x = 765, y = 1071, z = 7}, {x = 766, y = 1068, z = 7}, {x = 766, y = 1075, z = 7}, 10, 8, 4, 4},
[10005] = {{x = 779, y = 1071, z = 7}, {x = 780, y = 1068, z = 7}, {x = 780, y = 1075, z = 7}, 10, 8, 4, 4},
[10006] = {{x = 793, y = 1071, z = 7}, {x = 794, y = 1068, z = 7}, {x = 794, y = 1075, z = 7}, 10, 8, 4, 4},
[10007] = {{x = 765, y = 1058, z = 7}, {x = 765, y = 1055, z = 7}, {x = 766, y = 1062, z = 7}, 10, 8, 4, 4},
[10008] = {{x = 779, y = 1058, z = 7}, {x = 780, y = 1055, z = 7}, {x = 780, y = 1062, z = 7}, 10, 8, 4, 4},
[10009] = {{x = 793, y = 1058, z = 7}, {x = 794, y = 1055, z = 7}, {x = 794, y = 1062, z = 7}, 10, 8, 4, 4},
[10010] = {{x = 765, y = 1084, z = 6}, {x = 766, y = 1081, z = 6}, {x = 766, y = 1088, z = 6}, 10, 8, 4, 4},
[10011] = {{x = 779, y = 1084, z = 6}, {x = 780, y = 1081, z = 6}, {x = 780, y = 1088, z = 6}, 10, 8, 4, 4},
[10012] = {{x = 793, y = 1084, z = 6}, {x = 794, y = 1081, z = 6}, {x = 794, y = 1088, z = 6}, 10, 8, 4, 4},
[10013] = {{x = 765, y = 1071, z = 6}, {x = 766, y = 1068, z = 6}, {x = 766, y = 1075, z = 6}, 10, 8, 4, 4},
[10014] = {{x = 779, y = 1071, z = 6}, {x = 780, y = 1068, z = 6}, {x = 780, y = 1075, z = 6}, 10, 8, 4, 4},
[10015] = {{x = 793, y = 1071, z = 6}, {x = 794, y = 1068, z = 6}, {x = 794, y = 1075, z = 6}, 10, 8, 4, 4},
[10016] = {{x = 765, y = 1058, z = 6}, {x = 765, y = 1055, z = 6}, {x = 766, y = 1062, z = 6}, 10, 8, 4, 4},
[10017] = {{x = 779, y = 1058, z = 6}, {x = 780, y = 1055, z = 6}, {x = 780, y = 1062, z = 6}, 10, 8, 4, 4},
[10018] = {{x = 793, y = 1058, z = 6}, {x = 794, y = 1055, z = 6}, {x = 794, y = 1062, z = 6}, 10, 8, 4, 4},
[10019] = {{x = 765, y = 1084, z = 5}, {x = 766, y = 1081, z = 5}, {x = 766, y = 1088, z = 5}, 10, 8, 4, 4},
[10020] = {{x = 780, y = 1083, z = 5}, {x = 780, y = 1081, z = 5}, {x = 780, y = 1088, z = 5}, 10, 8, 4, 4},
[10021] = {{x = 793, y = 1084, z = 5}, {x = 794, y = 1081, z = 5}, {x = 794, y = 1088, z = 5}, 10, 8, 4, 4},
[10022] = {{x = 765, y = 1071, z = 5}, {x = 766, y = 1068, z = 5}, {x = 766, y = 1075, z = 5}, 10, 8, 4, 4},
[10023] = {{x = 779, y = 1071, z = 5}, {x = 780, y = 1068, z = 5}, {x = 780, y = 1075, z = 5}, 10, 8, 4, 4},
[10024] = {{x = 793, y = 1071, z = 5}, {x = 794, y = 1068, z = 5}, {x = 794, y = 1075, z = 5}, 10, 8, 4, 4},
[10025] = {{x = 765, y = 1058, z = 5}, {x = 765, y = 1055, z = 5}, {x = 766, y = 1062, z = 5}, 10, 8, 4, 4},
[10026] = {{x = 779, y = 1058, z = 5}, {x = 780, y = 1055, z = 5}, {x = 780, y = 1062, z = 5}, 10, 8, 4, 4},
[10027] = {{x = 793, y = 1058, z = 5}, {x = 794, y = 1055, z = 5}, {x = 794, y = 1062, z = 5}, 10, 8, 4, 4}
}
monsters = {
-- Tile AID = b[1], b[2] ;]
-- parter
[10201] = {"juggernaut", {x = 766, y = 1083, z = 7}},
[10202] = {"serpent spawn", {x = 780, y = 1083, z = 7}},
[10203] = {"ghastly dragon", {x = 794, y = 1083, z = 7}},
[10204] = {"nightmare", {x = 766, y = 1070, z = 7}},
[10205] = {"wyrm", {x = 780, y = 1070, z = 7}},
[10206] = {"hellfire fighter", {x = 794, y = 1070, z = 7}},
[10207] = {"destroyer", {x = 766, y = 1057, z = 7}},
[10208] = {"grim reaper", {x = 780, y = 1057, z = 7}},
[10209] = {"vampire", {x = 794, y = 1057, z = 7}},
-- pietro 1
[10210] = {"dragon", {x = 766, y = 1083, z = 6}},
[10211] = {"demon", {x = 780, y = 1083, z = 6}},
[10212] = {"frost dragon", {x = 794, y = 1083, z = 6}},
[10213] = {"hero", {x = 766, y = 1070, z = 6}},
[10214] = {"dragon lord", {x = 780, y = 1070, z = 6}},
[10215] = {"hydra", {x = 794, y = 1070, z = 6}},
[10216] = {"blue djinn", {x = 766, y = 1057, z = 6}},
[10217] = {"behemoth", {x = 780, y = 1057, z = 6}},
[10218] = {"giant spider", {x = 794, y = 1057, z = 6}},
-- 2 pietro
[10219] = {"warlock", {x = 766, y = 1083, z = 5}},
[10220] = {"undead dragon", {x = 780, y = 1083, z = 5}},
[10221] = {"dark torturer", {x = 794, y = 1083, z = 5}},
[10222] = {"bog raider", {x = 766, y = 1070, z = 5}},
[10223] = {"medusa", {x = 780, y = 1070, z = 5}},
[10224] = {"sea serpent", {x = 794, y = 1070, z = 5}},
[10225] = {"hellspawn", {x = 766, y = 1057, z = 5}},
[10226] = {"black knight", {x = 780, y = 1057, z = 5}},
[10227] = {"fury", {x = 794, y = 1057, z = 5}}
}
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
table.insert(creaturesList, creature.uid)
end
end
end
end
local creature = getTopCreature(position)
if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end
]]></config>
<movevent type="StepIn" actionid="10001-10027" event="script"><![CDATA[
domodlib('HuntAreaFunctions')
function onStepIn(cid, item, position, fromPosition)
local v = config[item.actionid]
function kickEvent(cid, item, position, fromPosition)
if (getCreaturesInRange(v[2], v[6], v[7], FALSE, TRUE) ~= 0 and getCreatureStorage(cid, 1111) > 0) then
doTeleportThing(cid, v[3])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doCreatureSetStorage(cid, 1111, -1)
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
if isPlayer(cid) then
stopEvent(pauseKick)
end
doCreatureSay(cid, "You have been kicked out from hunting room.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
end
end
if(exhaustion.check(cid, config.storage) == TRUE) then
doCreatureSay(cid, "You should wait " .. exhaustion.get(cid, config.storage) .. " seconds.", TALKTYPE_ORANGE_1, false, cid, fromPosition)
doTeleportThing(cid, fromPosition)
return TRUE
end
if getPlayerLevel(cid) >= v[5] then
local players = getCreaturesInRange(v[2], v[6], v[7], FALSE, TRUE)
if #players == 0 then
local creatures = getCreaturesInRange(v[2], v[6], v[7], TRUE, FALSE)
for i = 1, #creatures do
doRemoveCreature(creatures[i])
end
if isPlayer(cid) then
stopEvent(pauseKick)
end
if(getPlayerItemCount(cid, 2157) > 0) then
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doTeleportThing(cid, v[1])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerRemoveItem(cid, 2157, 1)
doCreatureSay(cid, "Now you have 20 minutes for hunting monsters, else you will be kicked out.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
doCreatureSetStorage(cid, 1111, 1)
pauseKick = addEvent(kickEvent, 20 * 60 * 1000, cid)
return TRUE
else
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doTeleportThing(cid, v[1])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, "Now you have 5 minutes for hunting monsters, else you will be kicked out.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
doCreatureSetStorage(cid, 1111, 1)
pauseKick = addEvent(kickEvent, 5 * 60 * 1000, cid)
return TRUE
end
else
doCreatureSay(cid, "There is someone else in the room.", TALKTYPE_ORANGE_1, false, cid, fromPosition)
end
else
doCreatureSay(cid, "You must be at least level " .. v[5] .. " or higher to enter.", TALKTYPE_ORANGE_1, false, cid, fromPosition)
end
doTeleportThing(cid, fromPosition)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
return TRUE
end
]]></movevent>
<movevent type="StepIn" actionid="10101-10127" event="script"><![CDATA[
domodlib('HuntAreaFunctions')
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) then
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
doCreatureSetStorage(cid, 1111, -1)
stopEvent(pauseKick)
end
end]]></movevent>
<movevent type="StepIn" actionid="10201-10227" event="script"><![CDATA[
domodlib('HuntAreaFunctions')
function onStepIn(cid, item, position, fromPosition)
local b = monsters[item.actionid]
if(isPlayer(cid) and exhaustion.check(cid, item.actionid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You should wait " .. exhaustion.get(cid, item.actionid) .. " seconds.")
elseif (isPlayer(cid)) then
if(getPlayerItemCount(cid, 2157) > 0) then
doSummonCreature(b[1], b[2])
doSendMagicEffect(b[2], CONST_ME_TELEPORT)
doSummonCreature(b[1], b[2])
doSendMagicEffect(b[2], CONST_ME_TELEPORT)
exhaustion.set(cid, item.actionid, 3)
else
doSummonCreature(b[1], b[2])
doSendMagicEffect(b[2], CONST_ME_TELEPORT)
exhaustion.set(cid, item.actionid, 6)
end
end
end]]></movevent>
</mod>
Last edited: