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

[C++] New information look based on storage(request).

SoPerfect

New Member
Joined
Mar 19, 2016
Messages
10
Reaction score
1
Hey, so I'm looking for the script which will show new information on look, like this:
https://otland.net/threads/level-ranks.23463/
But I want it to be based on storage.
I wrote it in LUA but, the problem is that fuction doPlayerSetSpecialDescription doesn't work when we're looking on yourself. I can't do it myself because I'm noob in C++, so here is my request.
Thanks in advance!

-- I'm using TFS 0.3.6pl for protocol 8.54.
 
Last edited:
Eh i did not see you used 0.3, but you can easily adapt what i've done here.
Add this code under this end line:

Code:
    -- Let's sort the highest rank first
    table.sort(config, function(a, b)
        return a.level > b.level
    end)

    if thing:isCreature() then
        if thing:isPlayer() then
            for _, rank in ipairs(config) do
                if rank.level <= thing:getLevel() then
                    description = string.format("%s\n%s is a %s.", description, thing:getSex() == PLAYERSEX_FEMALE and "She" or "He", rank.text)
                    break
                end
            end
        end
    end

And add this config outside the function:

Code:
local config = {
    {level = 10, text = "Newbie"},
    {level = 20, text = "Good"},
    {level = 50, text = "God"}
}
 
Back
Top