Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Metin2 [C ++] A small lock to the "do_disconnect" function

Blaze

Elite
Elite
VIP
Credits
501
Today I will present you a small blockade to the " do_disconnect " function .

It depends on the fact that we can not throw GM out of the game, so I think it is quite useful

1. Open cmd_gm.cpp (You will find it in the Source Game).

2. You are looking for and replacing this function:

Code:
ACMD(do_disconnect)
{
    char arg1[256];
    one_argument(argument, arg1, sizeof(arg1));

    if (!*arg1)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "ex) /dc <player name>");
        return;
    }

    LPDESC d = DESC_MANAGER::instance().FindByCharacterName(arg1);
    LPCHARACTER    tch = d ? d->GetCharacter() : NULL;

    if (!tch)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "%s: no such a player.", arg1);
        return;
    }

    if (tch == ch)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "cannot disconnect myself");
        return;
    }

    if (tch->IsGM())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Blokada_Disconnect_GM"));
        return;
    }
    
    DESC_MANAGER::instance().DestroyDesc(d);
}
3. Open locale_string.txt , and then add to it:
Code:
"Blokada_Disconnect_GM";
"You can not get an administrator out of the game!";
p.s2. You will find it in server files.

p.s3. You can also use the same "tch-> IsGM" function to block kill, stun, etc.
 

Similar threads


About us

OnForum.net is a resource community where aspiring webmasters and designers can share content and receive support for a wide variety of software platforms. We are working every day to make sure our community is one of the best.

None of the files are hosted on this site.

PARTNERS

Follow us

We recommend

Doza de Blog
Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!