GarQet
Own3d!
- Joined
- Feb 10, 2009
- Messages
- 1,381
- Solutions
- 14
- Reaction score
- 81
Hello OTlanders, I have small request.
I'm looking for a person who removes a requirement of this code.
The condition for removal: If a player has no access (tutor, st, gm, cm, god), then this code will also work for him.
At the moment it works for people with rank higher than a normal player.
Thank you in advance and ask for a fast, effective help.
Yours GarQet.
I'm looking for a person who removes a requirement of this code.
The condition for removal: If a player has no access (tutor, st, gm, cm, god), then this code will also work for him.
At the moment it works for people with rank higher than a normal player.
Code:
SpectatorVec::iterator it;
SpectatorVec list = g_game.getSpectators(player->getPosition());
Player* tmpPlayer = NULL;
Condition* condition = NULL;
if((condition = player->getCondition(CONDITION_GAMEMASTER, CONDITIONID_DEFAULT, GAMEMASTER_INVISIBLE)))
{
IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), true);
for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit)
{
if(!pit->second->canSeeCreature(player))
pit->second->notifyLogIn(player);
}
for(it = list.begin(); it != list.end(); ++it)
{
if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player))
tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_TELEPORT);
}
player->removeCondition(condition);
g_game.internalCreatureChangeVisible(player, VISIBLE_GHOST_APPEAR);
lua_pushboolean(L, true);
}
else if((condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_GAMEMASTER, -1, 0, false, GAMEMASTER_INVISIBLE)))
{
player->addCondition(condition);
g_game.internalCreatureChangeVisible(player, VISIBLE_GHOST_DISAPPEAR);
for(it = list.begin(); it != list.end(); ++it)
{
if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player))
tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
}
for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit)
{
if(!pit->second->canSeeCreature(player))
pit->second->notifyLogOut(player);
}
IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), false);
if(player->isTrading())
g_game.internalCloseTrade(player);
player->clearPartyInvitations();
if(player->getParty())
player->getParty()->leave(player);
lua_pushboolean(L, true);
}
Thank you in advance and ask for a fast, effective help.
Yours GarQet.