03.03.2012, 05:10
Fiz um filterscript melhorsinho, tenta:
pawn Код:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/rankScore", true))
{
static
Scores[MAX_PLAYERS],
String[128],
Nome[24],
IntVar,
;
for(IntVar = 0; IntVar != MAX_PLAYERS; ++IntVar) Scores[IntVar] = GetPlayerScore(IntVar);
BubbleSort(Scores, sizeof(Scores));
for(IntVar = 0; IntVar < 10; ++i)
{
GetPlayerName(IntVar, Nome, 24);
format(String, sizeof(String),"%i є Nome: %s Pontos: %s", IntVar+1, Nome, Scores[IntVar]);
SendClientMessage(playerid, -1, String);
}
return 1;
}
return 0;
}
static stock BubbleSort(v[], size)
{
#if !defined swap
#define swap(%0,%1) (%0 ^= %1, %1 ^= %0, %0 ^= %1)
#endif
for(new i = 1; i != size; ++i)
{
for(new q = 0; (q != size - i); ++q)if(v[i] > v[q]) s_swap(v[q],v[i]);
}
}