ARayKo60,
Код
local idOutfit = nil --/ ID надетого костюма
function prov_npc()
local oActor = db.actor --/ кешируем объект актора
local oOutfit = oActor and oActor:get_current_outfit() --/ объект костюма на акторе
local sCommunity = "actor" --/ для 'голого' актора
if oOutfit then --/ костюм надет
if oOutfit:id() == idOutfit then --/ костюм не сменился?
return --/> костюм прежний
else --/ сменялся - определяем группировку
idOutfit = oOutfit:id() --/ запоминаем ID надетого костюма
--/ таблица соответствий группировок костюмам (секциям)
local tCommunityByOutfit = {
["bandit_outfit"] = "bandit",
["specops_outfit"] = "military",
["dolg_outfit"] = "dolg"
}
--/ определяем группировку соответвующую текущему костюму
sCommunity = tCommunityByOutfit[oOutfit:section()] or sCommunity
end
elseif idOutfit then --/ а был ли костюм?
idOutfit = nil --/ костюм снят - чистим
else --/ уже 'голенький'
return --/>
end
if sCommunity ~= oActor:character_community() then --/ если еще не в группировке
oActor:set_character_community(sCommunity, 0, 0)
end
end