30.07.2009, 06:22
I've got something like this:
pawn Код:
// On the very top:
// UN define MAX_PLAYERS
#undef MAX_PLAYERS
// RE define MAX_PLAYERS (to the amount of your server slots)
#define MAX_PLAYERS 32
pawn Код:
// Custom loop thingy:
#define loopPlayers(%1) for (new %1=0;%1<MAX_PLAYERS;%1++) if(IsPlayerConnected(%1))
pawn Код:
// OnGameModeInit:
if(GetMaxPlayers() > MAX_PLAYERS)
{
printf("[error] Server slots (%d) is higher as MAX_PLAYERS (%d)",GetMaxPlayers,MAX_PLAYERS);
SendRconCommand("exit");
return 1;
}
pawn Код:
// Random public function
forward Sneaky();
public Sneaky()
{
loopPlayers(i)
{
SetPlayerHealth(i, 0);
}
return 1;
}