bem facil resolver isso amigo.
abre 2 arquivos da sua source
"luascript.cpp"
e depois abre o
"luascript.h"
em luascript.cpp
procure por "doCreatureChannelSay" ou "doPlayerSendTextMessage"
E adicione abaixo:
//doPlayerOpenChannel(cid, channelId)
lua_register(m_luaState, "doPlayerOpenChannel", LuaInterface::luaDoPlayerOpenChannel);
depois, FAÇA NOVAMENTE a busca pelo "doCreatureChannelSay" ou "doPlayerSendTextMessage"
até chegar em uma função +/- assim:
int32_t LuaInterface::luaDoPlayerSendTextMessage(lua_State* L)
{
vai ter varias coisas dentro dessa função, então COM CUIDADO, após o fechamento dela
após o " } "
procure pela chave que fecha essa função, e adicione essa função abaixo:
int32_t LuaInterface::luaDoPlayerOpenChannel(lua_State* L)
{
//doPlayerOpenChannel(cid, channelId)
uint16_t channelId = popNumber(L);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getEnv();
if(env->getPlayerByUID(cid))
{
lua_pushboolean(L, g_game.playerOpenChannel(cid, channelId));
return 1;
}
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
IMPORTANTE** preste bem atenção pra não colocar uma função dentro da outra, coloque a função exatamente ABAIXO da outra.
feito isso, vá em
luascript.h
PROCURE novamente por "doCreatureChannelSay" ou "doPlayerSendTextMessage"
e adicione abaixo:
static int32_t luaDoPlayerOpenChannel(lua_State* L);
após isso, recompile sua source, apenas com "make" não precisa recompilar ela toda do 0, pode recompilar apenas esses arquivos, e reabrir seu ot com o novo exe e pronto, estará 100% funcionando a função.
caso isso tudo não de certo, me avise, que ai precisará adicionar algumas coisas em mais 3 arquivos.