pastebin - collaborative debugging tool
rathena.kpaste.net RSS


Untitled
Posted by Anonymous on Wed 20th Feb 2013 01:10
raw | new post

  1. prontera,155,188,0      script  Reset Position  910,{
  2.         mes "[Reset Position]";
  3.         mes "I can reset the position of your char on ^0000FFanother^000000 account.";
  4.         next;
  5.         mes "(For your char that is stuck)";
  6.         mes "Enter your username:";
  7.         input .@userid$;
  8.         mes "Enter your password:";
  9.         input .@user_pass$;
  10.         next;
  11.        
  12.         query_sql "SELECT account_id FROM login WHERE userid='"+.@userid$+"' AND user_pass='"+(.@use_MD5_passwords ? md5(.@user_pass$):.@user_pass$)+"'", .@account_id;
  13.         if (!.@account_id) {
  14.                 set @bruteforce, @bruteforce +1;
  15.                 if (@bruteforce >= 5) {
  16.                         mes "^FF0000 Unable to process your request, please contact a GM.";
  17.                 } else {
  18.                         mes "^FF0000 Invalid username/password, or account does not exist.";
  19.                 }
  20.                 close;
  21.         } else if (.@account_id == playerattached()) {
  22.                 mes "^FF0000 You are already logged into this account!";
  23.                 close;
  24.         }
  25.        
  26.         // get list of chars on that account
  27.         query_sql "SELECT char_id,`name` FROM `char` WHERE account_id="+.@account_id, .@char_id, .@name$;
  28.         if (getarraysize(.@char_id) == 0) {
  29.                 mes "^FF0000 There are no chars on that account.";
  30.                 close;
  31.         }
  32.         for (set .@i,0; .@i<getarraysize(.@char_id); set .@i,.@i+1)
  33.                 set .@menu$, .@menu$ + .@name$[.@i]+":";
  34.         mes "Which char do you want to reset position?";
  35.         set .@num, select(.@menu$) -1;
  36.        
  37.         if (isloggedin(.@account_id)) {
  38.                 mes "^FF0000 You must log off all chars on that account first.";
  39.                 close;
  40.         }
  41.        
  42.         // reset position
  43.         query_sql "UPDATE `char` SET last_map=save_map, last_x=save_x, last_y=save_y WHERE char_id="+.@char_id[.@num];
  44.         mes "^0000FF"+.@name$[.@num]+"'s^000000 position has been reset. ^_^";
  45.         close;
  46.  
  47. OnInit:
  48.         set .@use_MD5_passwords, 0; // set to 1 for "yes"
  49.         end;
  50. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at