Hi, nice to meet you
how can i make the npc ranking give prizes to the first place
Quote
prontera,164,174,3 script MvP Rank Kamael 660,{
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 );
set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points );
mes "[^FF0000MvP ^0000FFRank ^00FF00 ^FF0000" + .top +"^000000]";
for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
mes "Lider ^FF0000" +(.@c + 1) +"^000000 ^0000FF" + .@name$[.@c] +"^000000 con ^FF0000" + .@points[.@c] +"^000000 MvP.";
mes "* ^ff0000 RANK SE RESETEA LOS DOMINGOS ^000000 *";
close;
OnInit: // Script Configuration
// lsitado mvp
setarray $mobmvpA[0],1046,1059,1086,1112,1115,1147,1150,1159,1885,1980,1389,1038,1039,1087,1157,1190,1251,1252,1272,1312,1373,1399,1418,1492,1511,1583,1630,1658,1785,1623,1685,1688,1708,1719,1734,1751,1768,1832,1871,1874,1917,2022,16461647,1648,1649,1650,1651;
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)
end;
OnNPCKillEvent: // Script execution
for (set .@i, 0; .@i < getarraysize($mobmvpA); set .@i, .@i + 1) {
if(killedrid == $mobmvpA[.@i]) {
if (.a) // If announce On
announce "[ Moodplay Anuncia ]: [ " +getmonsterinfo(killedrid,0) +" ] ha sido destrozado por [ " +strcharinfo(0) +" ]",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;
Question
manuel
Hi, nice to meet you
how can i make the npc ranking give prizes to the first place
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.