Jump to content

Recommended Posts

Hello friends
This error exists in some versions and appears sometimes, so I decided to search for the cause of the problem and its solution, and I wanted to share it with you so that everyone can benefit.

cmd_gm.cpp

ACMD(do_advance)
{
    char arg1[256], arg2[256];
    two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));

    if (!*arg1 || !*arg2)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "Syntax: advance <name> <level>");
        return;
    }

    LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);

    if (!tch)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "%s not exist", arg1);
        return;
    }

    int level = 0;
    str_to_number(level, arg2);

    tch->SetExp(0); // Fix level
    tch->ResetPoint(MINMAX(0, level, gPlayerMaxLevel));
}


ACMD(do_level)
{
    char arg2[256];
    one_argument(argument, arg2, sizeof(arg2));

    if (!*arg2)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "Syntax: level <level>");
        return;
    }

    int    level = 0;
    str_to_number(level, arg2);

    ch->SetExp(0); // Fix level
    ch->ResetPoint(MINMAX(1, level, gPlayerMaxLevel));

    ch->ClearSkill();
    ch->ClearSubSkill();
}

Hope it helps someone.. Goodbye

  • Metin2 Dev 2
  • Flame 1
  • Love 3
Link to comment
https://metin2.dev/topic/32962-fix-commands-change-level/
Share on other sites

  • 1 month later...
  • Active+ Member
12 minutes ago, paz93br said:

whre i found cmd.cp ?

usr/????/???

Source game

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
https://metin2.dev/topic/32962-fix-commands-change-level/#findComment-167519
Share on other sites

  • Active+ Member
2 hours ago, paz93br said:

Well... I made the changes, rebooted the server... but the bug still persists, do I need to give some command to the VM?

you need recompile game, and change new_game to your game and reboot, not only change and reboot.

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
https://metin2.dev/topic/32962-fix-commands-change-level/#findComment-167550
Share on other sites

8 hours ago, Nazox said:

you need recompile game, and change new_game to your game and reboot, not only change and reboot.

Forgive me for my ignorance, could you more or less show me step by step how to do it? I'm trying... I tried to compile using freebsd but I had problems with lua.h... I tried using the command g++ cmd_gm.cpp -o cmd_gm but without success.

Link to comment
https://metin2.dev/topic/32962-fix-commands-change-level/#findComment-167559
Share on other sites

  • Active+ Member
6 hours ago, paz93br said:

Forgive me for my ignorance, could you more or less show me step by step how to do it? I'm trying... I tried to compile using freebsd but I had problems with lua.h... I tried using the command g++ cmd_gm.cpp -o cmd_gm but without success.

In freebds try:

cd /usr/xx/xx/src/game/src 

gmake clean

gmake 

Change xx for your source directory for example in my case I have cpp and h in

/usr/nazox/src/game/src

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
https://metin2.dev/topic/32962-fix-commands-change-level/#findComment-167560
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 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.