Postado Agosto 13, 2016 8 anos Este é um post popular. EDITADO REMOVIDO A VERSÃO 0.4 QUE CONTIA! SE QUISER A VERSÃO 0.4 SÓ VER NO PERFIL DO ALEXY. Oi, vim trazer a função doPlayerOpenChannel para tfs 0.3.6 Essa função nada mais é que quando o player loga abre os chat selecionado no login.lua automaticamente Essa função é para 0.3.6 Versões testada: 8.54 Vamos ao código em LuaScript.cpp Procure: //getChannelUsers(channelId) lua_register(m_luaState, "getChannelUsers", LuaScriptInterface::luaGetChannelUsers); Adicione em baixo: //doPlayerOpenChannel(cid, channelId) lua_register(m_luaState, "doPlayerOpenChannel", LuaScriptInterface::luaDoPlayerOpenChannel); Continuando procure: int32_t LuaScriptInterface::internalGetPlayerInfo(lua_State* L, PlayerInfo_t info) Acima adicione: int32_t LuaScriptInterface::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 Procure por: static int32_t luaGetChannelUsers(lua_State* L); abaixo adicione: static int32_t luaDoPlayerOpenChannel(lua_State* L); Agora em data/creaturescripts/scripts/login.lua Antes do último return true Adicione: doPlayerOpenChannel(cid, 7) -- 7 é o número do channel para ver é em data/xml/channels.xml Rep não cai o dedo Editado Agosto 13, 2016 8 anos por MySticaL (veja o histórico de edições)
Postado Agosto 13, 2016 8 anos Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP. Spoiler Congratulations, your content has been approved! Thank you for your contribution, we of Tibia King we are grateful. Your content will help many other users, you received +1 REP.
Postado Agosto 13, 2016 8 anos Diretor esse ctrl+c e ctrl+v ? sendo que fiz pra tfs 0.4... aonde foi que eu permitir ? http://www.tibiaking.com/forum/forums/topic/68122-função-doplayeropenchannel-para-tfs-04/ Editado Agosto 13, 2016 8 anos por Alexy Brocanello (veja o histórico de edições)
Postado Agosto 13, 2016 8 anos Opaaa e esse ctrl+c , ctrl+v do alexy ae em ...copiando topico so pa ganhar rep, palhaçada ahsuahsu
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.