Little help.
#1

// delete
Reply
#2

Quote:
Originally Posted by rVar
Посмотреть сообщение
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..
Thats very easy you have tree opportunities.
1. You can save it with sqlite or MySQL and use the SQL Command
PHP код:
ORDER BY `...ASC 
2. Use the Include from Slice
https://sampforum.blast.hk/showthread.php?tid=343172
3. Make your own System with forloops and compare the values
PHP код:
    new Top[5];
    new 
CommandCount[MAX_PLAYERS];
    new 
i;
    for(; 
MAX_PLAYERS; ++i)CommandCount[i]=i;
    
i=0;
    for(; 
MAX_PLAYERS; ++i)if(Top[0] < CommandCount[i])Top[0] = CommandCount[i];
    
i=0;
    for(; 
MAX_PLAYERS; ++i)if(Top[1] < CommandCount[i] && Top[0] > CommandCount[i])Top[1] = CommandCount[i];
    
i=0;
    for(; 
MAX_PLAYERS; ++i)if(Top[2] < CommandCount[i] && Top[1] > CommandCount[i])Top[2] = CommandCount[i];
    
i=0;
    for(; 
MAX_PLAYERS; ++i)if(Top[3] < CommandCount[i] && Top[2] > CommandCount[i])Top[3] = CommandCount[i];
    
i=0;
    for(; 
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]); 
You have your choice
Reply
#3

Or if ypu are using zcmd, under oncommandperformed, if success, commandsperformed[playerid]++!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)