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

Arena Lever Request!!

Ok, here is one, but its not the best one,
If only one player try to use the levler
this error appear
PHP:
[24/04/2010 14:29:56] Lua Script Error: [Action Interface] 
[24/04/2010 14:29:56] data/actions/scripts/other/arenalever.lua:onUse

[24/04/2010 14:29:56] internalGetPlayerInfo(). Player not found

But thats nothing in my opinion. and i'm to lazy to fix it XD
but here is the script
arenalever.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local firstPlayerPosition = {x = 1040, y = 987, z = 8, stackpos = STACKPOS_TOP_CREATURE}
	local getFirstPlayer = getThingFromPos(firstPlayerPosition)
	local secondPlayerPosition = {x = 1040, y = 989, z = 8, stackpos = STACKPOS_TOP_CREATURE}
	local getSecondPlayer = getThingFromPos(secondPlayerPosition)
	local arenaLevel = 25
	local firstPlayerLevel = getPlayerLevel(getFirstPlayer.uid)
	local secondPlayerLevel = getPlayerLevel(getSecondPlayer.uid)
	local newFirstPlayerPosition = {x = 1043, y = 988, z = 9}
	local newSecondPlayerPosition = {x = 1050, y = 988, z = 9}
	if(item.uid == 7001) then
		if(getFirstPlayer.itemid > 0 and getSecondPlayer.itemid > 0) then
			if(firstPlayerLevel >= arenaLevel and secondPlayerLevel >= arenaLevel) then
				for arenax = 1041, 1052 do
					for arenay = 985, 991 do
						local arenaPosition = {x=arenax, y=arenay, z=9, 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 == 1945) then
					doTransformItem(item.uid, 1946)
				elseif(item.itemid == 1946) then
					doTransformItem(item.uid, 1945)
				end
				doSendMagicEffect(firstPlayerPosition, 2)
				doSendMagicEffect(secondPlayerPosition, 2)
				doTeleportThing(getFirstPlayer.uid, newFirstPlayerPosition)
				doTeleportThing(getSecondPlayer.uid, newSecondPlayerPosition)
				doSendMagicEffect(newFirstPlayerPosition, 10)
				doSendMagicEffect(newSecondPlayerPosition, 10)
				doPlayerSendTextMessage(getFirstPlayer.uid, 18, "FIGHT!")
				doPlayerSendTextMessage(getSecondPlayer.uid, 18, "FIGHT!")
			else
				doPlayerSendCancel(cid, "Both fighters must have level 25.")
			end
		else
			doPlayerSendCancel(cid, "You need 2 players for a duel.")
		end
	end
	return TRUE
end

And here is the action.xml
PHP:
        <action uniqueid="7001" event="script" value="other/arenalever.lua" />

Rep+ if you use it and it work xD
 
Thanks for the script but im trying it but it doesnt work:S i got errors


[24/04/2010 23:13:40] [Error - Action Interface]
[24/04/2010 23:13:40] data/actions/scripts/other/arenalever.lua:eek:nUse
[24/04/2010 23:13:40] Description:
[24/04/2010 23:13:40] (internalGetPlayerInfo) Player not found when requesting player info #3

Can someone fix please?
 
Thanks for the script but im trying it but it doesnt work:S i got errors


[24/04/2010 23:13:40] [Error - Action Interface]
[24/04/2010 23:13:40] data/actions/scripts/other/arenalever.lua:eek:nUse
[24/04/2010 23:13:40] Description:
[24/04/2010 23:13:40] (internalGetPlayerInfo) Player not found when requesting player info #3

Can someone fix please?

That is just when one player are using it right?
 
I need to fixe just some other stuff before, im installing photoshop and downloading a movie and do some scripts to my ot XD so im litle busy :)

Japp jag är så svenne man kan bli XD
 
HERE:

PHP:
-- pvp arena lever

function onUse(cid, item, frompos, item2, topos)

	if item.uid == 7001 and item.itemid == 1945 then
		player1pos = {x=119, y=35, z=9, stackpos=253}
		player1 = getThingfromPos(player1pos)

		player2pos = {x=130, y=35, z=9, stackpos=253}
		player2 = getThingfromPos(player2pos)

		if player1.itemid > 0 and player2.itemid > 0 then
			arenalevel = 25
			player1level = getPlayerLevel(player1.uid)
			player2level = getPlayerLevel(player2.uid)

			if player1level >= arenalevel and player2level >= arenalevel then
				for arenax = 121,128 do
					for arenay = 33,37 do
						arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
						arenacreature = getThingfromPos(arenapos)

						if arenacreature.itemid > 0 then
							doPlayerSendCancel(cid,"Wait for current duel to end.")
							return 1
						end
					end
				end

				nplayer1pos = {x=121, y=35, z=9}
				nplayer2pos = {x=128, y=35, z=9}

				doSendMagicEffect(player1pos,2)
				doSendMagicEffect(player2pos,2)

				doTeleportThing(player1.uid,nplayer1pos)
				doTeleportThing(player2.uid,nplayer2pos)

				doSendMagicEffect(nplayer1pos,10)
				doSendMagicEffect(nplayer2pos,10)

				doPlayerSendTextMessage(player1.uid,18,"FIGHT!")
				doPlayerSendTextMessage(player2.uid,18,"FIGHT!")
			else
				doPlayerSendCancel(cid,"Both fighters must have level 25.")
			end
		else
			doPlayerSendCancel(cid,"You need 2 players for a duel.")
		end
	else
		return 0
   	end

	return 1
end
 
Look what error i got :S

[25/04/2010 17:19:28] [Error - Action Interface]
[25/04/2010 17:19:28] data/actions/scripts/other/arenalever.lua:eek:nUse
[25/04/2010 17:19:28] Description:
[25/04/2010 17:19:28] (luaGetThingFromPos) Tile not found
 
I think is this .... i havent change someting here i dont know what it mean :S

Maybe is this? need to change someting?

if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 121,128 do
for arenay = 33,37 do
arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
arenacreature = getThingfromPos(arenapos)
 
Back
Top