Why the sources? When writing it in a script is so much easier.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
local n = 5 - x -- this is also not needed
n > 0 and tostring(n)
tostring(n)
for x = 5, 1, -1 do
addEvent(doSendAnimatedText, x * 1000, getCreaturePosition(cid), tostring(x), TEXTCOLOR_TEAL)
end
I can but i am unavailable atm؟؟؟
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 ?
when you will available?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.
Just change it to thisLUA:local n = 5 - x -- this is also not needed n > 0 and tostring(n)
Why? Because the for loop will only execute 5 timesLUA:tostring(n)
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 ?
i can't do it with this system 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.
what ??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.
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);
}
}