- prontera,155,88,0 script VIP Stats Checker 910,{
- query_sql "SELECT `char`.account_id,`name`,SUM(online) AS online, " +
- "`value`-UNIX_TIMESTAMP() AS secs_left " +
- "FROM global_reg_value LEFT JOIN `char` ON global_reg_value.account_id=`char`.account_id " +
- "WHERE global_reg_value.str='#VIP_expire' AND CAST(`value` AS UNSIGNED) > UNIX_TIMESTAMP() " +
- "GROUP BY `char`.account_id " +
- "ORDER BY CAST(`value` AS SIGNED) ASC LIMIT 128",
- .@account_id, .@name$, .@online, .@secs_left;
- mes "[ VIP Stats Checker]";
- mes "We have "+getarraysize(.@account_id)+" "+((getarraysize(.@account_id)==1)?"VIP":"VIPs")+" in <ServerName>";
- mes " ";
- for (set .@i,0; .@i<getarraysize(.@account_id); set .@i,.@i+1) {
- if (.@online[.@i])
- mes (.@i+1)+". ^008000"+rid2name(.@account_id[.@i])+"^000000 - "+callsub(S_Time2Str,.@secs_left[.@i])+" left";
- else
- mes (.@i+1)+". ^FF0000"+.@name$[.@i]+"^000000 - "+callsub(S_Time2Str,.@secs_left[.@i])+" left";
- }
- close;
- // converts seconds to d,h,m string
- S_Time2Str:
- set .@seconds, getarg(0);
- set .@seconds, .@seconds - set(.@days, .@seconds / 86400) * 86400;
- set .@seconds, .@seconds - set(.@hours, .@seconds / 3600) * 3600;
- set .@seconds, .@seconds - set(.@minutes, .@seconds / 60) * 60;
- if (.@days)
- set .@string$, .@string$ + .@days + "d ";
- if (.@hours)
- set .@string$, .@string$ + .@hours + "h ";
- if (.@minutes)
- set .@string$, .@string$ + .@minutes + "m";
- return .@string$;
- }
VIP Status Checker
Posted by Anonymous on Wed 26th Oct 2011 08:27
raw | new post
modification of post by Anonymous (view diff)
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.
eathena.kpaste.net RSS