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

PVP-Arena error..

Donio

Banned User
Joined
Jun 24, 2008
Messages
4,004
Reaction score
16
Location
Manhattan, New York
Hey I get this error in my console..

Code:
[Error - LuaScriptInterface::loadFile] data/actions/scripts/other/arenalever.lua:6: '}' expected (to close '{' at line 3) near '{'
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/arenalever.lua)
data/actions/scripts/other/arenalever.lua:6: '}' expected (to close '{' at line 3) near '{'

cant rly find the problem :s
 
Lol sorry forgot xD

Code:
local arenas = {
	[7001] = {
		fromPos ={
			{x = 776, y = 1305, z = 7}, --player 1 start pos
			{x = 777, y = 1306, z = 7} --player 2 start pos
			{x = 775, y = 1306, z = 7} --player 3 start pos
			{x = 776, y = 1307, z = 7} --player 4 start pos
											--you can add how much you want, there are no limits
		},

		toPos = {
			{x = 772, y = 1293, z = 7}, --player 1 teleport position
			{x = 767, y = 1297, z = 7} --player 2 teleport position
			{x = 777, y = 1297, z = 7} --player 3 teleport position
			{x = 772, y = 1302, z = 7} --player 4 teleport position

											--you can add how much you want, there are no limits
		}
	}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 9825) then
		doTransformItem(item.uid, 9826)
		return TRUE
	end
 
	local arena = arenas[item.uid]
	if(not arena) then
		return FALSE
	end
 
	local players = {}
	for _, pos in pairs(arena.fromPos) do
		pos.stackpos = STACKPOS_TOP_CREATURE
		local tmp = getThingfromPos(pos).uid
		if(tmp > 0 and isCreature(tmp) == TRUE) then
			table.insert(players, tmp)
		end
	end
 
	if(table.maxn(players) < table.maxn(arena.fromPos)) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 3 players for duel.")
		return TRUE
	end
 
	for i, pid in pairs(players) do
		doSendMagicEffect(arena.fromPos[i], CONST_ME_POFF)
		doTeleportThing(pid, arena.toPos[i])
		doSendMagicEffect(arena.toPos[i], CONST_ME_TELEPORT)
		doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "FIGHT!")
	end
 
	return TRUE
end
 
Code:
local arenas = {
	[7001] = {
		fromPos ={
			{x = 776, y = 1305, z = 7}, --player 1 start pos
			{x = 777, y = 1306, z = 7}, --player 2 start pos
			{x = 775, y = 1306, z = 7}, --player 3 start pos
			{x = 776, y = 1307, z = 7} --player 4 start pos
											--you can add how much you want, there are no limits
		},

		toPos = {
			{x = 772, y = 1293, z = 7}, --player 1 teleport position
			{x = 767, y = 1297, z = 7}, --player 2 teleport position
			{x = 777, y = 1297, z = 7}, --player 3 teleport position
			{x = 772, y = 1302, z = 7} --player 4 teleport position

											--you can add how much you want, there are no limits
		}
	}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 9825) then
		doTransformItem(item.uid, 9826)
		return TRUE
	end
 
	local arena = arenas[item.uid]
	if(not arena) then
		return FALSE
	end
 
	local players = {}
	for _, pos in pairs(arena.fromPos) do
		pos.stackpos = STACKPOS_TOP_CREATURE
		local tmp = getThingfromPos(pos).uid
		if(tmp > 0 and isCreature(tmp) == TRUE) then
			table.insert(players, tmp)
		end
	end
 
	if(table.maxn(players) < table.maxn(arena.fromPos)) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 3 players for duel.")
		return TRUE
	end
 
	for i, pid in pairs(players) do
		doSendMagicEffect(arena.fromPos[i], CONST_ME_POFF)
		doTeleportThing(pid, arena.toPos[i])
		doSendMagicEffect(arena.toPos[i], CONST_ME_TELEPORT)
		doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "FIGHT!")
	end
 
	return TRUE
end
 
hum.. people get skull inside the arena.. Also when they kill some one the player actually dies and goes to temple with lvl lost :S

Edit: Added pvp-zone tool on the arena.. but player still dies :s
 
insted of new thread i'll say this here.. How do i get this fixed..

Code:
Failed connecting to database - MYSQL ERROR: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (2002)

