Jump to content

Senshuken

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by Senshuken

  1. Well here's a simple @notrade with some source edit. There might be a better way to do this. I changed some of structs to include a new field int no_trade.

     

    Anyways to add the patch, first put the file in the root directory your server then do the following:

     

    patch -p0 < notrade.patch
    

     

    To remove the changes do

     

    patch -p0 -R < notrade.patch
    

     

    To change the default state of the notrade change it at the bottom of the player.conf file

     

     

    // conf/battle/player.conf
    
    // Disable trading between players unless they turn it off
    // Default: 0 (0: disabled, 1: enabled).
    // [Senshuken]
    no_trade: 0

     

    I haven't tested it extensively, just did a small test. Let me know how it works out for you.

     

    PS: If someone finds my way of doing this a bad idea, please let me know what I can do to improve it. Thanks.

    notrade.patch

  2. Hi Senshuken, thank you for your suggestion.

    Yes, we already have plans to update IPB and this will probably happen in the next week or two. Since we have a lot of custom edits, we will be testing the update on a copy of the board before updating the live one.

    cool thanks.

  3. This does already work with setd and getd:

    getd(".somearray["+.@i+"]");
    setd ".somearray["+.@i+"]", 0;
    

    or did you mean something like that:

    setdarray ".somearray", 0, 5, 4, 3, 6;
    

    but here getdarray would make no sense, since you can only get 1 value at a time

    You're right, getdarray would be pointless, but yes I do mean the setdarray ".somearray", 0, 1, 2, 3, 4

  4. add

    • setdarray
    • getdarray

    I think getelementofarray can be used to do some of this.

    For example:

    set .@group, 1;
    // for each element in .items_1[]
    for (set .@i,0; .@i<10; set .@i, .@i+1) {
    set .@this_item, getelementofarray(getd(".items_"+.@group), .@i);
    // do stuff with .@this_item
    
    }

    Sorry, I meant it as a dynamic array setter and getter.

  5. Running this

    - script test -1,{
    OnWhisperGlobal:
    set var1, var2;
    dispbottom "Set var1 to var2";
    set var1, .var2;
    dispbottom "Set var1 to .var2";
    set var1, $var2;
    dispbottom "Set var1 to $var2";
    end;
    }
    

    Outputs this on the console

    [Error]: script:copyarray: illegal scope
    [Debug]: Data: variable name='var1'
    [Debug]: Data: variable name='$var2' index=0
    [Debug]: Source (NPC): test (invisible/not on a map)
    

    And running this

    - script test -1,{
    OnWhisperGlobal:
    set var1, var2;
    dispbottom "Set var1 to var2";
    set var1, .var2;
    dispbottom "Set var1 to .var2";
    set var1, $var2;
    dispbottom "Set var1 to $var2";
    end;
    }
    

    Outputs this

    [Error]: script:copyarray: illegal scope
    [Debug]: Data: variable name='var1'
    [Debug]: Data: variable name='.var2' index=0
    [Debug]: Source (NPC): test (invisible/not on a map)
    

    Any idea why it's doing it? Am I not allowed to set different type of variables to player bounded variables?

    Reported: http://rathena.org/board/tracker/issue-5675-copying-global-variable-to-player-variable-error/

×
×
  • Create New...