i make exhausted in script and dont work...
Code:
local config =
{
exhaustionInSeconds = 30,
storage = 34534,
sexChangeable = false
}
function onSay(cid, words, param, channel)
if(exhaustion.check(cid, config.storage) == TRUE) then
doPlayerSendCancel(cid, "You can change outfit only 1 time per " .. config.exhaustionInSeconds .. " seconds.")
return TRUE
end
party = getPlayerParty(cid)
if (config.sexChangeable == true) then
sex = getPlayerSex(cid)
end
if (party) then
if (party == cid) then
outfit = getCreatureOutfit(cid)
members = getPartyMembers(party)
if (#members >= 1) then
tmp = outfit
for i=1,#members do
if (config.sexChangeable == true) then
if (sex ~= getPlayerSex(members[i])) then
doPlayerSetSex(members[i], sex)
end
end
local tmpOutfit = getCreatureOutfit(members[i])
tmpOutfit.lookHead = outfit.lookHead
tmpOutfit.lookBody = outfit.lookBody
tmpOutfit.lookLegs = outfit.lookLegs
tmpOutfit.lookFeet = outfit.lookFeet
tmpOutfit.lookLegs = outfit.lookLegs
doCreatureChangeOutfit(members[i], tmpOutfit)
doSendMagicEffect(getCreaturePosition(members[i]), 66)
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")
end
return true
end