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

/clean , cleaning everything!

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hi otlanders!

I got a problem with my ot.
When i do /clean it cleans all items!
All items that i put in shops on otmapeditor disappears.
Please help me.

Im using Salvion44 8.1

Thanks in advance.:confused:
 
Use this script.. (for tfs 0.3.6)

PHP:
local cleanEvent = 0

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Collected " .. doCleanMap() .. " items.")
		return true
	end

	if(param == 'tile') then
		local removeLoaded, t = false, string.explode(param, ",")
		if(t[2]) then
			removeLoaded = getBooleanFromString(t[2])
		end

		doCleanTile(getCreaturePosition(cid), removeLoaded)
		return true
	end

	if(not tonumber(param)) then
		doPlayerSendCancel(cid, "Command requires numeric param.")
		return true
	end

	stopEvent(cleanEvent)
	prepareClean(tonumber(param), cid)
	return true
end

function prepareClean(minutes, cid)
	if(minutes == 0) then
		if(isPlayer(cid)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cleaned " .. doCleanMap() .. " items.")
		end

		doBroadcastMessage("Game map cleaned.")
	elseif(minutes > 0) then
		if(minutes == 1) then
			doBroadcastMessage("Game map cleaning in " .. minutes .. " minute, please pick up all your items.")
		else
			doBroadcastMessage("Game map cleaning in " .. minutes .. " minutes.")
		end

		cleanEvent = addEvent(prepareClean, 60000, minutes - 1, cid)
	end
end
 
Use this script.. (for tfs 0.3.6)

PHP:
local cleanEvent = 0

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Collected " .. doCleanMap() .. " items.")
		return true
	end

	if(param == 'tile') then
		local removeLoaded, t = false, string.explode(param, ",")
		if(t[2]) then
			removeLoaded = getBooleanFromString(t[2])
		end

		doCleanTile(getCreaturePosition(cid), removeLoaded)
		return true
	end

	if(not tonumber(param)) then
		doPlayerSendCancel(cid, "Command requires numeric param.")
		return true
	end

	stopEvent(cleanEvent)
	prepareClean(tonumber(param), cid)
	return true
end

function prepareClean(minutes, cid)
	if(minutes == 0) then
		if(isPlayer(cid)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cleaned " .. doCleanMap() .. " items.")
		end

		doBroadcastMessage("Game map cleaned.")
	elseif(minutes > 0) then
		if(minutes == 1) then
			doBroadcastMessage("Game map cleaning in " .. minutes .. " minute, please pick up all your items.")
		else
			doBroadcastMessage("Game map cleaning in " .. minutes .. " minutes.")
		end

		cleanEvent = addEvent(prepareClean, 60000, minutes - 1, cid)
	end
end

How will that fix anything? And use code tags instead of php

@topic, give the items unique ids in the map editor
 
Wow, that would be so much work if this problem was on my server. There has go to be an easier way to go about this.
 
Back
Top