[HELP] Please edit the code for me (sorting function)
#1

This function sorts the playerids from nearest to fahrest position from a specific playerid.

Код:
//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); \
    }
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:

Код:
#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); \
		} \
    } \
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)