- script JM_MVPTR FAKE_NPC,{
.@npcname$ = "[ TOP MvP ]";
query_sql "SELECT name, value, date FROM JM_MVPTR ORDER BY value DESC, date DESC LIMIT 1",.@rpname$,.@value;
mes .@npcname$;
if(.@value){
mes "Player: "+.@rpname$,
(.@value>1? "Points ":"Point: ")+.@value;
close;
} else {
mes "There is no top MVP at the moment.";
close;
}
end;
OnInit:
query_sql "CREATE TABLE IF NOT EXISTS JM_MVPTR (char_name VARCHAR(50) UNIQUE, value FLOAT, date DATETIME)";
end;
}
prontera,100,100,4 duplicate(JM_MVPTR) TOP MvP#prt 565
I think there's an issue with #HEROPOINT; it belongs to the account, and there are multiple characters in the account. I wrote this script quickly, so it's good to test it as I'm not sure if it will work correctly. The SQL table will be imported automatically once the NPC is added to the game.
Below is what you should add in place of #HEROPOINTS:
.@mkname$ = strcharinfo(0);
query_sql "INSERT INTO JM_MVPTR (name, value, date) VALUES ('"+scape_sql(.@mkname$)+"', 1, NOW()) ON DUPLICATE KEY UPDATE value = value + 1, date = NOW()";
That English was from a correction tool, haha. If you need anything, just let me know