I've been trying to create or research a sql query to return a Player's Top Position Number through a command @LRank.
I could have them listed by positions but I really do not know how to return the exact TOP # for the player when using the command even if he is not within the Top 10 Ranking.
I was wondering if you could assist me by finding out the correct script to do it.
Below is my script so far which is properly working at the moment:
OnRank:
dispbottom " ";
dispbottom "=============== Ranking ===============", 0xffe066;
soundeffect "hp.wav", 0; // this will play the soundeffect
dispbottom " ", 0xFA4040;
dispbottom " Top 10 List", 0xFA4040;
dispbottom " ", 0xFA4040;
set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points );
for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
dispbottom "[ " +(.@c + 1) +" ] : " + .@name$[.@c] +" : [ " + .@points[.@c] +" ] Pts", 0xffffff;
dispbottom " ", 0xFA4040;
*********** THIS IS THE PART THAT I'M STRUGGLING WITH ***********
dispbottom "============== My Rank ==============", 0xffe066;
query_sql "SELECT `char_id` , `points` FROM `mvp_ranking` ORDER BY `points` DESC",.@char_id,.@rank;
dispbottom "My Top is: " + .@rank+ ".", 0x6666ff;
dispbottom "==========================================", 0xffe066;
end;
Hello community,
I've been trying to create or research a sql query to return a Player's Top Position Number through a command @LRank.
I could have them listed by positions but I really do not know how to return the exact TOP # for the player when using the command even if he is not within the Top 10 Ranking.
I was wondering if you could assist me by finding out the correct script to do it.
Below is my script so far which is properly working at the moment:
OnRank: dispbottom " "; dispbottom "=============== Ranking ===============", 0xffe066; soundeffect "hp.wav", 0; // this will play the soundeffect dispbottom " ", 0xFA4040; dispbottom " Top 10 List", 0xFA4040; dispbottom " ", 0xFA4040; set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points ); for (set .@c, 0; .@c < .@size; set .@c, .@c + 1) dispbottom "[ " +(.@c + 1) +" ] : " + .@name$[.@c] +" : [ " + .@points[.@c] +" ] Pts", 0xffffff; dispbottom " ", 0xFA4040; *********** THIS IS THE PART THAT I'M STRUGGLING WITH *********** dispbottom "============== My Rank ==============", 0xffe066; query_sql "SELECT `char_id` , `points` FROM `mvp_ranking` ORDER BY `points` DESC",.@char_id,.@rank; dispbottom "My Top is: " + .@rank+ ".", 0x6666ff; dispbottom "==========================================", 0xffe066; end;
I hope you can give me a hand on this.
Thank you.
Share this post
Link to post
Share on other sites