Jump to content

Recommended Posts

Hi, i have function 

int pc_kostium(lua_State* L)
    {
        LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
        if(!lua_isnumber(L, 1))
            return 0;

        int part_value = 0;
        bool enable = (bool)lua_tonumber(L, 1);
        if(enable)
        {
            const CItem* pArmor = ch->GetWear(WEAR_BODY);
            part_value = (NULL != pArmor) ? pArmor->GetVnum() : ch->GetOriginalPart(PART_MAIN);
        }
        else
        {
            const CItem* pArmor = ch->GetWear(WEAR_COSTUME_BODY);
            part_value = (NULL != pArmor) ? pArmor->GetVnum() : ch->GetOriginalPart(PART_MAIN);
        }
        ch->SetCostumeVisible(!enable);
        ch->SetPart(PART_MAIN, part_value);
        ch->UpdatePacket();
        return 0;
    }

 

It is work that changes the appearance of characters, but something does not work. Where is the mistake?

Link to comment
https://metin2.dev/topic/10978-change-costumearmor-visible/
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.