local config = {
ingameGuilds = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}
function onSay(cid, words, param, channel)
if(not checkExhausted(cid, 666, 10)) then
return false
end
local playerAccess, t = getPlayerAccess(cid), {}
for i, talk in ipairs(getTalkActionList()) do
if(not talk.hidden and playerAccess >= talk.access) then
if(config.ingameGuilds or (talk.functionName ~= "guildjoin" and talk.functionName ~= "guildcreate")) 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, 6533, str)
return true
end
PHP:local config = { ingameGuilds = getBooleanFromString(getConfigValue('ingameGuildManagement')) } function onSay(cid, words, param, channel) if(not checkExhausted(cid, 666, 10)) then return false end local playerAccess, t = getPlayerAccess(cid), {} for i, talk in ipairs(getTalkActionList()) do if(not talk.hidden and playerAccess >= talk.access) then if(config.ingameGuilds or (talk.functionName ~= "guildjoin" and talk.functionName ~= "guildcreate")) 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, 6533, str) return true end
Test this.
if thats not correct idk what is he looking forWTF that has nothign to do with what he asked
local config = {
listItemId = 1966,
staffCommands = {
'/ban',
'/ipban',
'/unban',
'/up',
'/down',
'/c',
'/goto',
'/owner',
'/t',
'/town',
'/a',
'/pos',
'/info',
'/r',
'/kick',
'/openserver',
'/closeserver',
'/B',
'/m',
'/i',
'/s',
'/addtutor',
'/removetutor',
'/looktype',
'/summon',
'/chameleon',
'/addskill',
'/mccheck',
'/ghost',
'/clean',
'/hide',
'/save',
'/gm'
},
playerCommands = {
'!buypremium',
'!buyhouse',
'!leavehouse',
'!changesex',
'!uptime',
'!deathlist',
'!kills',
'!online',
'!serverinfo'
}
}
function onSay(cid, words, param)
local player = Player(cid)
local storeCommands = {}
local text = ''
local line = 0
if player:getGroup():getAccess() then
for i = 1, #config.staffCommands do
storeCommands[#storeCommands + 1] = config.staffCommands[i]
end
for i = 1, #config.playerCommands do
storeCommands[#storeCommands + 1] = config.playerCommands[i]
end
text = text .. 'Commands:'
for _, t in ipairs(storeCommands) do
line = line + 1
text = text ..'\n '.. line ..'. '.. t ..''
end
player:showTextDialog(config.listItemId, text)
else
for i = 1, #config.playerCommands do
storeCommands[#storeCommands + 1] = config.playerCommands[i]
end
text = text .. 'Commands:'
for _, t in ipairs(storeCommands) do
line = line + 1
text = text ..'\n '.. line ..'. '.. t ..''
end
player:showTextDialog(config.listItemId, text)
end
return false
end
I would done something like this:
Code:local config = { listItemId = 1966, staffCommands = { '/ban', '/ipban', '/unban', '/up', '/down', '/c', '/goto', '/owner', '/t', '/town', '/a', '/pos', '/info', '/r', '/kick', '/openserver', '/closeserver', '/B', '/m', '/i', '/s', '/addtutor', '/removetutor', '/looktype', '/summon', '/chameleon', '/addskill', '/mccheck', '/ghost', '/clean', '/hide', '/save', '/gm' }, playerCommands = { '!buypremium', '!buyhouse', '!leavehouse', '!changesex', '!uptime', '!deathlist', '!kills', '!online', '!serverinfo' } } function onSay(cid, words, param) local player = Player(cid) local storeCommands = {} local text = '' local line = 0 if player:getGroup():getAccess() then for i = 1, #config.staffCommands do storeCommands[#storeCommands + 1] = config.staffCommands[i] end for i = 1, #config.playerCommands do storeCommands[#storeCommands + 1] = config.playerCommands[i] end text = text .. 'Commands:' for _, t in ipairs(storeCommands) do line = line + 1 text = text ..'\n '.. line ..'. '.. t ..'' end player:showTextDialog(config.listItemId, text) else for i = 1, #config.playerCommands do storeCommands[#storeCommands + 1] = config.playerCommands[i] end text = text .. 'Commands:' for _, t in ipairs(storeCommands) do line = line + 1 text = text ..'\n '.. line ..'. '.. t ..'' end player:showTextDialog(config.listItemId, text) end return false end
https://otland.net/threads/commands-for-1-0-1-1-1-2.242151/Thank you very much, old post, still very usefull for me. (Runing on TFS 1.2)