16.01.2013, 14:22
(
Последний раз редактировалось rVar; 19.02.2013 в 14:07.
)
// delete
Hello.
I want to make a top 5 for players with highest number of used commands. I have the variable to store the number of commands per each player and it will be saved in a .ini file. What I don't know is how to make such a thing. I know how to read offline players .ini files but i don't know how to read variables for online players at the same time and to be displayed. Ex: 1: Trock (Offline player) 2: Crock (Online player) ...and so on.. I just need an example and i hope you understand what i mean.. |
ORDER BY `...` ASC
new Top[5];
new CommandCount[MAX_PLAYERS];
new i;
for(; i < MAX_PLAYERS; ++i)CommandCount[i]=i;
i=0;
for(; i < MAX_PLAYERS; ++i)if(Top[0] < CommandCount[i])Top[0] = CommandCount[i];
i=0;
for(; i < MAX_PLAYERS; ++i)if(Top[1] < CommandCount[i] && Top[0] > CommandCount[i])Top[1] = CommandCount[i];
i=0;
for(; i < MAX_PLAYERS; ++i)if(Top[2] < CommandCount[i] && Top[1] > CommandCount[i])Top[2] = CommandCount[i];
i=0;
for(; i < MAX_PLAYERS; ++i)if(Top[3] < CommandCount[i] && Top[2] > CommandCount[i])Top[3] = CommandCount[i];
i=0;
for(; i < MAX_PLAYERS; ++i)if(Top[4] < CommandCount[i] && Top[3] > CommandCount[i])Top[4] = CommandCount[i];
printf("%d %d %d %d %d",Top[0],Top[1],Top[2],Top[3],Top[4]);