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
and this is the sendAddMarker in the protocolgame:
Not sure how I would do a removal of the icon. Anyone know?
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?