Jump to content

How To Prevent Staff Spam Spawn


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
Share on other sites

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 

Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

Announcements



×
×
  • 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.