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

Kozi

Search Hosting
Joined
Dec 24, 2008
Messages
259
Reaction score
0
Location
Poland !
Hi, i have problem with svar arena

When i put arena files to default server 0.3.1 it's working 100 % but when i put files to my rl map (world, actions etc) arena it's not working i think globalstorage is changing of 0 for X]]

When i stant on tp i have : -1 is now in the room, please wait but there nobody isn't and error in console




Help, rep+
 
Code:
function onStepIn(cid, item, position, fromPosition)
	if InitArenaScript == 0 then
		InitArenaScript = 1
		checkArenaRooms({})
	end
	local arena_room = item.actionid
	local player_arena = getPlayerStorageValue(cid, 42355)
	if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then
		if getGlobalStorageValue(cid, arena_room) == 0 then
			local monster_uid = getGlobalStorageValue(arena_room+100)
			if monster_uid > 0 then
				if isCreature(monster_uid) == TRUE then
					doRemoveCreature(monster_uid)
				end
			end
			local spawn_pos = getThingPos(arena_room)
			local monster = doSummonCreature(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})
			setGlobalStorageValue(arena_room+100, monster)
			doTeleportThing(cid, spawn_pos, TRUE)
			setGlobalStorageValue(arena_room, cid)
			setGlobalStorageValue(arena_room-1, 0)
			setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)
		else
			doTeleportThing(cid, fromPosition, TRUE)
			doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' jest teraz w tym pokuj. Zaczekaj chwile.')
		end
	else
		doTeleportThing(cid, fromPosition, TRUE)
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill monster!')
	end
	if arena_room == 42300 then
		setPlayerStorageValue(cid, 42351, 0)
		setPlayerStorageValue(cid, 42352, 1)
	end
	return TRUE
end

function checkArenaRooms(param)
	addEvent(checkArenaRooms, 1000, {})
	for i = 42300, 42309 do
		local player = getGlobalStorageValue(i)
		if isPlayer(player) == TRUE then
			local player_storage = getPlayerStorageValue(player, 42350)
			if player_storage <= os.time() then
				doTeleportThing(player, arenaKickPosition, TRUE)
				setPlayerStorageValue(player, 42350, 0)
				setGlobalStorageValue(i, 0)
				doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You kicked out from arena!')
			elseif player_storage - 10 <= os.time() then
				doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'You have ' .. player_storage - os.time() .. ' sec, to enter other room or you will be kicked from arena!')
			end
		else
			setGlobalStorageValue(i, 0)
		end
	end
end
 
Back
Top