• 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!

Compiling How edit this part of c++ code player.cpp? need keep pk whitout pz or when log out.

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
2,035
Solutions
9
Reaction score
357
Location
Chile
Hello
im using a creature scripts that gives me skulls(war script) green,yellow,white.....

i need edit this line in player.cpp and i cant get it works im using otx based on tfs0.3.777
im trying to make player keeps pk whitout pz locked or when log out. BUT NOT when dies
Code:
Skulls_t Player::getSkull() const
{
if(hasFlag(PlayerFlag_NotGainInFight) || hasCustomFlag(PlayerCustomFlag_NotGainSkull))
return SKULL_NONE;

return skull;
}
to make player maintain pk whitout pz locked or when log out BUT not when dies

anyone can helpme pls?

regards
 
Last edited:
You, could try something like this.

Code:
Skulls_t Player::getSkull() const
{
     if(hasCustomFlag(PlayerCustomFlag_NotGainSkull))
         return SKULL_NONE;
         
     return skull;
}
 
This would just ruin the getter for skulls.

@ot look for setskull
thanks for advice men but how i do to do not lost pk after lost pz lock or log out?

thanks in advance

You, could try something like this.

Code:
Skulls_t Player::getSkull() const
{
     if(hasCustomFlag(PlayerCustomFlag_NotGainSkull))
         return SKULL_NONE;
        
     return skull;
}
i tested doesnt works :( any other idea? thanks in advance mate ;)
 
Last edited by a moderator:
You need a new field to store the skull that the player have in the db and remove it upon death.
you mean execute some table in db?
how i should write those lines can you tell me pls?

and what about this line?
Code:
void Player::setSkullEnd(time_t _time, bool login, Skulls_t _skull)
{
    if(g_game.getWorldType() != WORLDTYPE_OPEN
        || hasFlag(PlayerFlag_NotGainInFight) ||
        hasCustomFlag(PlayerCustomFlag_NotGainSkull))
        return;

    bool requireUpdate = false;
    if(_time > time(NULL))
    {
        requireUpdate = true;
        setSkull(_skull);
    }
    else if(skull == _skull)
    {
        requireUpdate = true;
        setSkull(SKULL_NONE);
        _time = 0;
    }

    if(requireUpdate)
    {
        skullEnd = _time;
        if(!login)
            g_game.updateCreatureSkull(this);
    }
}
regards
 
Last edited:
Back
Top