pastebin - collaborative debugging tool
rathena.kpaste.net RSS


GM Status
Posted by Anonymous on Fri 25th Jan 2013 12:49
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.                 } else {
  23.                         set .@menu$, .@menu$ + "^FF0000"+.name$[.@i]+"^000000:";
  24.                 }
  25.         }
  26.        
  27.         if (.@menu$ != "") {
  28.                 mes "Select a GM to view more info.";
  29.                 set .@num, select(.@menu$) -1;
  30.                
  31.                 mes "[GM Checker]";
  32.                 mes "GM NAME: " + .name$[.@num];
  33.                 mes "STATUS:  " + (isloggedin(.account_id[.@num], .char_id[.@num]) ? "^008000Online" : "^FF0000Offline") + "^000000";
  34.                 if (checkvending(.name$[.@num]) == 1) mes "(vending)";
  35.                 else if (checkvending(.name$[.@num]) == 2) mes "(vending with @autotrade)";
  36.                 mes "Position: " + callsub(S_GMgroup2name,.group_id[.@num]);
  37.                 getmapxy .@map$,.@x,.@y,0, .name$[.@num];
  38.                 mes "Map: " + .@map$;
  39.         }
  40.         close;
  41.  
  42. OnInit:
  43.         query_sql "SELECT `char`.account_id, `char`.char_id, `char`.`name`, login.group_id " +
  44.                   "FROM login RIGHT JOIN `char` ON login.account_id=`char`.account_id " +
  45.                   "WHERE `group_id` >= 1", .account_id, .char_id, .name$, .group_id;
  46.         end;
  47. S_GMgroup2name:
  48.         set .@group_id, getarg(0,0);
  49.              if (.@group_id ==  0) set .@title$, "";
  50.         else if (.@group_id <= 40) set .@title$, "Police GM";
  51.         else if (.@group_id <= 60) set .@title$, "Event GM";
  52.         else if (.@group_id <= 90) set .@title$, "Co-owner";
  53.         else if (.@group_id <= 99) set .@title$, "Admin";
  54.         return .@title$;
  55. }

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