Jump to content

Recommended Posts

  • Premium

On File: cmd_gm.cpp

#define PREVENT_MOB_STAFF

add where you want the static bool:

#ifdef PREVENT_MOB_STAFF
static bool CantStaffer(int vnum)
{
    switch (vnum)
    {
        case VNUM_MOB_YOU_DONT_WANT_STAFF_SPAWN:
            return true;
            break;
    }

    return false;
}
#endif

FIND:

    if (vnum == 0)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "No such mob(%s) by that vnum", arg1);
        return;
    }

ADD BELOW:

#ifdef PREVENT_MOB_STAFF
    if (CantStaffer(vnum) && strcmp("MASTERNAME", ch->GetName()))
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "You can't spawn this mob.");
        sys_log(0, "PREVENT_MOB_STAFF: TRIED TO SPAWN BY COMMAND A BLOCKED VNUM:  %s", ch->GetName());
        return;
    }
#endif

(MASTERNAME = Your name, so you can spawn mobs.)

 

Finished, you're safe from /m!  Don't trust always your staff. It's just my opinion.

Regards WeeHex.

  • Love 1
Link to comment
https://metin2.dev/topic/20246-how-to-prevent-staff-spam-spawn/
Share on other sites

  • Premium

Wtf guys?  
GM without /m is not good.
I said just preventing. I had problems so I decided to make this, it's 100% useful and safe for dangerous vnums.

 

(kori says "bad code" is like a slug tell slow a turtle)

  • Active+ Member
3 hours ago, WeedHex said:

Wtf guys?  
GM without /m is not good.
I said just preventing. I had problems so I decided to make this, it's 100% useful and safe for dangerous vnums.

 

(kori says "bad code" is like a slug tell slow a turtle)

You mean hardcoding is good? 

The idea is not bad but not your code sorry 

  • Premium

I summon Jesus Christ to clean the sins.

Btw, if you're the owner and trust no one in your team, or don't give them high permissions or then hardcoded is indeed the better option. It's way harder for someone to steal your source and edit your game core (or hex ) then to enter database and change stuff, because sql injection is so 'hard' in crappy mt2 sites.

Personally I would just change permissions of gm ranks.

Now remember that easy to change in database also makes it easier to hack.

  • Love 1
  • Premium
2 hours ago, tierrilopes said:

I summon Jesus Christ to clean the sins.

Btw, if you're the owner and trust no one in your team, or don't give them high permissions or then hardcoded is indeed the better option. It's way harder for someone to steal your source and edit your game core (or hex ) then to enter database and change stuff, because sql injection is so 'hard' in crappy mt2 sites. 

Personally I would just change permissions of gm ranks.

Now remember that easy to change in database also makes it easier to hack. 

No sql user that will manage the website should have the permission to access anything in the common table tho

  • Premium

I need my staff spawn mobs. But if they spam a dangerous one??? They don't know if is dangerous or not. Now i can't do example but let's think about xD

It was just my opinion and i want to share the easy code if someone have this problem.

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.