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

Orkhz

New Member
Joined
Sep 11, 2009
Messages
301
Reaction score
0
I'm using Crying Damson exe file and when I'm trying to type /clean the server crashes. How do I fix it? Rep for the person who fix the problem :)
 
I'm using Crying Damson exe file and when I'm trying to type /clean the server crashes. How do I fix it? Rep for the person who fix the problem :)

Well first of all, what version are you using? If you are using 0.3.5pl1, try replacing your clean.lua in data/talkactions/scripts folder with the code below:
Code:
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 removeLoadedFromMap = false
		local t = string.explode(param, ",")
		if(t[2]) then
			removeLoadedFromMap = getBooleanFromString(t[2])
		end

		doCleanTile(getCreaturePosition(cid), removeLoadedFromMap)
		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
The script above works, if it doesn't work for you your version is either not 0.3.5pl1 (commands differ from version to version) or you've edited something else that've destroyed the function.
 
[Warning - Event::loadScript] Event onThink not found (data/globalevents/scripts/clean.lua)

<globalevent name="clean" interval="7200" event="script" value="clean.lua"/>

That is what I got on my file
 
[Warning - Event::loadScript] Event onThink not found (data/globalevents/scripts/clean.lua)

<globalevent name="clean" interval="7200" event="script" value="clean.lua"/>

That is what I got on my file

I told you to put it in data/talkactions/scripts/clean.lua.

One question, is it the globalevent clean or the talkaction clean that doesn't work?
 
Yes on them all, there are no errors. Just that the server stop working and I have to restart it when I said "/clean" in-game
 
Yes on them all, there are no errors. Just that the server stop working and I have to restart it when I said "/clean" in-game

ARE YOU KIDDING ME!? I SAID: Please answer all questions. I won't be able to help you if you can't answer some simple questions...

These are the questions:
  • What are the error messages?
  • Are you sure you are using TFS Crying Damson 0.3.5pl1?
  • Did you reload/restart the server after adding the script?
  • Are you sure you put it where I told you?
 
Are you kidding me? I wrote YES ON THEM ALL, that means Yes on every question you just told me. I know that you are trying to help me and I appreciate it
 
Back
Top