29.12.2010, 18:54
Aqui Atualizei,talvez brevemente eu lance oficialmente:
Depois basta usar:
Basta mudar o (500) caso quiser otimizar ainda mais,isto й,mudar 500 para seus Slots!
Nota: Isto й o GMADDON.
pawn Код:
#include <a_samp>
#define iMaxPlayers (500)
#define FoReX(%0) for(new %0 = 0; zPlayers[iCount] != -1; (iCount) = zPlayers[iCount], ++iCount)
static
zPlayers[iMaxPlayers],
iCount = 0,
zInterators = -1
;
public OnPlayerConnect(playerid)
{
zInterators++;
zPlayers[ (zInterators)] = playerid;
zPlayers[ (zInterators + 1) ]= -1;
return true;
}
public OnPlayerDisconnect(playerid,reason)
{
zInterators --;
for( new i = 0; i < sizeof zPlayers; ++i )
{
if( zPlayers[ i ] == playerid )
{
zPlayers[ i ] = zPlayers[ ( i + 1 ) ];
if( zPlayers[ (i + 1) ] != 0 )
for( new a = i; a < sizeof(zPlayers); a++ )
if( zPlayers[ a ] != 0 )
zPlayers[ a ] = zPlayers[ ( a + 1 ) ];
}
}
return true;
}
pawn Код:
FoReX(i)
{
printf("O ID %d й Gay",i);
}
Nota: Isto й o GMADDON.