Onforum.net - Web and gaming resource community

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members .

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

Blaze

Elite
Elite
VIP
Credits
607
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


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!

Rogue

Rogue Purchase

User upgrade! at

🔥 Upgrade Now
Baba2

Baba2 Purchase

User upgrade! at

🔥 Upgrade Now

Escanor25 Purchase

User upgrade! at

🔥 Upgrade Now