29.01.2011, 10:14
This function sorts the playerids from nearest to fahrest position from a specific playerid.
Please edit this function for me in that way, that it continues the loop, when %1 is -1
I tried this but it didnt work:
Код:
//sort
#define SortIDs(%1,%2); \
for(new c, l, v; c < sizeof %2; c++) { \
for(l = 1, v = 0; l < sizeof %1; l++) \
if(%1[l] < %1[v]) v = l; \
%2[c] = v, %1[v] = (Float:0x7F800000); \
}
I tried this but it didnt work:
Код:
#define SortIDs(%1,%2); \
for(new c, l, v; c < sizeof %2; c++) \
{ \
for(l = 1, v = 0; l < sizeof %1; l++) \
{ \
if(%1[c] == -1) \
{ \
%2[c] = -1; \
continue; \
} \
if(%1[l] < %1[v]) v = l; \
{ \
%2[c] = v, %1[v] = (Float:0x7F800000); \
} \
} \
}


. Does someone have a better function for that?