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

Changing colors after transformation dont working

zabka229

New Member
Joined
Dec 30, 2009
Messages
147
Reaction score
0
Hello I have a problem with changing colors of outfit after transformation.
If I create player manualy in phpmyadmin everything works, but if i transform after changing coloros nothing happen.

I use:
doSetCreatureOutfit(cid, {lookType = 326}, -1)

Looktype is changing and then after changing colors nothing happen...
 
I transform by talkactions where I change looktype.
Tfs 0.3.6pl, tibia 8.54.

The weirdest part is that when I change looktype in sql I can change colors ad it saves. But when I transform to that looktype then its all white(ignoring colors). In outfit window it display corectly.
 
Transformation:
doPlayerSetVocation(cid, 336)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+((getPlayerLevel(cid)+getPlayerReborn(cid)) * 5))
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+((getPlayerLevel(cid)+getPlayerReborn(cid)) * 5))
doCreatureAddHealth(cid, 1, false)
doCreatureAddMana(cid, 1, false)
local outfit = {lookType = 316 , lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
doSetCreatureOutfit(cid, outfit, -1)
doSendMagicEffect(pos, 215)

Outfit:
<outfit id="1" >
<list gender="0-3" lookType="336" name="Master Roshi"/>
</outfit>
 
TEst it in u Function.lib
Code:
function loadOutfit(cid)
    local result = db.getResult("SELECT `outfit` FROM `players` WHERE `id` = '"..getPlayerGUID(cid).."';")
    if result:getID() == -1 then
        return true
    end
    saved_outfit = split(result:getDataString("outfit"), '-')
    result:free()
    if(saved_outfit[1] == 0) then
        saved_outfit[1] = 128
    end
    local outfit = {
        lookType = saved_outfit[1],
        lookHead = saved_outfit[2],
        lookBody = saved_outfit[3],
        lookLegs = saved_outfit[4],
        lookFeet = saved_outfit[5],
        lookAddons = saved_outfit[6]
    }
    return outfit
end

function saveOutfit(cid)
    local outfit = getCreatureOutfit(cid)
    local lookType = getCreatureOutfit(cid).lookType
    local maleOutfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367}
    local femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366}
    if lookType > 0 and lookType <= 596 then
        db.query("UPDATE `players` SET `outfit` = '"..outfit.lookType.."-"..outfit.lookHead.."-"..outfit.lookBody.."-"..outfit.lookLegs.."-"..outfit.lookFeet.."-"..outfit.lookAddons.."' WHERE `id` = '"..getPlayerGUID(cid).."';")
    elseif lookType == 0 then
        db.queyr("UPDATE `players` SET `outfit` = '128-"..outfit.lookHead.."-"..outfit.lookBody.."-"..outfit.lookLegs.."-"..outfit.lookFeet.."-"..outfit.lookAddons.."' WHERE `id` = '"..getPlayerGUID(cid).."';")
    else
        doPlayerSendCancel(cid, "Sorry, you cannot save this outfit.")
    end
end
 
After transformations i get outfit where I can change colors.
I change the colors but nothing happen.
After i relog i see my outfit with changed colors and I can normally change them and see them.

But there must be possibility of doing that without relog.
 
Unknown member who hates rules said:
What U Use it For Creature Script / Action //?? GIve Code / Tfs Version
Unknown member who hates rules said:
F**k u ARE Bi**hs As u Rules Dont help ppl Fu**ing U Are Sh*t behind u Rules fu**ing this Site...

Oh, I guess we need some rules that users should follow to remember to add those things? ;)

WibbenZ said:

Oh nvm, we already have rules ...



After transformations i get outfit where I can change colors.
I change the colors but nothing happen.
After i relog i see my outfit with changed colors and I can normally change them and see them.

But there must be possibility of doing that without relog.

The script posted by X never saved the outfit, when you relog it will be overwritten(unless the server saved), so use doPlayerSave(cid) when you use a query.
If that dosn't work you can use a storage value, check it in login.lua, if it's set then re-set that outfit.
 
Already tried with doPlayerSave(cid).
local oldO = getCreatureOutfit(cid)
local outfit = {lookType = 326, lookHead = 0, lookBody = oldO.lookBody, lookLegs = 0, lookFeet = 0, lookAddons = 0}
doSetCreatureOutfit(cid, outfit, -1)
doPlayerSave(cid)

Not working :(
 
what exactly is the problem?
maybe i'm stupid or just can't read properly, are you experiencing issues with updating the database properly when you set outfit?
does the outfit work at all, just doesn't save?
 
Back
Top