Advertisement
akbare

GM-online checker

Sep 4th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. prontera,162,179,0 script GM Status 56,{
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement