Hello, there. Is there any restriction to use the function doPlayerRemoveOutfitId(cid, id, addon) to remove an outfit that was manually added before with doPlayerAddOutfitId(cid, id, addon)?
By the way: I'm using TFS 0.4
Let me explain:
Players in my server starts only with the outfit ID 1 available. With the following script I can remove the the OutfitID 1 and Add a new outfitID27, and it works perfectly: the outfitID 27 is added and the outfitID 1 is removed.
But later I'm trying to repeat this process with this script to remove the new outfitid 27 and substitute it by another new outfitID available (forcing the player to use this new outfit), but just the new outfit is added and the old outfit ID 27 (added in the first script) is not removed.
The new addition is working fine, but I want to make this outfitID 27 unavailable anymore, but I just cant.
Can anyone help me again?
UPDATE: I've tried to duplicate the command setting a storagevalue and repeating the command again in an "onLogin" function (properly registered in creaturescripts.xml), but it's still not working.
By the way: I'm using TFS 0.4
Let me explain:
Players in my server starts only with the outfit ID 1 available. With the following script I can remove the the OutfitID 1 and Add a new outfitID27, and it works perfectly: the outfitID 27 is added and the outfitID 1 is removed.
Lua:
function onStepIn(cid, item, position, fromPosition)
if item.actionid == 7470 and getPlayerGroupId(cid) < 3 then
doPlayerAddOutfitId(cid, 27, 0)
doPlayerRemoveOutfitId(cid, 1, 0)
setPlayerStorageValue(cid, 8431, 1)
end
return true
end
But later I'm trying to repeat this process with this script to remove the new outfitid 27 and substitute it by another new outfitID available (forcing the player to use this new outfit), but just the new outfit is added and the old outfit ID 27 (added in the first script) is not removed.
Lua:
function onUse(cid, item, frompos, item2, topos)
local outfit = getCreatureOutfit(cid)
if item.uid == 9500 and queststatus == 1 then
if outfit.lookType == 160 then
doPlayerAddOutfitId(cid, 18, 0)
doPlayerRemoveOutfitId(cid, 27, 0)
setPlayerStorageValue(cid,9500,2)
else return true
end
else return true
end
return true
end
The new addition is working fine, but I want to make this outfitID 27 unavailable anymore, but I just cant.
Can anyone help me again?
UPDATE: I've tried to duplicate the command setting a storagevalue and repeating the command again in an "onLogin" function (properly registered in creaturescripts.xml), but it's still not working.
Lua:
function onLogin(cid)
if getPlayerStorageValue(cid, 8432) == 1 then
setPlayerStorageValue(cid, 8432, -1)
doPlayerRemoveOutfitId(cid, 27, 0)
doPlayerSendOutfitWindow(cid)
end
return TRUE
end
Last edited: