@up
- Fórum
- OTServ
- Suporte
- Programação
- Nao Ta Aparecendo PVP PAra o Ot Todo Guando Mata Um pk
Nao Ta Aparecendo PVP PAra o Ot Todo Guando Mata Um pk
Por deivisonamorim, 07 de nov. de 2015 em Programação
info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1

info
Grupo: Artesão
Registrado: 19/11/12
Posts: 113
Reputação: +63

Tente agora:
#ifdef __SKULLSYSTEM__
Skulls_t Player::getSkull() const
{
if(getAccessLevel() >= ACCESS_PROTECT)
return SKULL_NONE;
return skull;
}
Skulls_t Player::getSkullClient(const Player* player) const
{
if(!player){
return SKULL_NONE;
}
Skulls_t skull;
skull = player->getSkull();
#ifdef __PARTYSYSTEM__
if(skull != SKULL_RED && player->party != NULL && player->party == this->party)
return SKULL_GREEN;
#endif
if(skull == SKULL_NONE){
if(player->hasAttacked(this)){
skull = SKULL_YELLOW;
}
}
return skull;
}
bool Player::hasAttacked(const Player* attacked) const
{
if(accessLevel >= ACCESS_PROTECT)
return true;
if(!attacked)
return true;
AttackedSet::const_iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it != attackedSet.end()){
return true;
}
else{
return false;
}
}
void Player::addAttacked(const Player* attacked)
{
if(accessLevel >= ACCESS_PROTECT)
return;
if(!attacked || attacked == this)
return;
AttackedSet::iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it == attackedSet.end()){
attackedSet.insert(attacked_id);
}
}
void Player::clearAttacked()
{
attackedSet.clear();
}
void Player::addUnjustifiedDead(const Player* attacked)
{
if(getAccessLevel() >= ACCESS_PROTECT || attacked == this)
return;
std::stringstream msg;
msg << "PvP: " << getName() << " (Level: " << getLevel() << ") Matou " << attacked->getName() << " (Level:" << attacked->getLevel() << ").";
g_game.addAnimatedText(this->getPosition(), 129, "Drink!");
for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it){
if(dynamic_cast<Player*>(it->second))
(*it).second->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, msg.str().c_str());
}
info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1

nao deu continuo msm jeito
info
Grupo: Artesão
Registrado: 30/08/13
Posts: 135
Reputação: +14
Gênero: Masculino
Char no Tibia: [Vip] Procure

