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

Bomberman Request!!

Johannes10

New Member
Joined
Mar 10, 2010
Messages
181
Reaction score
1
I have a problem with Bomberman .... the problem is that so can not use the lever ... I press the lever but nothing happens and I have no error or something ... so I would be very happy if someone could help me ....

my version is: The Forgotten Server version 0.3.6 (Crying Damson)
Compiled with GNU C + + version 3.4.5
 
Did you copy it into your map from my sample map? Have you registered it correctly in actions.xml, and set the correct UniqueID in editor? If the positions are different, have you configured everything properly?
 
I took your map and your scripts ----> http://otland.net/f81/bomberman-73864/ and I added the same postions..... and where i put the scripts ->: Talkaction.xml --> data/talkaction/ talkaction.xml. Bomb.lua -> Talkaction-> script. Lever.lua Talkaction-> script. powerups.lua Data -> movment -> script. Bombtiles Data -> movment script. Movment.xml data -> movment.xml
 
function getPlayersInRange(position, radiusx, radiusy)
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 then
table.insert(creaturesList, creature.uid)
end
end
end
end

local creature = getTopCreature(position)
if creature.type == 1 then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList





I put this in action/ script and xml?
 
data/actions/actions.xml
Code:
	<action uniqueid="10000" event="script" value="lever.lua"/>
data/actions/scripts/lever.lua
Code:
function getPlayersInRange(pos, rX, rY)
	local ret = {}
	for x = -rX, rX do
		for y = -rY, rY do
			local v = getTopCreature({x = pos.x+x, y = pos.y+y, z = pos.z}).uid
			if isPlayer(v) == TRUE then
				table.insert(ret, v)
			end
		end
	end
	return ret
end

local t, n, storage = {
	{x=496, y=537, z=9},
	{x=497, y=537, z=9},
	{x=498, y=537, z=9},
	{x=499, y=537, z=9}
}, {
	{x=490, y=495, z=9},
	{x=504, y=505, z=9},
	{x=504, y=495, z=9},
	{x=490, y=505, z=9}
}, {
	placed = 10001,
	max = 10002,
	radius = 10003
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1946 then
		return doTransformItem(item.uid, item.itemid - 1)
	end

	local v = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
	if #v > 0 then
		return doPlayerSendCancel(cid, "Please wait for the current match to end.")
	end

	local players = {}
	for i = 1, #t do
		local v = getTopCreature(t[i]).uid 
		players[i] = isPlayer(v) and v or nil
	end

	if #players < 2 then
		return doPlayerSendCancel(cid, "You need at least 2 players to enter.")
	end
	
	local first = players[1] and 1 or players[2] and 2 or players[3] and 3 or players[4] and 4
	for i = 1, 4 do
		if players[i] then
			setPlayerStorageValue(players[i], storage.placed, 0)
			setPlayerStorageValue(players[i], storage.max, 1)
			setPlayerStorageValue(players[i], storage.radius, 1)
			doSendMagicEffect(t[i], CONST_ME_TELEPORT)
			doTeleportThing(players[i], n[i])
			doSendMagicEffect(n[i], CONST_ME_TELEPORT)
		end
	end

	doTransformItem(item.uid, item.itemid + 1)
	return true
end
 
Look :S [08/04/2010 17:55:30] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/lever.lua)
[08/04/2010 17:55:30] cannot open data/actions/scripts/lever.lua: No such file or directory
[08/04/2010 17:55:30] >> Loading chat channels
 
AFF.... ITS SAME PROBLEM:((((((( [08/04/2010 18:09:42] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/lever.lua: No such file or directory
[08/04/2010 18:09:42] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/lever.lua)
[08/04/2010 18:09:43] cannot open data/actions/scripts/lever.lua: No such file or directory
 
copy an .lua file, paste in in "data - actions and the folder scripts"
rename the file "lever"
in the new .lua file named "lever", you copy and paste
Code:
function getPlayersInRange(pos, rX, rY)
	local ret = {}
	for x = -rX, rX do
		for y = -rY, rY do
			local v = getTopCreature({x = pos.x+x, y = pos.y+y, z = pos.z}).uid
			if isPlayer(v) == TRUE then
				table.insert(ret, v)
			end
		end
	end
	return ret
end

local t, n, storage = {
	{x=496, y=537, z=9},
	{x=497, y=537, z=9},
	{x=498, y=537, z=9},
	{x=499, y=537, z=9}
}, {
	{x=490, y=495, z=9},
	{x=504, y=505, z=9},
	{x=504, y=495, z=9},
	{x=490, y=505, z=9}
}, {
	placed = 10001,
	max = 10002,
	radius = 10003
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1946 then
		return doTransformItem(item.uid, item.itemid - 1)
	end

	local v = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
	if #v > 0 then
		return doPlayerSendCancel(cid, "Please wait for the current match to end.")
	end

	local players = {}
	for i = 1, #t do
		local v = getTopCreature(t[i]).uid 
		players[i] = isPlayer(v) and v or nil
	end

	if #players < 2 then
		return doPlayerSendCancel(cid, "You need at least 2 players to enter.")
	end
	
	local first = players[1] and 1 or players[2] and 2 or players[3] and 3 or players[4] and 4
	for i = 1, 4 do
		if players[i] then
			setPlayerStorageValue(players[i], storage.placed, 0)
			setPlayerStorageValue(players[i], storage.max, 1)
			setPlayerStorageValue(players[i], storage.radius, 1)
			doSendMagicEffect(t[i], CONST_ME_TELEPORT)
			doTeleportThing(players[i], n[i])
			doSendMagicEffect(n[i], CONST_ME_TELEPORT)
		end
	end

	doTransformItem(item.uid, item.itemid + 1)

	return true
end
i believe.
 
Back
Top