Ir para conteúdo

[ Resolvido ]me Ajudem Com Esse Error No Comando !online /r


Posts Recomendados

No Comando /online da esse error 'getConfigValue'

e no comando /r da esse error 'getCreatureLookPosition'

 

Me Ajudem aew meu ot e 7.92!

Editado por geovanejr
Link para o comentário
https://xtibia.com/forum/topic/122819-resolvido-me-ajudem-com-esse-error-no-comando-online-r/
Compartilhar em outros sites

Na pasta Talkactions\scripts, pegue os scripts do !Online (/online) e /r e poste o conteúdo deles aqui. Além disso, poste uma SS (foto) do erro.

 

 

!Online

 

local config = {

showGamemasters = getBooleanFromString(configGetValue('displayGamemastersWithOnlineCommand'))

}

 

function onSay(cid, words, param, channel)

local players = getPlayersOnline()

local strings = {""}

 

local i, position = 1, 1

local added = false

for _, pid in ipairs(players) do

if(added) then

if(i > (position * 7)) then

strings[position] = strings[position] .. ","

position = position + 1

strings[position] = ""

else

strings[position] = i == 1 and "" or strings[position] .. ", "

end

end

 

if((config.showGamemasters or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) or not getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then

strings[position] = strings[position] .. creatureGetName(cid) .. " [" .. getPlayerLevel(cid) .. "]"

i = i + 1

added = true

else

added = false

end

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:")

for i, str in ipairs(strings) do

if(str:sub(str:len()) ~= ",") then

str = str .. "."

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)

end

 

return true

end

/r

 

function onSay(cid, words, param, channel)

local toPos = getCreatureLookPosition(cid)

if(isInArray({"full", "all"}, param:lower())) then

doCleanTile(toPos, false)

doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)

return true

end

 

local amount = 1

param = tonumber(param)

if(param) then

amount = param

end

 

toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE

local tmp = getThingFromPos(toPos)

if(tmp.uid ~= 0) then

if(isCreature(tmp.uid)) then

doRemoveCreature(tmp.uid)

else

doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))

end

 

doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)

return true

end

 

toPos.stackpos = STACKPOS_TOP_FIELD

tmp = getThingFromPos(toPos)

if(tmp.uid ~= 0) then

doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))

doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)

return true

end

 

toPos.stackpos = STACKPOS_TOP_CREATURE

tmp = getThingFromPos(toPos)

if(tmp.uid ~= 0) then

doRemoveCreature(tmp.uid)

doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)

return true

end

 

for i = 5, 1, -1 do

toPos.stackpos = i

tmp = getThingFromPos(toPos)

if(tmp.uid ~= 0) then

if(isCreature(tmp.uid)) then

doRemoveCreature(tmp.uid)

else

doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))

end

 

doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)

return true

end

end

 

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return true

end

 

 

SS:!Online

 

 

post-257290-1257341682_thumb.jpg

 

 

 

 

SS: /r

 

 

post-257290-1257341785_thumb.jpg

 

 

 

 

Só clica na imagem aew pq saiu mal parece.

 

 

1º erro: !online

 

Abra o arquivo config.lua e verifique com CRTL+F se existe o seguinte argumento:

 

displayGamemastersWithOnlineCommand

 

Se não existir, adicione ele desse modo:

 

displayGamemastersWithOnlineCommand = 0

0 = Não mostra GM no !online.

1 = Mostra GM no !online.

 

~~

 

2º erro: /r

 

Verifique se o erro ocorre caso você fala /r ou não e responda nesse tópico.

 

Se quiser pode testar o meu:

 

function onSay(cid, words, param, channel)
    local amount = 1
    param = tonumber(param)
    if(param) then
        amount = tonumber(param)
    end

    local toPos = getCreatureLookPosition(cid)
    toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE

    local tmp = getThingFromPos(toPos)
    if(tmp.uid ~= 0) then
        if(isCreature(tmp.uid)) then
            doRemoveCreature(tmp.uid)
        else
            doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))
        end

        doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
        return true
    end

    toPos.stackpos = STACKPOS_TOP_FIELD
    tmp = getThingFromPos(toPos)
    if(tmp.uid ~= 0) then
        doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))
        doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
        return true
    end

    toPos.stackpos = STACKPOS_TOP_CREATURE
    tmp = getThingFromPos(toPos)
    if(tmp.uid ~= 0) then
        doRemoveCreature(tmp.uid)
        doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
        return true
    end

    for i = 5, 1, -1 do
        toPos.stackpos = i
        tmp = getThingFromPos(toPos)
        if(tmp.uid ~= 0) then
            if(isCreature(tmp.uid)) then
                doRemoveCreature(tmp.uid)
            else
                doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))
            end

            doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
            return true
        end
    end

    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    return true
end

lucas meu ot e 7.92 e certo colocar aonde esse displayGamemastersWithOnlineCommand?

e respondendo a sua resposta.

Verifique se o erro ocorre caso você fala /r ou não e responda nesse tópico.

sim o erro ocorre quando eu tento falar /r

 

manow eu queria um comando !online no meu ot que falasse o tanto de player online, o nome, e o lvl.

ai eu peguei esse online de ot 8.5.

caso o problema nao seja resolvido vc pode me ajudar com esse comando?

 

e o comando /r tbm peguei de ot 8.5 pq 7.92 nao tem ai eu quero um comando tipo esse que apagara tal item, no 7.92 tem o /clean so que ele apaga tudo.

e seu comando que vc me mando do /r ta dando o msm erro do meu.

Editado por geovanejr

Coloque esse comando em uma linha vazia qualquer do config.lua:

 

displayGamemastersWithOnlineCommand = 0

 

~~

 

Acho que seu OT não tem o comando getCreatureLookPosition(), tente esse:

 

getCreatureLookDir(cid)

 

É só substituir um pelo outro.

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...