#ifdef __SKULLSYSTEM__
Skulls_t Player::getSkull() const
{
if(getAccessLevel() >= ACCESS_PROTECT)
return SKULL_NONE;
return skull;
}
Skulls_t Player::getSkullClient(const Player* player) const
{
if(!player){
return SKULL_NONE;
}
Skulls_t skull;
skull = player->getSkull();
#ifdef __PARTYSYSTEM__
if(skull != SKULL_RED && player->party != NULL && player->party == this->party)
return SKULL_GREEN;
#endif
if(skull == SKULL_NONE){
if(player->hasAttacked(this)){
skull = SKULL_YELLOW;
}
}
return skull;
}
bool Player::hasAttacked(const Player* attacked) const
{
if(accessLevel >= ACCESS_PROTECT)
return true;
if(!attacked)
return true;
AttackedSet::const_iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it != attackedSet.end()){
return true;
}
else{
return false;
}
}
void Player::addAttacked(const Player* attacked)
{
if(accessLevel >= ACCESS_PROTECT)
return;
if(!attacked || attacked == this)
return;
AttackedSet::iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it == attackedSet.end()){
attackedSet.insert(attacked_id);
}
}
void Player::clearAttacked()
{
attackedSet.clear();
}
void Player::addUnjustifiedDead(const Player* attacked)
{
if(getAccessLevel() >= ACCESS_PROTECT || attacked == this)
return;
doBroadcastMessage("PvP: " << getName() << " (Level: " << getLevel() << ") Matou " << attacked->getName() << " (Level:" << attacked->getLevel() << ")
}
Tenta isso
info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1

Tbm Nao Deu Deu Erro E nei Compilo
info
Grupo: Artesão
Registrado: 19/11/12
Posts: 113
Reputação: +63

Tente agora:
#ifdef __SKULLSYSTEM__
Skulls_t Player::getSkull() const
{
if(getAccessLevel() >= ACCESS_PROTECT)
return SKULL_NONE;
return skull;
}
Skulls_t Player::getSkullClient(const Player* player) const
{
if(!player){
return SKULL_NONE;
}
Skulls_t skull;
skull = player->getSkull();
#ifdef __PARTYSYSTEM__
if(skull != SKULL_RED && player->party != NULL && player->party == this->party)
return SKULL_GREEN;
#endif
if(skull == SKULL_NONE){
if(player->hasAttacked(this)){
skull = SKULL_YELLOW;
}
}
return skull;
}
bool Player::hasAttacked(const Player* attacked) const
{
if(accessLevel >= ACCESS_PROTECT)
return SKULL_YELLOW;
if(!attacked)
return SKULL_YELLOW;
AttackedSet::const_iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it != attackedSet.end()){
return true;
}
else{
return false;
}
}
void Player::addAttacked(const Player* attacked)
{
if(accessLevel >= ACCESS_PROTECT)
return;
if(!attacked || attacked == this)
return;
AttackedSet::iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it == attackedSet.end()){
attackedSet.insert(attacked_id);
}
}
void Player::clearAttacked()
{
attackedSet.clear();
}
void Player::addUnjustifiedDead(const Player* attacked)
{
if(getAccessLevel() >= ACCESS_PROTECT || attacked == this)
return;
std::stringstream msg;
msg << "PvP: " << getName() << " (Level: " << getLevel() << ") Matou " << attacked->getName() << " (Level:" << attacked->getLevel() << ").";
g_game.addAnimatedText(this->getPosition(), 129, "Drink!");
for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it){
if(dynamic_cast<Player*>(it->second))
(*it).second->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, msg.str().c_str());
}
Se continuar dando erro, me desculpe, não mexo com 7.91.
info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1

e Nao deu So aparace guando player q pego PK mata guando mata o q ta pk n aparece
info
Grupo: Artesão
Registrado: 19/11/12
Posts: 113
Reputação: +63

Tente novamente:
#ifdef __SKULLSYSTEM__
Skulls_t Player::getSkull() const
{
if(getAccessLevel() >= ACCESS_PROTECT)
return SKULL_NONE;
return skull;
}
Skulls_t Player::getSkullClient(const Player* player) const
{
if(!player){
return SKULL_NONE;
}
Skulls_t skull;
skull = player->getSkull();
#ifdef __PARTYSYSTEM__
if(skull != SKULL_RED && player->party != NULL && player->party == this->party)
return SKULL_GREEN;
#endif
if(skull == SKULL_NONE){
if(player->hasAttacked(this)){
skull = SKULL_YELLOW;
}
}
return skull;
}
bool Player::hasAttacked(const Player* attacked) const
{
if(accessLevel >= ACCESS_PROTECT)
return SKULL_YELLOW;
if(!attacked)
return SKULL_YELLOW;
AttackedSet::const_iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it != attackedSet.end()){
return true;
}
else{
return SKULL_YELLOW;
}
}
void Player::addAttacked(const Player* attacked)
{
if(accessLevel >= ACCESS_PROTECT)
return;
if(!attacked || attacked == this)
return;
AttackedSet::iterator it;
unsigned long attacked_id = attacked->getID();
it = attackedSet.find(attacked_id);
if(it == attackedSet.end()){
attackedSet.insert(attacked_id);
}
}
void Player::clearAttacked()
{
attackedSet.clear();
}
void Player::addUnjustifiedDead(const Player* attacked)
{
if(getAccessLevel() >= ACCESS_PROTECT || attacked == this)
return;
std::stringstream msg;
msg << "PvP: " << getName() << " (Level: " << getLevel() << ") Matou " << attacked->getName() << " (Level:" << attacked->getLevel() << ").";
g_game.addAnimatedText(this->getPosition(), 129, "Drink!");
for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it){
if(dynamic_cast<Player*>(it->second))
(*it).second->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, msg.str().c_str());
}
info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1

agr tudso player ta yellow e nao aparece pvp
info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1

@up


info
Grupo: Campones
Registrado: 16/10/15
Posts: 67
Reputação: +1