Postado Setembro 1, 2016 8 anos Em 13/08/2016 ás 16:42, MySticaL disse: 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 Ótimo contéudo REP +++
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.