Advertisement
akbare

MVP-ranking

Dec 11th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. /*
  2.  
  3. CREATE TABLE IF NOT EXISTS `E-MVPRank` (
  4. `char_id` int(11) unsigned NOT NULL default '0',
  5. `name` varchar(30) NOT NULL DEFAULT '',
  6. `Count` int(11) unsigned NOT NULL default '0',
  7. PRIMARY KEY (`char_id`)
  8. ) ENGINE=MyISAM;
  9. */
  10.  
  11.  
  12. fayon,90,115,5 script Sample 757,{
  13. query_sql( "SELECT `name`,`Count` FROM `E-MVPRank` ORDER BY `Count` DESC LIMIT 5",.@Name$,.@Count );
  14. if( getarraysize( .@Name$ ) ){
  15. for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
  16. //mes "[ "+( .@i + 1 )+". ] "+.@Name$[.@i]+" - "+.@Count[.@i]+" Points";
  17. mes "[ "+( .@i + 1 )+". ] "+( ( .@Count[.@i] >= 50 )?"MvP Killer":"" )+" "+.@Name$[.@i]+" - "+.@Count[.@i]+" Points";
  18.  
  19. }else{
  20. mes "No Record Found.";
  21. }
  22. close;
  23.  
  24. OnNPCKillEvent:
  25. if( getmonsterinfo( killedrid,MOB_MVPEXP ) )
  26. query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1" );
  27. end;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement