Wysłany: 2014-02-25, 00:33
wasik95
[KST]
Wiek: 31 Na forum: 5345 dni Posty: 63
Nick w MP: W_A_S_I_K
Piwa : 12
Witam ot?? mam top 15 graczy online a chc? to zmieni? by pobiera?o dane z pliku a wi?c
Kod:
new ranking[MAX_PLAYERS][rankingEnum], index;
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
ranking[index][rank] = GetPlayerScore(i);
ranking[index++][player_ID] = i;//playerscores = ranking player_score = rank
}
}
GetPlayerHighestScores(ranking, 0, index);
Jak zmieni? by pobiera?o dane klient?w z pliku Players w folderze FilterScripts
System zapisu Djson
Wysłany: 2014-02-25, 05:59
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
To mo?e poka? jak pobierasz te dane mistrzu?
Wysłany: 2014-02-25, 10:28
xqz
otaku desu!
Wiek: 32 Na forum: 6407 dni Posty: 723
Nick w MP: xqz
Piwa : 5465
"wasik95" napisał/a :
Nie da si? (chyba, ?e jakim? tam pluginem z p.pl). Z scriptfiles mo?esz.
Wysłany: 2014-02-25, 10:37
wasik95
[KST]
Wiek: 31 Na forum: 5345 dni Posty: 63
Nick w MP: W_A_S_I_K
Piwa : 12
Jejku ?le napisa?em Przepraszam ScriptFiles Czysta pomy?eczka dane pobiera mi gdy jest na serwerze i ustawia statystyke do tego funkcja
Kod: GetPlayerHighestScores(ranking, 0, index);
no i tu mamy
[code]
stock GetPlayerHighestScores(array[][rankingEnum], left, right)
{
new
tempLeft = left,
tempRight = right,
pivot = array[(left + right) / 2][rank],
tempVar
;
while(tempLeft <= tempRight)
{
while(array[tempLeft][rank] > pivot) tempLeft++;
while(array[tempRight][rank] < pivot) tempRight--;
if(tempLeft <= tempRight)
{
tempVar = array[tempLeft][rank], array[tempLeft][rank] = array[tempRight][rank], array[tempRight][rank] = tempVar;
tempVar = array[tempLeft][player_ID], array[tempLeft][player_ID] = array[tempRight][player_ID], array[tempRight][player_ID] = tempVar;
tempLeft++, tempRight--;
}
}
if(left < tempRight) GetPlayerHighestScores(array, left, tempRight);
if(tempLeft < right) GetPlayerHighestScores(array, tempLeft, right);
}
Pozdrawiam
Tagi: top :: statystyki
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: