• 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++ doSendAnimatedText in source

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,638
Solutions
35
Reaction score
351
how i can make something like this but in source
Code:
for x = 1, 5 do
        local n = 5 - x
            addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), n > 0 and tostring(n), TEXTCOLOR_TEAL)
        end

tfs 0.4
 
how i can make something like this but in source
Code:
for x = 1, 5 do
        local n = 5 - x
            addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), n > 0 and tostring(n), TEXTCOLOR_TEAL)
        end

tfs 0.4
Why the sources? When writing it in a script is so much easier.
Also this portion of code is unnecessary.
Lua:
local n = 5 - x -- this is also not needed
n > 0 and tostring(n)
Just change it to this
Lua:
tostring(n)
Why? Because the for loop will only execute 5 times

If you want to count backwards then for do this
Lua:
for x = 5, 1, -1 do
    addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), tostring(x), TEXTCOLOR_TEAL)
end
 
why source because i use system in source need when player get
g_game.addMagicEffect(getPosition(), MAGIC_EFFECT_STUN);
start count from 5 > 1
 
؟؟؟
if(ConditionOutfit* condition = dynamic_cast<ConditionOutfit*>(Condition::createCondition(CONDITIONID_COMBAT, CONDITION_OUTFIT, duration)))
{
condition->setOutfits(outfits);
addCondition(condition);
need after addcondition add something like this
for x = 5, 1, -1 do
addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), tostring(x), TEXTCOLOR_TEAL)
end

but in source anyone can help me ?
 
Last edited:
؟؟؟
if(ConditionOutfit* condition = dynamic_cast<ConditionOutfit*>(Condition::createCondition(CONDITIONID_COMBAT, CONDITION_OUTFIT, duration)))
{
condition->setOutfits(outfits);
addCondition(condition);
need after addcondition add something like this
for x = 5, 1, -1 do
addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), tostring(x), TEXTCOLOR_TEAL)
end

but in source anyone can help me ?
I can but i am unavailable atm
 
Why the sources? When writing it in a script is so much easier.
Also this portion of code is unnecessary.
Lua:
local n = 5 - x -- this is also not needed
n > 0 and tostring(n)
Just change it to this
Lua:
tostring(n)
Why? Because the for loop will only execute 5 times

If you want to count backwards then for do this
Lua:
for x = 5, 1, -1 do
    addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), tostring(x), TEXTCOLOR_TEAL)
end
؟؟؟
if(ConditionOutfit* condition = dynamic_cast<ConditionOutfit*>(Condition::createCondition(CONDITIONID_COMBAT, CONDITION_OUTFIT, duration)))
{
condition->setOutfits(outfits);
addCondition(condition);
need after addcondition add something like this
for x = 5, 1, -1 do
addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), tostring(x), TEXTCOLOR_TEAL)
end

but in source anyone can help me ?

@Steve Albert is right. It's a lot smarter and easier to move what you've written in C++ to Lua instead. You can do everything you did in C++ in Lua.

Use Lua for scripting, and C++ to implement functions you're missing in Lua.
 
@Steve Albert is right. It's a lot smarter and easier to move what you've written in C++ to Lua instead. You can do everything you did in C++ in Lua.

Use Lua for scripting, and C++ to implement functions you're missing in Lua.
i can't do it with this system in lua
i know how to do something like it in lua but with other system
this full system i did in source so i must finish it in source and best way to do it in source
 
Look in game.cpp or player.cpp for the code when a player changes their outfit. Then post it here please.

edit: infact which ever file you find it it make a pastebin of the whole file and link it.
 
no one can help me ?? when use this in player.cpp start count from 1 to 5 anyone can ?
Code:
void Player::UsdOutfit()
{
    std::vector<Outfit_t> outfits;
    Outfit_t outfit;
    outfit.lookType = 48;
    outfits.push_back(outfit);
    if(ConditionOutfit* condition = dynamic_cast<ConditionOutfit*>(Condition::createCondition(CONDITIONID_COMBAT, CONDITION_OUTFIT, duration)))
    {
        condition->setOutfits(outfits);
        addCondition(condition);
    }
}
 
Back
Top