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

Action shows all functions

Capaverde

New Member
Joined
Sep 30, 2007
Messages
107
Reaction score
4
Code:
-- a Capaverde's production
local function sittable(k,v)
table.insert(tabela,{k,v})
end

local function sorttable(a,b) -- tried to put it into alphabetical order
return string.byte(a[1],1) < string.byte(b[1],1)
end

function onUse(cid, item, frompos, item2, topos)
tabela = {}
table.foreach(_G,sittable)
table.sort(tabela,sorttable)
for k,v in ipairs(tabela) do
if type(v[2]) == "function" then
doPlayerSendTextMessage(cid,22,v[1])
end
end
return 1
end
it gives you the name of all the existing functions at your global environment aka _G
 
Nvm! But i just need to check source for this Oo
 
Last edited:
Could be easier done, with alphabetic order :p

Code:
-- Made by Helveg
function onUse(cid, item, item2, topos, frompos)
	t = {}
	table.foreach(_G,function(k,v) table.insert(t,k) end)
	table.sort( t)
	doPlayerSendTextMessage(cid, 20, "Functions found:")
	for y = 1, #t do
		if type(_G[t[y]]) == "function" then
			doPlayerSendTextMessage(cid, 22, t[y])
		end
	end
	return 1
end
 
Last edited:
Could be easier done, with alphabetic order :p

Code:
-- Made by Helveg
function onUse(cid, item, item2, topos, frompos)
	t = {}
	table.foreach(_G,function(k,v) table.insert(t,k) end)
	table.sort( t)
	doPlayerSendTextMessage(cid, 20, "Functions found:")
	for y = 1, #t do
		if type(_G[t[y]]) == "function" then
			doPlayerSendTextMessage(cid, 22, t[y])
		end
	end
	return 1
end

wow, that's easier :(
 
Action ? ;/. Can it be Talkactions? /functions will be better for me xD. Please? :D.
here it goes:

Code:
function onSay(cid, words, param)
	local t = {}
	table.foreach(_G,function(k,v) table.insert(t,k) end)
	table.sort( t)
	doPlayerSendTextMessage(cid, 20, "Functions found:")
	for y = 1, #t do
		if type(_G[t[y]]) == "function" then
			doPlayerSendTextMessage(cid, 22, t[y])
		end
	end
	return 1
end

<talkaction words="/functions" script="pf.lua" />
 
Back
Top