Ir para conteúdo

JhonatanKing

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Obrigado
    JhonatanKing deu reputação a L3K0T em Função doPlayerOpenChannel para tfs 0.4   
    Olá pessoal, estava atrás dessa função doPlayerOpenChannel para tfs 0.4. O que essa função faz ? é simples essa função eh inserida em seu login.lua assim fazendo abrir um Canal tipo Help auto open e configurado. Ó vamos precisar da source para versão 8.60 tfs 0.4.
     
    primeiramente vamos abrir o arquivo LuaScript.cpp.
     
    Procura:
    //getChannelUsers(channelId) lua_register(m_luaState, "getChannelUsers", LuaInterface::luaGetChannelUsers);  
    add em baixo:
     
    //doPlayerOpenChannel(cid, channelId) lua_register(m_luaState, "doPlayerOpenChannel", LuaInterface::luaDoPlayerOpenChannel); procura:
    int32_t LuaInterface::internalGetPlayerInfo(lua_State* L, PlayerInfo_t info)  
    add acima:
     
    int32_t LuaInterface::luaDoPlayerOpenChannel(lua_State* L) { //doPlayerOpenChannel(cid, channelId) uint32_t channelId = popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(cid); if(player) lua_pushnumber(L, g_game.playerOpenChannel(cid, channelId) ? true : false); else { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushnumber(L, false); } return 1; }  
    agora em LuaScript.h
     
    procura
     
    static int32_t luaGetChannelUsers(lua_State* L); add em baixo:
     
    static int32_t luaDoPlayerOpenChannel(lua_State* L);  
    Agora eh só compilar há não esqueça de apagar tudo da pasta obg e o chache do linux caso não apague pode dar erro ao ligar o server... vlws pessoal tmj!
     
    Usando.
     
    doPlayerOpenChannel(cid, 9)
     
    9 = ID do chat em Channels.xml em Data/XML  boa sorte com seus scripts pegando essa função e colocar em login.lua ela abrirá o Chat Help senho o numero 9 ID do chat
     
    Vídeo:
     
     
     

Informação Importante

Confirmação de Termo