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

TFS 1.X+ Function usage

Baahzera

Member
Joined
Apr 4, 2014
Messages
74
Solutions
1
Reaction score
18
Hello. I am having trouble on using the function setSkullTime. I've already take a look on the C++ code but didn't get it out.

I'm setting a skull type to a player, then I try to set skullticks for it to be like unlimited amount of time until the player logs out.
I've tried:
setSkullTime(-1)
setSkullTime(24*60*60*1000)
setSkullTime(os.time()+24*60*60*1000)


Any advices on the usage? Thank you.
 
Solution
Reverse procedure. First set time, then set skull.
Code:
player:setSkullTime(24*60*60*1000) -- how long should skull lasts
player:setSkull(SKULL_RED) -- what skull to set on


One more thing.
Code:
void Player::onEndCondition(ConditionType_t type)
{
    Creature::onEndCondition(type);

    if (type == CONDITION_INFIGHT) {
        onIdleStatus();
        pzLocked = false;
        clearAttacked();

        if (getSkull() != SKULL_RED && getSkull() != SKULL_BLACK) {
            setSkull(SKULL_NONE);
        }
    }

    sendIcons();
}

when infight condition disappears then any skull different than red and black disappears as well. Skull time is...
You wrote it like this?
player:setSkullTime(-1)
player:setSkullTime(24*60*60*1000)
player:setSkullTime(os.time()+24*60*60*1000)
 
Reverse procedure. First set time, then set skull.
Code:
player:setSkullTime(24*60*60*1000) -- how long should skull lasts
player:setSkull(SKULL_RED) -- what skull to set on


One more thing.
Code:
void Player::onEndCondition(ConditionType_t type)
{
    Creature::onEndCondition(type);

    if (type == CONDITION_INFIGHT) {
        onIdleStatus();
        pzLocked = false;
        clearAttacked();

        if (getSkull() != SKULL_RED && getSkull() != SKULL_BLACK) {
            setSkull(SKULL_NONE);
        }
    }

    sendIcons();
}

when infight condition disappears then any skull different than red and black disappears as well. Skull time is ignored in this case.
 
Last edited:
Solution
Reverse procedure. First set time, then set skull.
Code:
player:setSkullTime(24*60*60*1000) -- how long should skull lasts
player:setSkull(SKULL_RED) -- what skull to set on


One more thing.
Code:
void Player::onEndCondition(ConditionType_t type)
{
    Creature::onEndCondition(type);

    if (type == CONDITION_INFIGHT) {
        onIdleStatus();
        pzLocked = false;
        clearAttacked();

        if (getSkull() != SKULL_RED && getSkull() != SKULL_BLACK) {
            setSkull(SKULL_NONE);
        }
    }

    sendIcons();
}

when infight condition disappears then any skull different than red and black disappears as well. Skull time is ignored in this case.

Oh! I didn't see that piece of code. This will help a lot! Thank you!
 
Back
Top