Jump to content
  • 0

When player kill a MVP, ladder is not working


fallen0519

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

Hmm, I am using the following script, when the MVP die, players rank is not updated, means didn't +1, may I know how to fix this bug. Thanks in advance~


prontera,162,152,4	script	MVP Ladder	619,{
	query_sql( "DELETE FROM `mvp_ranking` WHERE `name` NOT IN ( SELECT `name` FROM `char` )" );
	set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points );
	mes "[^FF0000MvP ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
	for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
		mes "Top ^FF0000" +(.@c + 1) +"^000000 ^0000FF" + .@name$[.@c] +"^000000 with ^FF0000" + .@points[.@c] +"^000000 MvP killed.";
	close;

OnInit: // Script Configuration
	set .a, 1; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On]
	set .top, 10; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables)
	waitingroom "MvP Rank",0;
	end;

OnNPCKillEvent: // Script execution
	if ( getmonsterinfo( killedrid,MOB_MODE ) & 0x0020  == 0 ) end;// not an mvp
	if (.a) // If announce On
		announce "Player [" +strcharinfo(0) +"] had killed MVP [" +getmonsterinfo(killedrid,0) +"] in [" +strcharinfo(3) +"]",bc_blue|bc_all;
	query_sql "insert into `mvp_ranking` value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 1 ) on duplicate key update `points` = `points` + 1";
	end;
}
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

×
×
  • Create New...