22.10.2012, 16:16
I can, but I don't like using IF(... a million times and setting something, i've came up with this code:
the idSlot[playerid] is the banked slot of his id
Could this work?
EDIT: Should I add PlayersHit--; into the loop where changing is happening/
the idSlot[playerid] is the banked slot of his id
pawn Код:
for(new i=PlayersHit; i--;)
{
if(PlayerIDBank[i] == -1)
{
ForEach(a,MAX_PLAYERS);
if(i < idSlot[a])
{
PlayerIDBank[idSlot[a]] = -1;
PlayerIDBank[i] = a;
idSlot[a] = i;
}
}
}
EDIT: Should I add PlayersHit--; into the loop where changing is happening/