Ir para conteúdo

Featured Replies

Postado

Fala galera! do TK..
seguinte estou precisando muito que me ajudem..
eu tenho o talkaction do /kick mais ele nao ta funcionando!
quando coloco "/kick nameplayer" parece a msg comum como se nao estivesse usando comando
e da esse erro na distro:
 

Spoiler

[22:28:16.883] [Error - TalkAction Interface]
[22:28:16.885] data/talkactions/scripts/kick.lua:onSay
[22:28:16.889] Description:
[22:28:16.890] data/lib/arenapvp.lua:46: attempt to index local 'toPos' (a number value)
[22:28:16.900] stack traceback:
[22:28:16.902]  data/lib/arenapvp.lua:46: in function 'doRemoveCreature'
[22:28:16.907]  data/talkactions/scripts/kick.lua:24: in function <data/talkactions/scripts/kick.lua:1>

 


e aqui esta o script:

    <talkaction log="yes" words="/kick" access="3" event="script" value="kick.lua"/>

Spoiler

function onSay(cid, words, param, channel)
    local pid = 0
    if(param == '') then
        pid = getCreatureTarget(cid)
        if(pid == 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
            return true
        end
    else
        pid = getPlayerByNameWildcard(param)
    end

    if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
        return true
    end

    if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot kick this player.")
        return true
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been kicked.")
    doRemoveCreature(pid)
    return true
end

 


alguem me ajuda ai

 

 

 

  • Respostas 7
  • Visualizações 331
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Olá @Leomonti não sei qual a versão do seu ot, mas o meu funcional 8.60 TFS 0.4 ta assim

 

No Talkaction.xml

<talkaction log="yes" words="/kick" access="4" event="script" value="kick.lua"/>

E no script 

function onSay(cid, words, param, channel)
local pid = 0
if(param == '') then
pid = getCreatureTarget(cid)
if(pid == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end
else
pid = getPlayerByNameWildcard(param)
end
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
return TRUE
end
if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot kick this player.")
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been kicked.")
doRemoveCreature(pid)
return TRUE
end

 

Ai no game é só dar /kick NOME

 

Veja se funciona! Mas faça um backup antes! abraço

Postado
  • Autor
51 minutos atrás, lucasprimolemos disse:

Olá @Leomonti não sei qual a versão do seu ot, mas o meu funcional 8.60 TFS 0.4 ta assim

 

No Talkaction.xml


<talkaction log="yes" words="/kick" access="4" event="script" value="kick.lua"/>

E no script 


function onSay(cid, words, param, channel)
local pid = 0
if(param == '') then
pid = getCreatureTarget(cid)
if(pid == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end
else
pid = getPlayerByNameWildcard(param)
end
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
return TRUE
end
if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot kick this player.")
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been kicked.")
doRemoveCreature(pid)
return TRUE
end

 

Ai no game é só dar /kick NOME

 

Veja se funciona! Mas faça um backup antes! abraço

opa! obrigado pela atenção mais deu o mesmo erro! :/
oque pode ser?

eu falo
23:34 Rolezin has been kicked.
23:34 GOD Furious: /k rolezin
aparece ate a msg assim
mais o player nao some
tbm uso tfs 0.4

Postado

Qual a versão do seu TFS? Se for 0.3.6 tenta o que já vem na pasta:

function onSay(cid, words, param, channel)
	local pid = 0
	if(param == '') then
		pid = getCreatureTarget(cid)
		if(pid == 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
			return true
		end
	else
		pid = getPlayerByNameWildcard(param)
	end

	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
		return true
	end

	if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot kick this player.")
		return true
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been kicked.")
	doRemoveCreature(pid)
	return true
end

Só toma cuidado no xml:

 

<talkaction log="yes" words="/kick" access="3" event="script" value="kick.lua"/>

Access é o groupid mínimo pra usar aquilo, vai em data/xml/groups.xml e vê a groupid que você quer aí.

O seu é praticamente o que vem na pasta, então checa o access mesmo.

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Postado
1 hora atrás, Leomonti disse:

opa! obrigado pela atenção mais deu o mesmo erro! :/
oque pode ser?

eu falo
23:34 Rolezin has been kicked.
23:34 GOD Furious: /k rolezin
aparece ate a msg assim
mais o player nao some
tbm uso tfs 0.4

 

Verifica se o seu GOD ta com acess maior que 4.

 

Tenta o código do @rogaforyn2 quem sabe da certo

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo