SRL Archive - SRL Suggestions

AddPlayer() Function


Blender

2009-06-21 07:41:58

I was making my agility course runner (all others suck, sorry) and made some functions.

I think that AddPlayer() would be a good addition to SRL.

Here is source (I whipped it up in ~10 seconds, so it is crummy):

procedure DeclarePlayer(username, password, nick: string; active: boolean);
begin
HowManyPlayers := GetArrayLength(Players) + 1;
NumberOfPlayers(HowManyPlayers);

Players[GetArrayLength(Players) + 1].Name := username;
Players[GetArrayLength(Players) + 1].Pass := password;
Players[GetArrayLength(Players) + 1].Nick := nick;
Players[GetArrayLength(Players) + 1].Active := active;

WriteLn('Added player number ' + IntToStr(GetArrayLength(Players) + 1) + ', ' + username + '.');
end;

Would this make a useful addition?
Or are people used to doing this manually…

Thanks!

Simtoon

2009-06-21 07:43:48

Seems ok to me good work.
you might want to

[highlight=pascal]

Da 0wner

2009-06-21 08:06:04

Pascal highlighting is different than SCAR…but I do not think that this is a good idea. Sorry.

Blender

2009-06-21 08:08:02

From: Da 0wner
Pascal highlighting is different than SCAR…but I do not think that this is a good idea. Sorry.


Not a good idea on whose part?

Da 0wner

2009-06-21 08:09:09

The function…

Capricorn

2009-06-21 08:49:04

uhhh … how does it know what player to add? … :S

Blender

2009-06-21 08:50:54

You use it like AddPlayer('user', 'pass', 'nick', true);
It increments the player array each time a player is added.

Nava2

2009-06-21 09:08:48

I thunk this would only really be useful for armies.

Cazax

2009-06-21 09:09:14

Err, I don't find a use for this. Players are set up at the beginning of every script so there would be no need for another player.

Capricorn

2009-06-21 09:16:43

Well if your going to set it up using addplayer(); then why not just set it up in declareplayers in the first place ..?

ShowerThoughts

2009-06-21 15:01:46

Maybe while you're running an 70 hour script and you want to add a player to the player array, or something?

mastaraymond

2009-06-21 17:48:25

Useful in combination with RC?

MylesMadness

2009-06-21 17:52:16

From: mastaraymond
Useful in combination with RC?
Thats what I was thinking

noidea

2009-06-21 20:12:03

It would need parameters like the SRL Player Form though.

Nadeem

2009-06-21 22:14:31

Should be good for RC IMO.
I probably won't be using it though.



~NS