• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Advanced Save

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Firstly you have to add this function:
http://otland.net/f35/dosavehouse-houseid-145403/

Then add this in lib/050-function.lua
LUA:
function valid(f)
	return function(p,...)
		if isCreature(p) then
			return f(p,...)
		end
	end
end
 
function savehouse(cid)
	local playerHouseId = getHouseByPlayerGUID(getPlayerGUID(cid))
	doSaveHouse(playerHouseId) 
end


Create advancedsave.lua in Data/talkactions/Scripts and add
LUA:
function onSay(cid, words, param, channel)
	if (words == "!save") then
		savehouse(cid)
		doPlayerSave(cid)
	end
return TRUE
end

Then add in talkactions.xml
XML:
 <talkaction words="!savet" event="script" value="advancedsave.lua"/>


Thank you Jetro.
 
Create advancedsave.lua in Data/talkactions/Scripts and add
Code:
function onSay(cid, words, param, channel)
	if ([COLOR="#FF0000"]words == "!save"[/COLOR]) then
		savehouse(cid)
		doPlayerSave(cid)
	end
return TRUE
end

Then add in talkactions.xml
Code:
 <talkaction [COLOR="#FF0000"]words="!savet"[/COLOR] event="script" value="advancedsave.lua"/>

The words dont even match, the script wont work. Plus this doesnt do anything to prevent cloning. If a player wants to clone they simple have to avoid saying !save.
 
Back
Top