ZelosAvalon 14 Posted May 27, 2014 I have an event that when a player kills a monster he gains 1 Event_Point. How can I create a top 10 ranking of the players who have more Event_Point? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted May 27, 2014 OnRanking: mes "[Ranking System]"; query_sql "SELECT `char_reg_num_db`.`value`,`char`.`name` FROM `char` INNER JOIN `char_reg_num_db` ON `char_reg_num_db`.`char_id`=`char`.`char_id` WHERE `char_reg_num_db`.`key`='Event_Point' ORDER BY `char_reg_num_db`.`value` DESC LIMIT 10",.@value,.@name$; for (.@i=0; .@i<getarraysize(.@value); .@i++){ mes (.@i+1)+".) ["+ .@name$[.@i] +"] - "+ .@value[.@i]; } deletearray .@name$[0],10; deletearray .@value$[0],10; close; if the variable is Event_Point, this would work. 1 ZelosAvalon reacted to this Quote Share this post Link to post Share on other sites
0 ZelosAvalon 14 Posted May 27, 2014 (edited) don't work =/ how i'll add this SQL ? i need to add : "SELECT `char_reg_num_db`.`value`,`char`.`name` FROM `char` INNER JOIN `char_reg_num_db` ON `char_reg_num_db`.`char_id`=`char`.`char_id` WHERE `char_reg_num_db`.`key`='Event_Point' ORDER BY `char_reg_num_db`.`value` DESC LIMIT 10" or i need to put .@value,.@name$; too ? i dont undestand much about SQL tables can u help me ? i dont have a sql table for my #Event_Points, maybe can you help me to make one! i need two var: T_Event_Point = for count total Event Points and use in ranking/ Event_Point = the points for use to buy items on game! Edited May 27, 2014 by ZelosAvalon Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted May 28, 2014 don't work =/ how i'll add this SQL ? i need to add : "SELECT `char_reg_num_db`.`value`,`char`.`name` FROM `char` INNER JOIN `char_reg_num_db` ON `char_reg_num_db`.`char_id`=`char`.`char_id` WHERE `char_reg_num_db`.`key`='Event_Point' ORDER BY `char_reg_num_db`.`value` DESC LIMIT 10" or i need to put .@value,.@name$; too ? i dont undestand much about SQL tables can u help me ? i dont have a sql table for my #Event_Points, maybe can you help me to make one! i need two var: T_Event_Point = for count total Event Points and use in ranking/ Event_Point = the points for use to buy items on game! first of all, I posted the script part,2) can you tell exact variable, you told #Event_Points on first line and Event_Point on second line. 1 ZelosAvalon reacted to this Quote Share this post Link to post Share on other sites
0 ZelosAvalon 14 Posted May 28, 2014 when i told i have two var: #Event_Point - this var u get on kill monsters in a event ( this var u use for buy items on game ) #T_Event_Point - this var its just for count ur event points acquired at all events ( this var u don't use for nothing just for count ) I would like to add these two variables in a sql table for safety, but idk how, can you help me ? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted May 28, 2014 when i told i have two var: #Event_Point - this var u get on kill monsters in a event ( this var u use for buy items on game ) #T_Event_Point - this var its just for count ur event points acquired at all events ( this var u don't use for nothing just for count ) I would like to add these two variables in a sql table for safety, but idk how, can you help me ? #Event_point and #T_Event_Point are account variables, so what should be displayed on ranking along with those variables values? 1 ZelosAvalon reacted to this Quote Share this post Link to post Share on other sites
0 ZelosAvalon 14 Posted May 29, 2014 should be displayed the 10 players (TOP 10) which contains more Event Points, which are contained in variable #T_Event_Point. #T_Event_Point contains all points earned in all events I would like to see in a npc the list of 10 players that contains more points. example: mes "Event Ranking" mes "Top 10 Event players" 1st - Player Name - [Number of T_Event_Point #] 2nd - Player Name - [Number of T_Event_Point #] ... 10th - Player Name - [Number of T_Event_Point #] Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted May 29, 2014 should be displayed the 10 players (TOP 10) which contains more Event Points, which are contained in variable #T_Event_Point. #T_Event_Point contains all points earned in all events I would like to see in a npc the list of 10 players that contains more points. example: mes "Event Ranking" mes "Top 10 Event players" 1st - Player Name - [Number of T_Event_Point #] 2nd - Player Name - [Number of T_Event_Point #] ... 10th - Player Name - [Number of T_Event_Point #] #Event_Points are the variables that are Account Bounded and not Character bounded. and a Account contains minimum 9 characters.. So how can I display a specific player name? Or get any chracter name from that account? 1 ZelosAvalon reacted to this Quote Share this post Link to post Share on other sites
0 ZelosAvalon 14 Posted May 29, 2014 soo how i can do this ? i can modify my variables, if you explain to me what should I do Quote Share this post Link to post Share on other sites
Share this post
Link to post
Share on other sites