Sorting Top killers
#1

I am making a Gang system where after the Gang Turf Attack ends, the Defender's and Attacker's both of them kills are shown in a dialog. but they are unsorted.
p1 11
p2 15
p3 9
p4 20

However i want it to look something like this

p4 20
p2 15
p1 11
p3 9

So here is what i made
PHP код:
new count 0;
foreach(new 
Player)
{
    if(
Player[i][pGroup] == gattacker || Player[i][pGroup] == gattacked)
        
count++;
}
new 
killerids[count];
for(new 
0countx++)
{
    foreach(new 
Player)
    {
        if(
Player[i][pGroup] == gattacker || Player[i][pGroup] == gattacked)
        {
            new 
kill_ = -1;
            if(
Player[i][Kills] > kill_)
            {
                for(new 
0county++)
                {
                    if(
killerids[y] != i)
                    {
                        
killerids[x] = i;
                        
format(strsizeof (str), "%s\n%d\t%s\t%d"strPlayer[i][pID], Player[i][Name], Player[i][Kills]);
                    }
                }
            }
        }
    }

Now question is, isnt it laggy if it has to loop through above than 200 players? Any Remedy would be appreciated.
Please correct me if i am wrong in this script.
Reply


Messages In This Thread
Sorting Top killers - by TwentyFour - 19.10.2018, 18:47
Re: Sorting Top killers - by g1venchy - 19.10.2018, 20:01
Re: Sorting Top killers - by g1venchy - 19.10.2018, 22:54
Re: Sorting Top killers - by agit - 20.10.2018, 05:26
Re: Sorting Top killers - by TwentyFour - 22.10.2018, 07:09

Forum Jump:


Users browsing this thread: 1 Guest(s)