Hello,
I've wrote a Sort Script which works very well. Untill the Script does reach an amount of Data (Like 125-175 players those got saved).
The Script sorts on every MapChange the whole list new, which does the Server very Unstable.
for j := 0 to getarraylength(playerlist)-2 do begin
for z := 0 to getarraylength(playerlist)-2-j do begin
if AllScore[z] < AllScore[z+1] then begin
Placeholder := PlayerList[z];
Placeholder2 := AllScore[z];
PlayerList[z] := Playerlist[z+1];
AllScore[z] := AllScore[z+1];
PlayerList[z+1] := Placeholder;
AllScore[z+1] := Placeholder2;
end;
end;
end;
WriteFile('censored/list.txt',PlayerList[0]);
WriteLnFile('censored/list.txt','');
for n := 1 to getarraylength(playerlist)-2 do begin
WriteLnFile('censored/list.txt',PlayerList[n]);
end;
Before this happens, it Loads the PlayerList Array with all names those are in the list.txt file. Then it Loads for every Player the Score Array. (Also the Server does Read it shortly before it). So far so good. How I said, this Script does work well. I just need an Option to not lose the Stability over this amount. Is there a possible way to Limit the Sort? (for Example if its already sorted, it will just Sort the first 100 Players, BUT keeping the rest of the List.txt file, cause i want to keep the other Players saved. Their scores are seperated saved, but for "calling" their scores ingame i need their names in the list.txt file.)
I dont need someone who writes me it, I just need someone who can "brainstorm" with me, which ways I could use to not lose all the Players above the 100 Limit.
I hope someone can help me.
Greetings,
ExHunter