Jump to content

shutdown enable gm logged in


Recommended Posts

On 7/24/2018 at 9:19 AM, arves100 said:

I guess he needs this:

 

File cmd_gm.cpp:

class discall_func
{
    public:
        discall_func()  {}
        
        void operator () (LPDESC d)
        {
            if (!d->GetCharacter())
                return;
            
            if (d->GetCharacter()->IsGM())
                return;
            
            DESC_MANAGER::instance().DestroyDesc(d);
        }
};

ACMD(do_disconnect_all)
{
    const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();
    discall_func func;

    std::for_each(c_ref_set.begin(), c_ref_set.end(), func);
}

cmd.cpp

ACMD(do_disconnect_all);

and

    { "dcall",                do_disconnect_all,                    0,            POS_DEAD,    GM_IMPLEMENTOR },

 

COMMAND: /dcall  only Implementor

 

I'll test and tell if it worked :)

  • Confused 1
Link to comment
Share on other sites

1 hour ago, Chyu ^^ said:

But nobody can understand you. ¯\_(ツ)_/¯ 

lol?

the script is self explanatory:

 

1º quest:

command("shutdown")
		when shutdown1.timer begin
			notice_all("Atenção !!!")
			notice_all("Manutenção: O servidor será desligado em 10 minutos!")
			notice_all("Efetue logout para evitar que itens sejam perdidos!")
			timer("shutdown2", 60*5)
		end
		when shutdown2.timer begin
			notice_all("Atenção !!!")
			notice_all("Manutenção: O servidor será desligado em 5 minutos!")
			notice_all("Efetue logout para evitar que itens sejam perdidos!")
			timer("shutdown3", 60*3)
		end
		when shutdown3.timer begin
			notice_all("Atenção !!!")
			notice_all("Manutenção: O servidor será desligado em 2 minutos!")
			notice_all("Efetue logout para evitar que itens sejam perdidos!")
			timer("shutdown4", 60)
		end
		when shutdown4.timer begin
			notice_all("Atenção !!!")
			notice_all("Manutenção: O servidor será desligado em 1 minuto!")
			notice_all("Efetue logout para evitar que itens sejam perdidos!")
			timer("shutdown5", 30)
		end
		when shutdown5.timer begin
			notice_all("Atenção !!!")
			notice_all("Manutenção: O servidor será desligado em 30 segundos!")
			notice_all("Efetue logout para evitar que itens sejam perdidos!")
			timer("shutdown6", 15)
		end
		when shutdown6.timer begin
			notice_all("Atenção !!!")
			notice_all("Manutenção: O servidor será desligado em 15 segundos!")
			notice_all("Para mais informações acesse: www.metin2.org")
			timer("shutdown7", 5)
		end
		when shutdown7.timer begin
			command("shutdown")
		end

2º text in login server:

""SHUTDOWN"    : localeInfo.LOGIN_FAILURE_SHUTDOWN,"

 

MAINTENANCE

 

I need GMs not turned off.

Link to comment
Share on other sites

Look it is so easy

I have this idead you can make a quest that looks like an event you enable the event . the quest be like when login begin if it is gm charachter then return if it is npc(player) command dc "the player" and you can disable it just like an event .

Also make a timer when the player enter syschat"there is a maintenance" thene command logout is better

  • Love 1
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


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