I took my examples out of my essence miner script:
In my script, there is currently space for 6 players.
Let's learn how to add a player:
SCAR Code:
Procedure DeclarePlayers;
Begin
HowManyPlayers:= NumberOfUsers;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Bank';
Players[0].Active:=True;
Players[0].Boolean1 := True; // Is The Pick Equipped?
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Bank';
Players[1].Active:=True;
Players[1].Boolean1 := True; // Is The Pick Equipped?
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Bank';
Players[2].Active:=True;
Players[2].Boolean1 := True; // Is The Pick Equipped?
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Bank';
Players[3].Active:=True;
Players[3].Boolean1 := True; // Is The Pick Equipped?
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Bank';
Players[4].Active:=True;
Players[4].Boolean1 := True; // Is The Pick Equipped?
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Bank';
Players[5].Active:=True;
Players[5].Boolean1 := True; // Is The Pick Equipped?
Writeln( IntToStr ( NumberOfUsers ) + ' Players' );
End;
Thats what he got right now right?
If we want to add a player, we copy player 5.
So
SCAR Code:
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Bank';
Players[5].Active:=True;
Players[5].Boolean1 := True; // Is The Pick Equipped?
Copy = Ctrl + C.
Paste player 5 under player so you get this :
Paste = Ctrl + V
SCAR Code:
Procedure DeclarePlayers;
Begin
HowManyPlayers:= NumberOfUsers;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Bank';
Players[0].Active:=True;
Players[0].Boolean1 := True; // Is The Pick Equipped?
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Bank';
Players[1].Active:=True;
Players[1].Boolean1 := True; // Is The Pick Equipped?
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Bank';
Players[2].Active:=True;
Players[2].Boolean1 := True; // Is The Pick Equipped?
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Bank';
Players[3].Active:=True;
Players[3].Boolean1 := True; // Is The Pick Equipped?
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Bank';
Players[4].Active:=True;
Players[4].Boolean1 := True; // Is The Pick Equipped?
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Bank';
Players[5].Active:=True;
Players[5].Boolean1 := True; // Is The Pick Equipped?
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Bank';
Players[5].Active:=True;
Players[5].Boolean1 := True; // Is The Pick Equipped?
Writeln( IntToStr ( NumberOfUsers ) + ' Players' );
End;
Now, we change the copied 5's to 6'es.
SCAR Code:
Procedure DeclarePlayers;
Begin
HowManyPlayers:= NumberOfUsers;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Bank';
Players[0].Active:=True;
Players[0].Boolean1 := True; // Is The Pick Equipped?
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Bank';
Players[1].Active:=True;
Players[1].Boolean1 := True; // Is The Pick Equipped?
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Bank';
Players[2].Active:=True;
Players[2].Boolean1 := True; // Is The Pick Equipped?
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Bank';
Players[3].Active:=True;
Players[3].Boolean1 := True; // Is The Pick Equipped?
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Bank';
Players[4].Active:=True;
Players[4].Boolean1 := True; // Is The Pick Equipped?
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Bank';
Players[5].Active:=True;
Players[5].Boolean1 := True; // Is The Pick Equipped?
Players[6].Name :='';
Players[6].Pass :='';
Players[6].Nick :='';
Players[6].Loc :='Bank';
Players[6].Active:=True;
Players[6].Boolean1 := True; // Is The Pick Equipped?
Writeln( IntToStr ( NumberOfUsers ) + ' Players' );
End;
Now we have added a player to the player array.
We should not forget to set NumberOfUsers at line 29.
The Following rule applies to NumberOfUsers:
Code:
NumberOfUsers is 1 + The number of your last player in your player array, in this case, 6. SO NumberOfUsers should be 7!
SCAR Code:
NumberOfUsers = 7; // The Number of users you use.
Now you have added an extra player. You can add more than one at the time, as long as you understand everything here. You can also "detele" player spots, as long as you remember to set NumberOfUsers.
Remember to set each player number.
SCAR Code:
Players[6].Name :='';
Players[6].Pass :='';
Players[6].Nick :='';
Players[6].Loc :='Bank';
Players[6].Active:=True;
Players[6].Boolean1 := True; // Is The Pick Equipped?
If you would leave it a 5, the first number 5 slot will be skipped.
Thanks for reading this, and I hope it helped.
Edit by Sumilion :
How to set up your nickname.
First of all.. what is your nickname for ? Your nickname is needed in SRL so it can detect talking randoms. The randoms will say your name in the RS window and SRL will search for a part of your name, your nick. Its a part of the name because, well, most of all its faster.
Rules for Nicknames :
* Your nickname should not contain spaces. (this includes '_')
* Your nickname should not contain capitals.
* Your nickname should be around 3-4 characters
Extra info on 'Your nickname should not contain capitals.' :
First a bit of clarification. This rule refers to the in game capitalisation. You might fill in your name as 'example' but in RS the 'e' is a capital ('E'). So your name should not include the first letter of your rs name. This is also the reason why your nick should not contain a '_' or a space cause the next letter will be capitalised.
Problematical names :
Ofcourse there are these people that name themselfs something like 'I M P W N E R' or something like that. If you are one of these lucky lads, then your doomed to an endless pain of randoms that wont be solved
~Sumilion