Ir para conteúdo
Banner com Efeitos

Featured Replies

  • Respostas 10
  • Visualizações 377
  • Created
  • Última resposta

Top Posters In This Topic

Postado

local vocations = {297, 298, 299}        --Vocações. 
function sendEffect(cid)
    if isPlayer(cid) and isInArray(vocations, getPlayerVocation(cid)) then
        doSendMagicEffect(getThingPos(cid), 180)
        addEvent(sendEffect, 3 * 1000, cid)
    end
end
function onLogin(cid)
    sendEffect(cid)
    return true
end

não respondo pms solicitando suporte em programação/scripting

Postado

com esses scripts aparece na distro que os players logam e deslogam, e no client fica tentando logar e não acontece nada

Foi um erro bobo, esse aqui deve funcionar:

 

local voc = {
    [297] = 180,
    [298] = 180,
    [299] = 180,

}

function sendEffect(cid)
    if isPlayer(cid) and voc[getPlayerVocation(cid)] then
        doSendMagicEffect(getThingPos(cid), voc[getPlayerVocation(cid)])
        addEvent(sendEffect, 3 * 1000, cid)
    end
end

function onLogin(cid)
    return sendEffect(cid)
end
[id da vocação] = efeito que ela vai soltar,
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Postado

Foi um erro bobo, esse aqui deve funcionar:

local voc = {    [297] = 180,    [298] = 180,    [299] = 180,}function sendEffect(cid)    if isPlayer(cid) and voc[getPlayerVocation(cid)] then        doSendMagicEffect(getThingPos(cid), voc[getPlayerVocation(cid)])        addEvent(sendEffect, 3 * 1000, cid)    endendfunction onLogin(cid)    return sendEffect(cid)end
[id da vocação] = efeito que ela vai soltar,
talvez seja porque onLogin() está retornando uma função que não possui um return, então onLogin() retorna o sendEffect e false.

coloca um return true em sendEffect ou no próprio onLogin()

sendEffect()

return true

Ou

return sendEffect(), true

Editado por HallsSantos (veja o histórico de edições)

Postado

talvez seja p talvez seja porque onLogin() está retornando uma função que não possui um return, então onLogin() retorna o sendEffect e false.

coloca um return true em sendEffect ou no próprio onLogin()

sendEffect()

return true

Ou

return sendEffect(), true

Realmente pode ser isso, então, aqui está:

 

local voc = {
    [297] = 180,
    [298] = 180,
    [299] = 180,

}

function sendEffect(cid)
    if isPlayer(cid) and voc[getPlayerVocation(cid)] then
        doSendMagicEffect(getThingPos(cid), voc[getPlayerVocation(cid)])
        addEvent(sendEffect, 3 * 1000, cid)
    end
    return true
end

function onLogin(cid)
    return sendEffect(cid)
end
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

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