Results 1 to 9 of 9

Thread: Detecting if all players are not active

  1. #1
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Detecting if all players are not active

    I saw a function once that detected if all the players were not active, i forgot how to do it. (And I will not be accepting simple ways out of it) (eg just using howmanyplayers>= 8 then if players[8] blah blah...) can anyone show me how?

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    why does it matter? the script stops if all the players are false ne way
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Not if its looping, and at the end it will print a final progress report....

  4. #4
    Join Date
    Nov 2006
    Location
    Bel Air, Maryland, USA
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i did this just as a fail safe
    SCAR Code:
    for i := 0 to howmanyplayers-1 do
          if players[i].active=true then
          activity:=activity+1;
       until (activity=0);

  5. #5
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    not if you do a while loop then use brambles and make a var thats true if all are false then
    SCAR Code:
    while flase= true do
    everything else
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  6. #6
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Ill try it out, Thanks.

  7. #7
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You can use a function I made if you don't want to use the other suggestions posted earlier.

    SCAR Code:
    function AllPlayersAreFalse: Boolean;
    var
      i, FalseCount: Integer;
    begin
      for i := 0 to HowManyPlayers - 1 do
      begin
        if(Players[i].Active) then
        begin
          Result := False;
          Break;
        end else
          FalseCount := FalseCount + 1;
      end;
      if(FalseCount = HowManyPlayers) then
        Result := True;
    end;
    :-)

  8. #8
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    To late =P i just made one =P, ive finished the script now. ^^ althougth its not been tested

  9. #9
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    What the? Why are all your functions so long?

    Here:

    SCAR Code:
    function AllPlayersInactive : Boolean;
    var
    I : integer;
    begin
      for I := 0 to HowManyPlayers - 1 do
        if Players[I].Active then
          Exit;
        Result := True;
    end;
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Going to be not as active...
    By Kyle Undefined in forum News and General
    Replies: 16
    Last Post: 01-15-2009, 02:18 AM
  2. Number of Active Players
    By Zackattk1993 in forum OSR Help
    Replies: 2
    Last Post: 11-11-2008, 10:30 PM
  3. Something with the players active states -1
    By ShowerThoughts in forum OSR Help
    Replies: 3
    Last Post: 04-26-2008, 11:38 AM
  4. active players? multiple logins?
    By Martingon in forum OSR Help
    Replies: 5
    Last Post: 05-08-2007, 04:43 AM
  5. Me At 100% Active!!!
    By Rune Hacker in forum SRL Site Discussion
    Replies: 21
    Last Post: 05-06-2007, 01:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •