TOB
2006-12-02 15:42:30
Well I didn't see this in SRL and NextPlayer was against the 'no endless loops' policy.
Here is Login.scar implemented with AllPlayersInactive
Ignore the attachment
good version of Login.scar is at http://www.sofakingpro.com/SCAR/chickenkiller/Login.scar
Edit: That is an old version of Login.scar but you can see how the NextPlayer and such have been modified.
{*****************************************************************************
function HowManyPlayersInactive: Integer;
By: TOB
Description: Counts how many players in the Players array are set to inactive
*****************************************************************************}
function HowManyPlayersInactive: Integer;
var
Player, NumberOfInactivePlayers: Integer;
begin
NumberOfInactivePlayers:= 0;
for Player:= 0 to HowManyPlayers - 1 do
begin
if(Players[Player].Active = False) then
NumberOfInactivePlayers:= NumberOfInactivePlayers + 1;
end;
Result:= NumberOfInactivePlayers;
end;
{*****************************************************************************
procedure AllPlayersInactive;
By: TOB
Description: Checks to see if all players are set to inactive, if True terminates script
*****************************************************************************}
procedure AllPlayersInactive;
var
InactivePlayers: Integer;
begin
InactivePlayers:= HowManyPlayersInactive;
if(InactivePlayers = HowManyPlayers) then
begin
WriteLn(TheTime + ' All players are inactive, terminating script');
TerminateScript;
end;
end;Here is Login.scar implemented with AllPlayersInactive
Ignore the attachment
good version of Login.scar is at http://www.sofakingpro.com/SCAR/chickenkiller/Login.scar
Edit: That is an old version of Login.scar but you can see how the NextPlayer and such have been modified.