std::string Player::getDescription(int32_t lookDistance) const
std::string var;
getStorage(1337, var);
s << "\n [Frags: " << var << " ";
function onKill(cid, target, lastHit)
if(isPlayer(target)) then
setPlayerStorageValue(cid, 1337, getPlayerStorageValue(cid, 1337) +1)
end
return true
end
[forgottenserver] Index of /tags/0.3.6pl1
You must get all the files, edit player.cpp, and then compile![]()
Heres how I did it for my server;
Player.cpp find;
after you select where you want it, (before voc level, after).. it doesn't matter, add thisCode:std::string Player::getDescription(int32_t lookDistance) const
Code:std::string var; getStorage(1337, var); s << "\n [Frags: " << var << " ";
then for the LUA Part something like this;
Code:function onKill(cid, target, lastHit) if(isPlayer(target)) then setPlayerStorageValue(cid, 1337, getPlayerStorageValue(cid, 1337) +1) end return true end
std::string Player::getDescription(int32_t lookDistance) const
{
std::stringstream s;
if(lookDistance == -1)
{
s << "yourself.";
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
s << " You are " << group->getName();
else if(vocation_id != 0)
s << " You are " << vocation->getDescription();
else
s << " You have no vocation";
}
else
{
s << nameDescription;
if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
s << " (Level " << level << ")";
s << ". " << (sex % 2 ? "He" : "She");
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
s << " is " << group->getName();
else if(vocation_id != 0)
s << " is " << vocation->getDescription();
else
s << " has no vocation";
s << getSpecialDescription();
}
std::string tmp;
if(marriage && IOLoginData::getInstance()->getNameByGuid(marriage, tmp))
{
s << ", ";
if(vocation_id == 0)
{
if(lookDistance == -1)
s << "and you are";
else
s << "and is";
s << " ";
}
s << (sex % 2 ? "husband" : "wife") << " of " << tmp;
}
s << ".";
if(guildId)
{
if(lookDistance == -1)
s << " You are ";
else
s << " " << (sex % 2 ? "He" : "She") << " is ";
s << (rankName.empty() ? "a member" : rankName)<< " of the " << guildName;
if(!guildNick.empty())
s << " (" << guildNick << ")";
s << ".";
}
return s.str();
}
Item* Player::getInventoryItem(slots_t slot) const
{
if(slot > SLOT_PRE_FIRST && slot < SLOT_LAST)
return inventory[slot];
if(slot == SLOT_HAND)
return inventory[SLOT_LEFT] ? inventory[SLOT_LEFT] : inventory[SLOT_RIGHT];
return NULL;
}
Item* Player::getEquippedItem(slots_t slot) const
{
Item* item = getInventoryItem(slot);
if(!item)
return NULL;
switch(slot)
{
case SLOT_LEFT:
case SLOT_RIGHT:
return item->getWieldPosition() == SLOT_HAND ? item : NULL;
default:
break;
}
return item->getWieldPosition() == slot ? item : NULL;
}
void Player::setConditionSuppressions(uint32_t conditions, bool remove)
std::string Player::getDescription(int32_t lookDistance) const
{
std::stringstream s;
if(lookDistance == -1)
{
s << "yourself.";
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
s << " You are " << group->getName();
else if(vocation_id != 0)
s << " You are " << vocation->getDescription();
else
s << " You have no vocation";
}
else
{
s << nameDescription;
if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
s << " (Level " << level << ")";
s << ". " << (sex % 2 ? "He" : "She");
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
s << " is " << group->getName();
else if(vocation_id != 0)
s << " is " << vocation->getDescription();
std::string var;
getStorage(1337, var);
s << "\n Frags: " << var << " ";
else
s << " has no vocation";
s << getSpecialDescription();
}
std::string tmp;
if(marriage && IOLoginData::getInstance()->getNameByGuid(marriage, tmp))
{
s << ", ";
if(vocation_id == 0)
{
if(lookDistance == -1)
s << "and you are";
else
s << "and is";
s << " ";
}
s << (sex % 2 ? "husband" : "wife") << " of " << tmp;
}
s << ".";
if(guildId)
{
if(lookDistance == -1)
s << " You are ";
else
s << " " << (sex % 2 ? "He" : "She") << " is ";
s << (rankName.empty() ? "a member" : rankName)<< " of the " << guildName;
if(!guildNick.empty())
s << " (" << guildNick << ")";
s << ".";
}
return s.str();
}
Item* Player::getInventoryItem(slots_t slot) const
{
if(slot > SLOT_PRE_FIRST && slot < SLOT_LAST)
return inventory[slot];
if(slot == SLOT_HAND)
return inventory[SLOT_LEFT] ? inventory[SLOT_LEFT] : inventory[SLOT_RIGHT];
return NULL;
}
Item* Player::getEquippedItem(slots_t slot) const
{
Item* item = getInventoryItem(slot);
if(!item)
return NULL;
switch(slot)
{
case SLOT_LEFT:
case SLOT_RIGHT:
return item->getWieldPosition() == SLOT_HAND ? item : NULL;
default:
break;
}
return item->getWieldPosition() == slot ? item : NULL;
}
void Player::setConditionSuppressions(uint32_t conditions, bool remove)