It is runing on Linux.
 
Nvm the post above.. I solved it..

BACK to arena..

I get this message when players pull the lever:

Code:
[Error - Action Interface] 
data/actions/scripts/other/arenalever.lua:onUse
Description: 
(luaGetThingFromPos) Tile not found

And this is the script:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local firstPlayerPosition = {x = 776, y = 1305, z = 7, stackpos = STACKPOS_TOP_CREATURE}
	local getFirstPlayer = getThingFromPos(firstPlayerPosition)
	local secondPlayerPosition = {x = 777, y = 1306, z = 7, stackpos = STACKPOS_TOP_CREATURE}
	local getSecondPlayer = getThingFromPos(secondPlayerPosition)
	local thirdPlayerPosition = {x = 775, y = 1306, z = 7, stackpos = STACKPOS_TOP_CREATURE}
	local getThirdPlayer = getThingFromPos(thirdPlayerPosition)
	local fourthPlayerPosition = {x = 776, y = 1307, z = 7, stackpos = STACKPOS_TOP_CREATURE}
	local getFourthPlayer = getThingFromPos(fourthPlayerPosition)

	local arenaLevel = 25
	local newFirstPlayerPosition = {x = 772, y = 1293, z = 7}
	local newSecondPlayerPosition = {x = 767, y = 1297, z = 7}
	local newThirdPlayerPosition = {x = 777, y = 1297, z = 7}
	local newFourthPlayerPosition = {x = 772, y = 1302, z = 7}	
	if(item.uid == 7001) then
		if(getFirstPlayer.itemid > 0 and getSecondPlayer.itemid > 0 and getThirdPlayer.itemid > 0 and getFourthPlayer.itemid > 0) then
			if(getPlayerLevel(getFirstPlayer.uid) >= arenaLevel and getPlayerLevel(getSecondPlayer.uid) >= arenaLevel and getPlayerLevel(getThirdPlayer.uid) >= arenaLevel and getPlayerLevel(getFourthPlayer.uid) >= arenaLevel) then
				for arenax = 764, 1290 do
					for arenay = 779, 1304 do
						local arenaPosition = {x=arenax, y=arenay, z=7, stackpos=253}
						local arenaCreature = getThingFromPos(arenaPosition)
						if(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == FALSE) then
							if(isMonster(arenaCreature.uid) == TRUE) then
								doRemoveCreature(arenaCreature.uid)
							end
						elseif(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == TRUE) then
							doPlayerSendCancel(cid, "Wait for current duel to end.")
							return TRUE
						end
					end
				end
				if(item.itemid == 9825) then
					doTransformItem(item.uid, 9826)
				elseif(item.itemid == 9826) then
					doTransformItem(item.uid, 9825)
				end
				doSendMagicEffect(firstPlayerPosition, 2)
				doSendMagicEffect(secondPlayerPosition, 2)
				doSendMagicEffect(thirdPlayerPosition, 2)
				doSendMagicEffect(fourthPlayerPosition, 2)				
				doTeleportThing(getFirstPlayer.uid, newFirstPlayerPosition)
				doTeleportThing(getSecondPlayer.uid, newSecondPlayerPosition)
				doTeleportThing(getThirdPlayer.uid, newThirdPlayerPosition)
				doTeleportThing(getFourthPlayer.uid, newFourthPlayerPosition)				
				doSendMagicEffect(newFirstPlayerPosition, 10)
				doSendMagicEffect(newSecondPlayerPosition, 10)
				doSendMagicEffect(newThirdPlayerPosition, 10)
				doSendMagicEffect(newFourthPlayerPosition, 10)
				doPlayerSendTextMessage(getFirstPlayer.uid, 18, "FIGHT!")
				doPlayerSendTextMessage(getSecondPlayer.uid, 18, "FIGHT!")				
				doPlayerSendTextMessage(getThirdPlayer.uid, 18, "FIGHT!")
				doPlayerSendTextMessage(getFourthPlayer.uid, 18, "FIGHT!")
			else
				doPlayerSendCancel(cid, "Both fighters must have level 25.")
			end
		else
			doPlayerSendCancel(cid, "You need 4 players for a duel.")
		end
	end
	return TRUE
end
 
Back
Top