SRL Archive - SRL Archives

function AllHaveGone : Boolean;


WhiteShadow

2006-06-05 00:00:58

This function returns true, when all the players have active to false. I'm not sure if it works, post on your thoughts.

function AllHaveGone : Boolean;
var
Pf, FalseChr : Integer;
begin
for Pf:= 0 to HowManyPlayers - 1 do
if(Players[Pf].Active = False)then
begin
FalseChr:= FalseChr + 1
end;
if(FalseChr >= HowManyPlayers)then
begin
Result:= True;
end;
end;

Usage.

//Mainloop

begin
SetUpSRL;
repeat
//Yada Yada
until(AllHaveGone)
TerminateScript;
end.

Bebe

2006-06-05 00:03:29

Seems fine to me, nice idea ;)

Pyro

2006-06-05 00:37:01

Omfg rofl. I soo have to get my repos pass back lol. I made this like a couple of weeks ago but havnt got my pass back yet lol. Anyways heres mine that i made


Function NoActive:boolean;
var
i,FalseCount:integer;
begin
for i:=0 to howmanyplayers-1 do
if(players[i].active=false) then FalseCount:=FalseCount+1
if(Falsecount=howmanyplayers)then Result:=true
end;

We seem to code almost identical :D

WhiteShadow

2006-06-05 00:51:25

Except for the fact that I'm more organized. haha :p

Dark_Sniper

2006-06-05 01:16:49

owned…. lol i made one for personal use i thought they would have had one in SRL already but i guesse they dont huh…

Pyro

2006-06-05 04:13:00

From: WhiteShadow
Except for the fact that I'm more organized. haha :p


yea i know im such a procrastinator.

Dark_Sniper

2006-06-05 05:04:01

pyro unorganized! i consider him to be my organizer…BOY AM I IN TROUBLE THEN :p. (inside joke(he organizes my forum a lot))

phantombmx

2006-06-05 16:35:07

man you shoulda seen the standards of pyro when we were workin on somethin together :(

had to fix it :p

Pyro

2006-06-05 18:49:38

From: phantombmx
man you shoulda seen the standards of pyro when we were workin on somethin together :(

had to fix it :p


Ya i have to be in the right mood for scripting. I go in and out of scriptign phases. Often with unfinished scripts. That i later look upon and then restart from scratch again.

Ahhahah darky. You sure are in trouble. muahahaha.

WhiteShadow

2006-06-05 20:48:35

^^ Funny people here. :D