pastebin - collaborative debugging tool
rathena.kpaste.net RSS


Untitled
Posted by Anonymous on Sat 26th Jan 2013 12:03
raw | new post

  1. prontera,155,188,0      script  GM_Status       910,{
  2.         if (getgmlevel() >= 99) {
  3.                 if (select("View GM Status:Reload GM list") == 2) {
  4.                         mes "Close this window to reload the GM list.";
  5.                         close2;
  6.                         goto OnInit;
  7.                 }
  8.         }
  9.        
  10.         mes "[GM Checker]";
  11.         if (getarraysize(.char_id) == 1) {
  12.                 mes "There is 1 GM.";
  13.         } else {
  14.                 mes "There are " + getarraysize(.char_id) + " GMs.";
  15.         }
  16.        
  17.         // build menu of GM names
  18.         for (set .@i,0; .@i < getarraysize(.char_id); set .@i,.@i+1) {
  19.                 if (isloggedin(.account_id[.@i], .char_id[.@i])) {
  20.                         getmapxy .@map$,.@x,.@y,0, .name$[.@i];
  21.                         set .@menu$, .@menu$ + "^008000"+.name$[.@i]+"^000000 ("+.@map$+"):";
  22.                         set .@online_gm_count, .@online_gm_count +1;
  23.                 } else {
  24.                         set .@menu$, .@menu$ + "^FF0000"+.name$[.@i]+"^000000:";
  25.                 }
  26.         }
  27.         mes "Current Online GM: " + .@online_gm_count;
  28.        
  29.         if (.@menu$ != "") {
  30.                 mes "Select a GM to view more info.";
  31.                 next;
  32.                 set .@num, select(.@menu$) -1;
  33.                
  34.                 mes "[GM Checker]";
  35.                 mes "GM NAME: " + .name$[.@num];
  36.                 mes "STATUS:  " + (isloggedin(.account_id[.@num], .char_id[.@num]) ? "^008000Online" : "^FF0000Offline") + "^000000";
  37.                 if (checkvending(.name$[.@num]) == 1) mes "(vending)";
  38.                 else if (checkvending(.name$[.@num]) == 2) mes "(vending with @autotrade)";
  39.                 mes "Position: " + callsub(S_GMgroup2name,.level[.@num]);
  40.                 getmapxy .@map$,.@x,.@y,0, .name$[.@num];
  41.                 mes "Map: " + .@map$;
  42.         }
  43.         close;
  44.  
  45. OnInit:
  46.         query_sql "SELECT `char`.account_id, `char`.char_id, `char`.`name`, login.level " +
  47.                   "FROM login RIGHT JOIN `char` ON login.account_id=`char`.account_id " +
  48.                   "WHERE `level` >= 1", .account_id, .char_id, .name$, .level;
  49.         end;
  50. S_GMgroup2name:
  51.         set .@level, getarg(0,0);
  52.              if (.@level ==  0) set .@title$, "";
  53.         else if (.@level <= 40) set .@title$, "Police GM";
  54.         else if (.@level <= 60) set .@title$, "Event GM";
  55.         else if (.@level <= 90) set .@title$, "Co-owner";
  56.         else if (.@level <= 99) set .@title$, "Admin";
  57.         return .@title$;
  58. }

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