• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compiling put the source to send an info to mysql

Fernanda Peres

New Member
Joined
Aug 12, 2015
Messages
10
Reaction score
0
Is there any way to add that the source code, a way to send the name of the person who killed the player and the lvl? only we did not even have to be the name of the player and summon, the group killed or anything, might be just the person who gave the last hit and lvl, equal is the body of information, because this tfs I use it does not send the death to mysql


Code:
Item* Player::getCorpse()
{
    Item* corpse = Creature::getCorpse();
    if(corpse && corpse->getContainer()){
        std::stringstream ss;

        ss << "You recognize " << getNameDescription() << ".";

        Creature* lastHitCreature = NULL;
        Creature* mostDamageCreature = NULL;

        if(getKillers(&lastHitCreature, &mostDamageCreature) && lastHitCreature)
        {
            ss << " " << (getSex() == PLAYERSEX_FEMALE ? "She" : "He") << " was killed by "
                << lastHitCreature->getNameDescription() << ".";
        }

        corpse->setSpecialDescription(ss.str());
    }

    return corpse;
}
/*
{
    Item* corpse = Creature::getCorpse();
    if(corpse && corpse->getContainer())
    {
        Creature* lastHitCreature_ = NULL;
        Creature* mostDamageCreature = NULL;
        char buffer[190];
        if(getKillers(&lastHitCreature_, &mostDamageCreature) && lastHitCreature_)
            sprintf(buffer, "You recognize %s. %s was killed by %s.", getNameDescription().c_str(), (getSex() == PLAYERSEX_FEMALE ? "She" : "He"), lastHitCreature_->getNameDescription().c_str());
        else
            sprintf(buffer, "You recognize %s.", getNameDescription().c_str());
        corpse->setSpecialDescription(buffer);
 
Back
Top