Jump to content

Denis

Banned
  • Posts

    1031
  • Joined

  • Last visited

  • Days Won

    53
  • Feedback

    0%

Posts posted by Denis

  1.  

     

     
     
    good as are'm not speak good Spanish English have a problem with the vanilla game use the file of synera

    https://metin2.download/picture/xD58OD1Ol4RiR1FN3cyPF6hQ8QXZFhZ8/.png

    These characters come alone without player

     

    You have only 1 post, and you want help.

    Forgot this.

     

     

    Why are you always so arrogant?What's the problem if he has one post?He asked for help if you don't want to help just don't comment.

     

    Now at our subject,

    Post your syserr from db/auth/ch1

  2.  

    You think it's a good idea to use constants or should I use array like you said?

     

    I have searched the web for more informations expecialy benchmarks about this topic but i cant really find something informative. What i can say (definitively) is: If your langugae file is not getting big (~50mb) you can use your script without thought. I think there is no reason to think about memory usage or something else if your project isnt that big. Personally i would use an array but you can do this with reading a txt file like your example. Constants defined using define() are fairly slow in PHP.

     

    edit://

    compile-time constants like 

    const TITLE = VALUE;

    (since php5.3) are 2x faster.

     

    Source: http://stackoverflow.com/questions/2447791/define-vs-const

     

     

    I'm already using array for translation,anyway, thank you.

    • Love 2
  3. quest item_remover begin
    	state start begin
    		when 20092.take begin
    			local code = item.get_vnum()
    			say_title("Item Remover")
    			say("Do you want to delete this item ?")
    			say_item_vnum(code)
    			say("Ok, I will remove "..item.get_name().." for you.")
    			local s = select("Delete 1x","Delete the whole stack","No")
    			if s == 1 then
    				pc.remove_item(code,1)
    			elseif s == 2 then
    				item.remove()
    			end
    		end
    		when 20092.chat."How can i delete a item?" begin
    			say_title("Item Remover")
    			say("Hello !")
    			say("If you delete a item you can")
    			say("take it on me !")
            end   
        end
    end
    

    Some tips:

    • item.remove() is used to remove the item stack. It doesn't take any arguments, so you can't use item.remove(vnum,quantity)
    • If you want to delete just one item from the stack use pc.remove_item(vnum,quantity)
    • Love 3
  4.  

     

    PNGs You can convert tga to png using IrfanView

    Already know this but it takes so much time to convert file by file. is there any other solution (application) to convert all files by one click?

     

    :main
    @echo OFF
    @echo ¯ Aemon, metin2dev.;
    @echo   metin2dev.com.
    @echo ---
    
    
    :rename
    set OLD=
    set /P OLD=Choose the old extension : %=%
    if "%OLD%" == "" GOTO error
    set NEW=
    set /P NEW=Choose new extension   : %=%
    if "%NEW%" == "" GOTO error
    @ren *.%OLD% *.%NEW%
    @echo .%OLD% files have been renamed to .%NEW%
    @echo ---
    GOTO fine
    :errore
    @echo Error!
    @echo Choose a valid extension!
    @echo Restart the program and try again.
    @echo ---
    GOTO Exit
    :fine
    @echo You change the extension, good job...
    :Exit
    @pause
    

    Paste it in a notepad, and save it with .bat extension.

     

    rename != conversion..

    • Love 2
  5. quest mapapvp begin
        state start begin
            when login with pc.get_map_index() == 70 begin
                say("Welcome to PVP Map")
                say("You need to kill 3 players.")
                say("When you kill 3 players you get the reward.")
                pc.setqf("conta_kills",1)
            end
            when kill with npc.is_pc() and pc.get_map_index() == 70 begin
                if pc.getqf("conta_kills") == 3 then
                    pc.change_money(250000)
                    warp_to_village()
                else
                    pc.setqf("conta_kills", pc.getqf("conta_kills")+1)
                end
            end        
        end
    end
    

    There's no point to create a new quest state..

    • Love 2
  6. So far I've been using something like this:

    <?php    
    public function load($lang)
    {
        $file = file($lang.".txt", FILE_IGNORE_NEW_LINES);
            
        foreach ($file as $i => $line)
        {
            $line = trim($line);
    
            $token = explode(" = ", $line);
                    
            if(!defined($token[0]))
            {
                define($token[0],$token[1]);
            }
            else
            {
                die($token[0]." is already defined");
            }
        }
    }
    else
    {
        die('error');
    }
    
    load('lang'); /* At lang.txt:
        TITLE = Hello
    */
    echo TITLE;
    ?>
    

    You think it's a good idea to use constants or should I use array like you said?

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