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

TalkAction (!commands)

gyahu

New Member
Joined
Nov 28, 2010
Messages
54
Reaction score
2
I don't know if it exist but i would like to include one to my server:
A TalkAction that tells you which TalkAction (commands) you can do.
If someone klnows please help me with it.
Thanks.
 
data/talkactions/scripts/commands.lua
Lua:
local config = {
	guildTalksEnabled = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}

function onSay(cid, words, param, channel)
	local playerAccess, t = getPlayerAccess(cid), {}
	for i, talk in ipairs(getTalkActionList()) do
		if(not talk.hide and playerAccess >= talk.access) then
			local tmp = talk.words:sub(1, 1):trim()
			if((guildTalksEnabled or (talk.words ~= "!joinguild" and talk.words ~= "!createguild")) and (tmp == "!" or tmp == "/")) then
				table.insert(t, talk)
			end
		end
	end

	table.sort(t, function(a, b) return a.access > b.access end)
	local lastAccess, str = -1, ""
	for i, talk in ipairs(t) do
		local line = ""
		if(lastAccess ~= talk.access) then
			if(i ~= 1) then
				line = "\n"
			end
			lastAccess = talk.access
		end
		str = str .. line .. talk.words .. "\n"
	end

	doShowTextDialog(cid, 2160, str)
	return true
end

talkactions.xml
XML:
<talkaction words="/commands" event="script" value="commands.lua"/>
 
Lua:
function onSay(cid, words, param)
local total_string = "The command is:\n"
local file = io.open("data/talkactions/talkactions.xml","r")
str = file:read(-1)
file:close()
stra = string.explode(str,"	")
for i=1, #stra do
 if stringcontains(stra[i],'access') then
    stre = string.explode(stra[i],'"')
    for i=1, #stre do
        if stre[i] == "words=" then
        total_string = total_string ..stre[i+1].." \n"  
        end
    end
 end
end
  doShowTextDialog(cid,2597, total_string)
end
 
Back
Top