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

Area tfs 0.4 dev.

sturnusek

hehe
Joined
May 6, 2010
Messages
52
Reaction score
1
Location
lufbra
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/



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:
Może jak padnie, crash otsa, restart czy coś to nie czyści storage? nie czytałem kodu, nie chce mi się ale warto sprawdzić.
 
Nie bo ja nawet GM wchodziłem na arene i np jak szybko 5x wchodziłem-wychodziłem to mnie nie wywala, a za 2 próbą wchodzę szybko -wychodźcze 5x to wywala (normalnie raz tak, a raz tak).

Właśnie dodałem teraz stopEvent przed wejściem bo
doCreatureSetStorage(cid, 1111, 1)
to nie trzeba chyba bo to tylko zmienia z 1 na -1.
 
Last edited:
a nie widzisz ze jest takie coś? może najpierw przeczytaj 1 post, a później pisz?

Obecnie mam tak:

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)
	
		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(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
				elseif (getPlayerItemCount(cid, 2157) < 1) then
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	
				else
	
	doCreatureSay(cid, "Blad areny zglos to Game-Masterowi.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
			doTeleportThing(cid, fromPosition)	
		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>

Może teraz będzie lepiej ? jak ktoś ma pomysły pisać.
 
Last edited:
Przeczytałem, że "szybko wchodziłeś" więc pomyślałem, że jednak nie ma exhausta ;s

Chodzi mi o exhaust na wchodzenie do roomu, a nie na kratke od monstera
 
Jest na to i na to zobacz ponownie z 1 post -.- Jak wychodzisz z room albo wchodzisz nadaje Ci 10 sek exh.
 
a może daje loga tuż przed kickiem i go kick omija?

ale on chyba (a przynajamniej powinien!) dał anty-loga

po za tym pisał w poście, że jak "szybko wchodził" to mu się bugowało.. Chociaż nie rozumiem tego, jak można bardzo szybko wchodzić jeśli jest exhausted o_O
 
Loga nie da rady na arenie (nawet ja stałem 5 min na areni) i mnie nieraz nie wywala.

GM testowałem tak zęby sprawdzić(na szybkie wchodzenie wychodzenie bo myślałem że to powód) ale skoro jest na playera exh to błąd tkwi w czymś innym.



Może w tym jest problem ?

function kickEvent(cid, item, position, fromPosition)
if (getCreaturesInRange(v[2], v[6], v[7], FALSE, TRUE) ~= 0 and getCreatureStorage(cid, 1111) > 0) then

getCreatureStorage(cid, 1111) > 0 <-- przecież to wygląda na to jeżeli jest większe czyli 1112 np a czasem nie powinno być
getCreatureStorage(cid, 1111,1) ? Obecnie to usunąłem i testuje ale chyba to nie problem?
 
Hahahahah
xddd


getPlayerStorageValue = getCreatureStorage

to działa na zasadzie, że sprawdza VALUE do KEY
niech GET = getPlayerStorageValue

GET(cid, key)
sprawdza jakie jest value dla klucza
można dodać potem warunek
if GET(cid, key) >= value then

np. GET(cid, 1200) >= 2 then


//edit
możliwe, że się da
if GET(cid, 1200, 2) == TRUE then

ale niewiem, nie sprawdzałem nigdy tak i nigdy nie widziałem by tak robiono, więc pewnie nie ma takiej opcji
 
Last edited:
ok błąd polega na tym że jak jest (automatyczny zapis serwera co 10 min) to nie wywala z areny;p Przykład wchodzimy na arene na 20 min a w 15 minucie ejst zapis serwera i Cie z areny nie wywala.

Kto wie dlaczego ? ;o
 
Wklej może swój skrypt na save, wgl czemu masz to w modzie? nie wygodniej np. movements/actions itd.? Mi wygodniej w każdym razie.
Hmm może też być tak, że Twój save "refreshuje" niektóre rzeczy, takie jak globalstorage, lub od razu zrzuca go do bazy, albo Save zapisuje graczowi storage do bazy, a normalnie jest tak, że tfs przechowuje w pamięci storage i zapisuje go dopiero po relogu postaci.
 
Lapaj :p

Wklejka #631240 | Wklej.org


A co to jest to

function executeSave()
doSaveServer(config.shallow)

shallow ?????????? jest na "no"


edit

ja myślę że to save cośś robi z
pauseKick = addEvent(kickEvent, 20 * 60 * 1000, cid)
pewnie na 0 ustawia czy coś pytanie dlaczego?
 
Last edited:
sprawdź sobie np.
zaloguj się na postać i zmień sobie storage na 23232, 1 i relognij, zobacz w bazie danych --> doda player_storage 23232 1
teraz zmień sobie komendą /storage nick, 23232, 5
NIE RELOGUJ! sprawdź bazę danych i powinno nadal tam być 23232 1, czekaj do save servera, jeśli po sav'ie w bazie danych będziesz miał storage 23232 5 to już masz odpowiedź.
 
Po sprawdzeniu to ani save ani storage ma coś zwalonego. Wg może przenieść to do movements ? może tam będzie lepiej działać? Dawno nie miałem takiego problemu :D

Przypomnę problem:
po prostu raz wywala po 5\20 min, a raz nie. Nie mam pojęcia dlaczego tak się dzieje.
Za każdym razem jest komunikat że możemy expić 5\20 min. Tylko z jakiegoś powodu addEvent usuwa no i gracza nie wywala. Kto ma pomysł co można jeszcze sprawdzić?


down\/

Proszę ładniej nie umiem xD specialnie dla Pana.
http://wklej.org/id/631543/
 
Last edited:
syf masz a nie skrypt, wez zrob porzadek tak jak sie nalezy przejzyscie to i blad bedzie mozna szukac.
 
wrzuciles funkcje do funkcji, tego sie nie robi, postaw ja na zewnatrz a w glownej funkcji tylko z niej korzystasz
 
#up

prawda jest taka, że w Lua może mieć. I jest to jak najbardziej na miejscu :eek:
jednakże w tym wypadku trzeba wypieprzyć kickEvent poza funkcję onStepIn i podawać kickEventowi inny parametr niż cid- np guid, lub name.
Dlaczego? Cid jest dynamiczne- wystarczy, że gracz przeloguje i sprawa załatwiona.
Wtedy zbierasz sobie prawidłowy cid gracza po guid lub name funkcją getPlayerByGUID lub getCreatureByName i jeśli istnieje takowy, to działasz- jeśli nie, to przerywasz skrypt.

Profit?

[email protected], mój paypal ;]
 
Back
Top