Jump to content

amosth

Inactive Member
  • Posts

    163
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by amosth

  1. 18 hours ago, Syreldar said:
    
    quest ok begin
    	state start begin
    		when info or button begin 
    			say("blablabla")
    			if (select("bla si", "bla no") == 1) then
    				local _, query = mysql_direct_query(string.format("SELECT ok FROM account.account WHERE id = %d LIMIT 1;", pc.get_account_id()));
    				
    				say(string.format("value: %d;", query[1].ok))
    			end -- if
    		end -- when
    	end -- state
    end -- quest

     

    make sure your 'ok' column only accepts "int" as value types.

    Thanks man :D

    			if (select("bla si", "bla no") == 1) then
    				local a_, query = mysql_direct_query(string.format("SELECT ok FROM account.account WHERE id = %d LIMIT 1;", pc.get_account_id()));
    				if a_== id then
    					say("ok")
    				else
    					say("no")
    				end
    				--say(string.format("value: %d;", query[1].ok))
    			end -- if

     

    one last question, how do I check 2 column in the same result?

     

    Example:

     

    			if (select("bla si", "bla no") == 1) then
    				local a_, query = mysql_direct_query(string.format("SELECT ok,life FROM account.account WHERE id = %d LIMIT 1;", pc.get_account_id()));
    				if a_== id then
    					say("ok")
    				else
    					say("no")
    				end
    			end -- if

     

    EDIT: Is not working =/

     

    			if (select("bla si", "bla no") == 1) then
    				local a_, query = mysql_direct_query(string.format("SELECT ok FROM account.account WHERE id = %d LIMIT 1;", pc.get_account_id()));
    				if a_== id then
    					say("ok")
    				else
    					say("no")
    				end
    				--say(string.format("value: %d;", query[1].ok))
    			end -- if
  2. Hello friends,

    I have created a column called "ok" in account, now I need to click on npc to check this example column:

    column "ok" = 0

    if the value of the "ok" column is 0 goes from the error message, if the value of the "ok" column is 1 of the correct message.

    I hope you could understand.

    Thank you for the attention.

     

            when info or button begin 
    			say("blablabla")
    			local f = select("bla si","bla no")
    			if f == 1 then
    				local c,query = mysql_direct_query("SELECT * FROM account.account WHERE id = '"..pc.get_account_id().."' LIMIT 1;")
    				if query[1].ok < 1 then
    					say'existe un valor menor a 1'
    				else
    					say'existe un valor de 1'
    				end
    			end
    			if f == 2 then
    			return
    			end
            end 

     

    not work =/

  3. I have a column and in that column I need to check 0 or 1,

     

    column "verify" 0 or 1

     

    quest testserver begin
    	state start begin
    		state start begin
    			when login or begin
    				set_state( gotoinfomation )
    			end
    		end
    		state gotoinfomation begin
    			when letter begin
    				send_letter("Welcome")
    			end
    			when button or info begin
    				say("text")
    				say("")
    				local f = select("Yes count","No count")
    				if f == 1 then
    				local res1, verify = mysql_direct_query("select * from account.account;")
    				mysql_direct_query("SELECT verify FROM account.account WHERE verify = '0'")
    				else
    				say("text2")
    				if f == 2 then
    				return
    				end
    				--set_state( gototeacher )
    				--end
    			end
    		end
    	end
    end

     

  4. 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.

  5. 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
  6. 10 hours ago, WeedHex said:

    from python, need to use Bip01

     

    I'm using

    	chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+21, "Bip01", "D:/ymir work/pc/common/effect/armor/roxo.mse")
    	chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+22, "Bip01", "D:/ymir work/pc/common/effect/armor/vermelho.mse")
    	chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+23, "Bip01", "D:/ymir work/pc/common/effect/armor/verde.mse")
    	chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+24, "Bip01", "D:/ymir work/pc/common/effect/armor/marron.mse")
    	chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+25, "Bip01", "D:/ymir work/pc/common/effect/armor/azul.mse")
  7. Hi :)

     

    Can you help me with this script?

     

    case CItemData::ITEM_TYPE_COSTUME:
    		if (refine < 7)
    			return 0;
    
    		if (pItem->GetSubType() == CItemData::COSTUME_BODY)
    		{
    			__ClearArmorRefineEffect();
    			m_armorRefineEffect = EFFECT_REFINED+EFFECT_BODYARMOR_REFINED7+refine-7;
    			__AttachEffect(m_armorRefineEffect);
    		}
    		break;

     

     

     

    Error: https://metin2.download/picture/oni18S6FMpFKN50vbLG2ddOse3S7oXN1/.gif

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