PI
pedido

Talkactions

Por PirulitoLegal, 09 de set. de 2013 em Scripts

resolvido
7
1.4k
PirulitoLegalP
09 de setembro de 2013 às 17:30

Pessoal Queria uma talkactions Que O Pleyer Falase /commands ou !commands e mostra os comandos, Meu Servidor e Um Wodbo 8.0

 

 

Grato,Pirulito Legal!!

Editado Setembro 9 por PirulitoLegal

GustavoCastilhoG
09 de setembro de 2013 às 17:37

Quais comandos? Faça a listagem dos mesmos..

09 de setembro de 2013 às 17:40

Acho que o comando é igual !Spells,não precisa configurar ¬¬'

PirulitoLegalP
09 de setembro de 2013 às 17:40
!buyhouse

!online

!tradehouse

!frags


Esta aki Gustavo Castilho!

Editado Setembro 9 por PirulitoLegal

WillOliveiraW
09 de setembro de 2013 às 17:51

A lista de comandos vai aparecer quando você digitar !commands ou /commands, se você estiver com o god vai aparecer todos os comandos incluindo os do god, mas se você estiver com um player normal vai aparecer só os comandos que um player pode usar.

 

Tag talkactions.xml:

<talkaction words="/commands;!commands" event="script" value="commands.lua"/>

Script talkactions/scripts/commands.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, 1948, str)
	return true
end

Editado Setembro 9 por WillOliveira

PirulitoLegalP
09 de setembro de 2013 às 17:55

Lol Funfo REP+

1 mês depois...
OmegaO
31 de outubro de 2013 às 16:59

Tópico movido para a seção de dúvidas e pedidos resolvidos.