Jump to content

arzzzae

Members
  • Posts

    83
  • Joined

  • Last visited

Posts posted by arzzzae

  1. Can someone show me an example of calling values in a row from a table when a player input something? For example. I have a npc which requires input from the player then the npc will send a query and check and return values.

     

    I'm currently trying to make an npc where if you enter a code, it will give you an item depending on what values you entered in the sql table.

     

    mes "Please enter the code.";
    next;
    input .@pc$;
    
    query_sql ("SELECT codes,reward FROM `pcodes` WHERE `codes`='"+escape_sql(#pc$)+"'", .@pc$,.@re);
    mes "Congratulations";
    next;
    getitem .@re,1;
    set .@pc$, 1;
    close;
    

     

     

    Sorry for terribad engrish.

  2. So, computer specs comes into the play.

    It depends on how many query your server do at a time finally, isn't it ?

     

    My computer start lagging when I make 100 loops (so ~300 query - 300000 query/sec)

    at 700 I can't sit

    Can I ask for your computer specs if you don't mind?
  3. I know that this topic has been asked alot. I do have 0 base knowledge about SQL except for the fact that I know SQL stores server data like string, integer variables and etc. I want to know a lot more about rA scripting with a mix SQL Query.

    For example, I want to add a new table in SQL that handles string variables and the new SQL Table will be called in scripts to check if the string variable is already in use.

    ---------------------------------------
    
    *query_sql("your MySQL query"{, <array variable>{, <array variable>{, ...}}});
    *query_logsql("your MySQL query"{, <array variable>{, <array variable>{, ...}}});
    
    Executes an SQL query. A 'select' query can fill array variables with up to 128 rows of values,
    and will return the number of rows (i.e. array size).
    
    Note that 'query_sql' runs on the main database while 'query_logsql' runs on the log database.
    
    Example:
    set @nb, query_sql("select name,fame from `char` ORDER BY fame DESC LIMIT 5", @name$, @fame);
    mes "Hall Of Fame: TOP5";
    mes "1."+@name$[0]+"("+@fame[0]+")"; // Will return a person with the biggest fame value.
    mes "2."+@name$[1]+"("+@fame[1]+")";
    mes "3."+@name$[2]+"("+@fame[2]+")";
    mes "4."+@name$[3]+"("+@fame[3]+")";
    mes "5."+@name$[4]+"("+@fame[4]+")";
    
    ---------------------------------------
    
    I have read that part in the script_commands.txt but I want to see more examples. Thank you.
  4. Just copy the mob_db.txt in your re folder into your pre-re folder.

    /// renewal drop rate algorithms
    /// (disable by commenting the line)
    ///
    /// leave this line to enable renewal item drop rate algorithms
    /// while enabled a special modified based on the difference between the player and monster level is applied
    /// based on the http://irowiki.org/wiki/Drop_System#Level_Factor table
    #define RENEWAL_DROP
    
    /// renewal exp rate algorithms
    /// (disable by commenting the line)
    ///
    /// leave this line to enable renewal item exp rate algorithms
    /// while enabled a special modified based on the difference between the player and monster level is applied
    #define RENEWAL_EXP 
    and make sure you leave the #define RENEWAL_DROP and #define RENEWAL_EXP without '//' to implement the renewal drops and renewal exp. After you are done with the source code compile and run your server and check for errors. I'm not sure if it'll work though.  /meh

    Also, don't forget to backup your files.

  5. how does it work?

    can you explain detail.

     

    i already make the custom vip card

    18103,VIP Ticket,Vip Ticket,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ set #Premium,#Premium + ( <# of days> * 24 * 3600 ); },{},{}
    
     

    Thanks

     

    You have to set the number of days in order for the item to work. The example below will make you a Premium user for 7 days once you use it.

     

    { set #Premium,#Premium + ( 7 * 24 * 3600 ); }
    This example is also the same thing as above except it doesn't use the mathematical formula.
    { set #Premium,#Premium + 604800; }
×
×
  • Create New...