• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling [c++] Sending messenge to NPCs Chanel

Aragornik

New Member
Joined
Mar 6, 2008
Messages
252
Reaction score
0
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
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.
 
doPlayerSendChannelMessage(cid, author, message, SpeakClasses, channel)

doPlayerSendChannelMessage(cid, "", "Message", TALKTYPE_PRIVATE_NP, CHANNEL_PRIVATE)
 
Back
Top