Jump to content
  • 0

can modify mvp ranking this script


Question

5 answers to this question

Recommended Posts

Posted

or


/* 

CREATE TABLE IF NOT EXISTS `E-MVPRank` (
	`char_id` int(11) unsigned NOT NULL default '0',
	`name` varchar(30) NOT NULL DEFAULT '',
	`Count` int(11) unsigned NOT NULL default '0',
	PRIMARY KEY  (`char_id`)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS `E-MVPRank_dummy` (
	`id` int(11) NOT NULL auto_increment,
	`char_id` int(11) unsigned NOT NULL default '0',
	`name` varchar(30) NOT NULL DEFAULT '',
	`Count` int(11) unsigned NOT NULL default '0',
	PRIMARY KEY  (`id`),
	KEY `char_id` (`char_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1;

*/

prontera,148,167,5	script	Sample	757,{
query_sql( "SELECT `id`, `Count` FROM `E-MVPRank_dummy` where char_id = " + getcharid(0), .@rank, .@count );
if ( .@count ) {
	query_sql "delete from `E-MVPRank_dummy` where char_id = " + getcharid(0);
	if ( .@rank == 1 )
		getitem 501,5;
	else if ( .@rank <= 10 )
		getitem 501,10;
	else if ( .@rank <= 50 )
		getitem 501,15;
	// etc..
	mes "you were rank " + .@rank + " in the previous rank";
	close;
}
query_sql( "SELECT `name`,`Count` FROM `E-MVPRank` ORDER BY `Count` DESC LIMIT 5",.@Name$,.@Count );
if( getarraysize( .@Name$ ) ){
	for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
		mes "[ "+( .@i + 1 )+". ] "+.@Name$[.@i]+" - "+.@Count[.@i]+" Points";
}else{
	mes "No Record Found.";
}
close;

OnNPCKillEvent:
if( getmonsterinfo( killedrid,MOB_MVPEXP ) )
	query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1" );
end;
OnHour00:
	query_sql "truncate table `E-MVPRank_dummy`";
	query_sql "INSERT into `E-MVPRank_dummy` (`id`,`char_id`,`name`,`Count`)  SELECT '',`char_id`,`name`,`Count` FROM `E-MVPRank` order by `Count` desc";
	query_sql "truncate table `E-MVPRank`";
}
Posted (edited)

OH THANKS SPECIAL THANKS TO EMISTRY

 

Rank Reset Mail Send And got item

 

and i test rank #1 why my mail send me rank 102


i change this line 

 

set .@offset,.@offset + 1; ok this good but i rank #1 but i got mail rank 2 and reward too

 

and i test set .@offset,.@offset + 0; this loop

Edited by sumano
Posted

OH thanks you it work

 

and i have last question

 

it can make rank name like @fakename

ex.

100 Kill = [ Boss ]-Admin ( my charactor name Admin )

90 Kill = [ Captain ]-Admin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...