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 thatthere 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 !! =(((
Question
fallen0519
This is my MVP rank script at below, I want to make it when character deleted, name in the position will be gone too.
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.....
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 fallen0519Link to comment
Share on other sites
1 answer to this question
Recommended Posts