Jump to content

Recommended Posts

Hi guys, so im trying to put into a HackLog for example, and log if someone that is not GM, just a player uses a command /shutdown.

ACMD(do_shutdown)
{
    if (!ch->IsGM())
        LogManager::instance().HackLog("Used /shutdown command.", ch);
        return;



        if (NULL == ch)
        {
            sys_err("Shutdown started by %s.", ch->GetName());
        }
        TPacketGGShutdown p;
        p.bHeader = HEADER_GG_SHUTDOWN;
        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown));

        Shutdown(10);
}

But its not working..

It keep says ingame that Command is not valid, and nothing goes into the log.

 

Help

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Contributor

Just think a little.

 

If you set the minimum for GM_IMPLEMENTOR then the  

if (!ch->IsGM())
        LogManager [...]

will never ever triggered since only an implementor character can go throguh the ACMD(do_shutdown) in cmd_gm.cpp.

 

So you should set it to GM_PLAYER and keep that if above. But then every GM can use shutdown command so maybe it would be nice to edit to check the gm level too there, if possible. I don't know if you can check the gm level by default in 40k source.

 

Edit: I quickly searched and you can, there is an ch->GetGMLevel() == GM_IMPLEMENTOR what you can use.

Edited by TMP4
Link to comment
Share on other sites

6 hours ago, TMP4 said:

Just think a little.

 

If you set the minimum for GM_IMPLEMENTOR then the  


if (!ch->IsGM())
        LogManager [...]

will never ever triggered since only an implementor character can go throguh the ACMD(do_shutdown) in cmd_gm.cpp.

 

So you should set it to GM_PLAYER and keep that if above. But then every GM can use shutdown command so maybe it would be nice to edit to check the gm level too there, if possible. I don't know if you can check the gm level by default in 40k source.

 

Edit: I quickly searched and you can, there is an ch->GetGMLevel() == GM_IMPLEMENTOR what you can use.

Thanks. Do you think its a safe way to do it? I mean its still checking for IMPLEMENTOR.

Link to comment
Share on other sites

  • Contributor

If you  check for implementor it's as good as set the minimum to implementor at cmd.cpp like everyone do.

 

I just don't understand why do you need to log everyone who try /shutdown. There will be always someone to try, even normal players. 

If you want to ban them, it's not a good idea.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 113

      Ulthar SF V2 (TMP4 Base)

    2. 2

      Feeding game source to LLM

    3. 0

      Target Information System

    4. 2

      Feeding game source to LLM

    5. 2

      anti exp explanation pls

    6. 2

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.