28.01.2007, 09:49
Well this is a small thing but i find it a bit more efficient,
instead of using for(new i=0;i<MAX_PLAYERS
I use this:
instead of using for(new i=0;i<MAX_PLAYERS
I use this:
Code:
new maxplayers; //Global Variable public OnPlayerConnect(playerid){ if(playerid > maxplayers-1) maxplayers = playerid+1; //Getting the maximum playerid } public OnPlayerDisconnect(playerid){ if(playerid == maxplayers+1) for(new i=0;i<maxplayers;i++) if(IsPlayerConnected(i)) maxplayers = i+1; //Getting the minimum playerid } for(new i=0;i<maxplayers;i++) //the new more efficient loop