Jump to content

Recommended Posts

int pc_is_trade(lua_State* L)
{
     LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

     if (NULL != ch)
     {
           lua_pushboolean(L, (ch->GetExchange() != NULL) ? true : false);
     }
     else
     {
           lua_pushboolean(L, false);
     }

     return 1;
 }
Use like this:
if pc.is_trade == true then
Edited by Grudge
  • Love 1
Link to comment
https://metin2.dev/topic/6721-quest-problem/#findComment-42532
Share on other sites

don't work if exchange is open will return Close if is close will return close.

 

quest test begin
    state start begin  
        when 27802.use begin
            if pc.is_trade == true then
                syschat("Open.")
            else
                syschat("Close.")
            end
        end
    end -- state
end    -- quest

Link to comment
https://metin2.dev/topic/6721-quest-problem/#findComment-42617
Share on other sites

  • Solution

That don't work for me but i fiind this

    int pc_is_trade(lua_State* L)
    {
        LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
        lua_pushboolean(L, (ch->GetExchange() || ch->GetMyShop() || ch->GetShopOwner() || ch->IsOpenSafebox() || ch->IsCubeOpen()));
        return 1;
    }

Quest exemple:

quest test begin
    state start begin  
        when 27802.use begin
            if pc.is_trade() then
                syschat("Open.")
            else
                syschat("Close.")
            end
        end
    end -- state
end    -- quest
Link to comment
https://metin2.dev/topic/6721-quest-problem/#findComment-42622
Share on other sites

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.