0 Members and 1 Guest are viewing this topic.
Procedure RecognisePlayer(ID: byte);var i: integer; infile: array of string; data: array of tData; guid: string;begin guid := GetPlayerStat(ID,'MSAC.GUID'); While ContainsString(guid,':') do begin Delete(guid,StrPos(':',guid),1); end; if FileExists(PATH+guid+EXT) then begin infile := Explode(ReadFile(PATH+guid+EXT),chr(13)+chr(10)); for i:=0 to ArrayHigh(infile)-1 do begin SetArrayLength(data,i+1); data[i] := LoadLine(infile[i]); if i=19 then break; end; for i:=0 to GetArrayLength(data)-1 do begin Player[ID].Names[i+1] := data[i].Name; Player[ID].NamesC[i+1] := data[i].Count; if i=19 then break; end; Player[ID].RealName := Player[ID].Names[1]; end else Player[ID].RealName := 'unknown';end;
//t: array to be sorted, l: start point of sorting (most likely 0), r: end point of sorting (most likely GetArrayLength(t)-1), asc: true if ascending, false if descendingprocedure quicksort(var t: array of integer; l,r:integer; asc: boolean);var pivot,b,i,j:integer;begin if l < r then begin pivot := t[random(l+1, r+1)]; //pivot:=t[(l+r) div 2 + 1]; i := l-1; j := r+1; repeat if asc then begin repeat i := i+1 until pivot <= t[i]; repeat j := j-1 until pivot >= t[j]; end else begin repeat i := i+1 until pivot >= t[i]; repeat j := j-1 until pivot <= t[j]; end b:=t[i]; t[i]:=t[j]; t[j]:=b until i >= j; t[j]:=t[i]; t[i]:=b; quicksort(t,l,i-1, asc); quicksort(t,i,r, asc); end;end;