Advertisement
johnlol

GM Online List v2

May 19th, 2019
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. prontera,201,162,4  script  GM List 861,{
  3.     function get_GM_Title;
  4.     function get_GM_State;
  5.    
  6.     cutin "kafra_09",2;
  7.    
  8.     .@size = query_sql( "SELECT `char`.`account_id`,`char`.`char_id`,`char`.`name`,`login`.`lastlogin`,TIMEDIFF( NOW(),`login`.`lastlogin` ),`login`.`group_id` FROM `char` INNER JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `group_id` > "+.min_group_id+" ORDER BY `char`.`online` DESC, `login`.`group_id` DESC LIMIT 10",.@aid,.@cid,.@name$,.@lastlogin$,.@lastlogin_duration$,.@group_id );
  9.  
  10.     mes "There are total ^FF0000"+.@size+"^000000 GM(s)";
  11.     while ( .@i < .@size ) {
  12.         mes get_GM_Title( .@name$[.@i],.@group_id[.@i] )+" - "+get_GM_State( .@aid[.@i],.@cid[.@i],.@name$[.@i] );
  13.         mes "Last Seen: ^777777"+.@lastlogin_duration$[.@i]+" hours ago^000000";
  14.         mes "Last Login: ^777777"+.@lastlogin$[.@i]+"^000000";
  15.         mes " ";
  16.         .@i++;
  17.     }
  18.     close2;
  19.     cutin "",255;
  20.     end;
  21.    
  22.     OnInit:
  23.         .min_group_id = 10;
  24.         .afk_second = 300;
  25.         end;
  26.  
  27.     function    get_GM_Title    {
  28.         switch ( getarg( 1,0 ) ) {
  29.             default: .@title$ = "";
  30.             case 1: .@title$ = "(Super Player)";
  31.             case 2: .@title$ = "(Support)";
  32.             case 3: .@title$ = "(Script Manager)";
  33.             case 4: .@title$ = "(Event Manager)";
  34.             case 10: .@title$ = "(Law Enforcement)";
  35.             case 99: .@title$ = "(Admin)";
  36.         }
  37.        
  38.         return .@title$ + " " +  getarg( 0,"NULL" );
  39.     }
  40.    
  41.     function    get_GM_State    {
  42.         .@aid = getarg( 0,0 );
  43.         .@cid = getarg( 1,0 );
  44.         .@name$ = getarg( 2,"NULL" );
  45.        
  46.         if ( isloggedin( .@aid,.@cid ) ) {
  47.        
  48.             .@idle = checkidle( .@name$ );
  49.            
  50.             if ( .@idle >= .afk_second && .afk_second ) {
  51.                 .@state$ = "AFK/Away";
  52.             }
  53.             else {
  54.                 .@state$ = "Online";
  55.             }
  56.         }
  57.         else {
  58.             .@state$ = "Offline";
  59.         }
  60.        
  61.         return .@state$;
  62.     }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement