• 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!

doPlayerRemoveMapMarker function

BeniS

Advanced OT User
Senator
Joined
Aug 8, 2009
Messages
1,850
Reaction score
189
Location
New Zealand
Does someone have any idea how I would add doPlayerRemoveMapMarker function to the sources? I know how to add it to the luascript and all that, I just don't know how to call a removal of the marker in the network protocol.

This is the adding function
Code:
int32_t LuaInterface::luaDoPlayerAddMapMark(lua_State* L)
{
	//doPlayerAddMapMark(cid, pos, type[, description])
	std::string description;
	if(lua_gettop(L) > 3)
		description = popString(L);

	MapMarks_t type = (MapMarks_t)popNumber(L);
	PositionEx pos;
	popPosition(L, pos);

	ScriptEnviroment* env = getEnv();
	Player* player = env->getPlayerByUID(popNumber(L));
	if(!player)
	{
		errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
		lua_pushboolean(L, false);
		return 1;
	}

	player->sendAddMarker(pos, type, description);
	lua_pushboolean(L, true);
	return 1;
}

and this is the sendAddMarker in the protocolgame:
Code:
void ProtocolGame::sendAddMarker(const Position& pos, MapMarks_t markType, const std::string& desc)
{
	NetworkMessage_ptr msg = getOutputBuffer();
	if(msg)
	{
		TRACK_MESSAGE(msg);
		msg->put<char>(0xDD);
		msg->putPosition(pos);
		msg->put<char>(markType);
		msg->putString(desc);
	}
}

Not sure how I would do a removal of the icon. Anyone know?

Appreciate all the help I can get. Thanks!
 
Back
Top