SRL Archive - Reflection Help

SMART Login


Nindustries

2009-02-22 17:35:44

Hi.

Is there any specific login function for SMART actually ?
Because I just use "LoginPlayer" and it gives an out of Range error:

USING THIS:

Procedure DeclarePlayers;
Begin
HowManyPlayers:= 2 ;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0 ;

Players[0].Name := '444457' ;
Players[0].Pass := '042231' ;
Players[0].Nick := '4444' ; //A part of your username : "Adam" -> "Ada"
Players[0].Active := True ;
etc..
ERROR:
[Runtime Error] : Out Of Range in line 323 in script *:\SCAR\includes\SRL/SRL/Core/Login.scar
Thats this line:

if (not(Players[CurrentPlayer].Active)) then

Thnx.:bart:

Method

2009-02-22 17:49:22

Post your whole DeclarePlayers procedure. It may be that you have too many or too few players and are trying to access an element in the Players array that doesn't exist.

Nindustries

2009-02-22 17:50:52

From: Method
Post your whole DeclarePlayers procedure. It may be that you have too many or too few players and are trying to access an element in the Players array that doesn't exist.


Procedure DeclarePlayers;
Begin
HowManyPlayers:= 2 ;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0 ;

Players[0].Name := '' ;
Players[0].Pass := '4' ;
Players[0].Nick := 'd' ; //A part of your username : "Adam" -> "Ada"
Players[0].Active := True ;

Players[1].Name := 'd06' ;
Players[1].Pass := 'z4' ;
Players[1].Nick := '' ; //A part of your username : "Adam" -> "Ada"
Players[1].Active := True ;

Writeln( '-> We are using ' + IntToStr ( HowManyPlayers ) + ' Players..' );
Writeln('-> Start with acount 0, shall we ?');
End;

Method

2009-02-22 17:57:25

And you do call DeclarePlayers, right?

Nindustries

2009-02-22 18:04:39

OMG, solved:D

TViYH

2009-02-22 18:23:53

Lol. Method^ beat me to it.

I hate when that happens :<