I greet you again. I hope you will help. I would like to doPlayerSendTextMessage sending a message not only to the default channel to channel NPCs. Digs the whole source, and anything interesting I can not find. What if I throw be responsible for the cuts:
luascript.cpp
I was very grateful for any advice, or give another command through which I could send a message to the NPC chanel. sendTextMessage I can not move because the whole engine can then sprinkle.
luascript.cpp
Code:
int LuaScriptInterface::luaDoPlayerSendTextMessage(lua_State *L)
{
//doPlayerSendTextMessage(cid, MessageClasses, message)
std::string text = popString(L);
uint32_t messageClass = popNumber(L);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
const Player* player = env->getPlayerByUID(cid);
if(!player){
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushnumber(L, LUA_ERROR);
return 1;
}
player->sendTextMessage((MessageClasses)messageClass, text);
lua_pushnumber(L, LUA_NO_ERROR);
return 1;
}
I was very grateful for any advice, or give another command through which I could send a message to the NPC chanel. sendTextMessage I can not move because the whole engine can then sprinkle.