Jump to content
  • 0

MVP Rank (position bug)


fallen0519

Question


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

This is my MVP rank script at below, I want to make it when character deleted, name in the position will be gone too.

prontera,162,152,4	script	MVP Ladder	619,{
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` = if ( `points` + 1 > 200, 0, `points` + 1 )";
	end;
}

Emistry teach me about the below addon, but I don't know how to fix it, hope someone can help me add it in the top script. Besides that, bottom.....

query_sql( "DELETE FROM `mvp_ranking` WHERE `name` NOT IN ( SELECT `name` FROM `char` )" );
query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points );

The main point is that there is something wrong with this MVP Rank script, at first I saw a player with 67 MVP Killed, and then the next day I click the NPC, it shows 11 MVP Killed. HELP~~ Anybody know whats wrong about this please !! =(((

Edited by fallen0519
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

http://rathena.org/board/topic/89128-rank-mvp/?p=252676

 

From Rules

Rules

Duplicate topics are not allowed. Post your topic once, in the correct section. If you accidentally post in the wrong section, use the Report button to report your own post.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...