Results 1 to 6 of 6

Thread: Need help

  1. #1
    Join Date
    Sep 2007
    Location
    Canada Eh
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help

    Hi i need help with something. I'm making a script and i want to put at the end of the script to repeat until all the players in the declare procedure are false.

    Could someone please tell me how i could write that in my script Thanks Guys.

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

    Default

    SCAR Code:
    function NoActivePlayers : Boolean;
    var
    I : Integer;
    begin
      for I := 0 to (HowManyPlayers - 1) do
       if Players[I].Active then
         Exit;
      Result := True;
    end;

    SCAR Code:
    repeat
      DoWhatever;
    until(NoActivePlayers);

    I'm a bit tired so someone correct me if I'm wrong.
    [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]

  3. #3
    Join Date
    Oct 2006
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by danrox2004 View Post
    Put this in your script. I'm not sure if allPlayersInactive is in SRL.
    SCAR Code:
    function allPlayersInactive: Boolean;
    var
      i: integer;
    begin
      result := true;
      for i := 0 to length(players) - 1 do
        if(players[i].active) then
        begin;
          result := false;
          exit;
        end;
    end;

    repeat
      mainLoop;
    until(allPlayersInactive)
    EDIT: Oops, should have refreshed...

  4. #4
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    EDIT: nvm =]

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

    Default

    Quote Originally Posted by danrox2004 View Post
    EDIT: Oops, should have refreshed...
    By default, the result is false so if you don't declare the result, it ends up false. Therefore, you can just do, if Players[I].Active then Exit
    [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]

  6. #6
    Join Date
    Sep 2007
    Location
    Canada Eh
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

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

Posting Permissions

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