Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
shadowrecon

Question About Player Routines

Recommended Posts

Okay so i just want to clarify some pretty basic stuff, about player switching routines. Does NextPlayer(False); switch to the next active player and set current player False? or does it switch to next false player? same with the switchplayer(False); Just currious it doesnt really state in the login include and ive been setting the player false then calling the procedure.

Share this post


Link to post
Share on other sites

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function SwitchToPlayer(Player: Integer; Active: Boolean): Boolean;

Contributors: Wanted

Description: Switches to player, Sets CurrentPlayer to 'Active'. True if login successful.

Date Created: September 25th, 2011. By Wanted. RS2 Build 666.

Last Modification: November 20th, 2011. By Wanted. RS2 Build 679.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function SwitchToPlayer(Player: Integer; Active: Boolean): Boolean;

begin

WriteLn('SwitchToPlayer(' + Players[Player].Name + ', ' + BoolToStr(Active) + ');');

Players[CurrentPlayer].Active := Active;

CurrentPlayer := Player;

Result := Login;

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function NextPlayer(Active: Boolean): Boolean;

Contributors: Wanted

Description: Switches to next active player, Sets CurrentPlayer to 'Active'.

True if login successful.

Date Created: August 10th, 2011. By Wanted. RS2 Build 661.

Last Modification: September 25th, 2011. By Wanted. RS2 Build 666.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function NextPlayer(Active: Boolean): Boolean;

begin

WriteLn('NextPlayer(' + BoolToStr(Active) + ');');

Logout;

Result := SwitchToPlayer(NextActivePlayerIndex, Active);

end;[/sCAR]

Share this post


Link to post
Share on other sites
Does NextPlayer(False); switch to the next active player and set current player False?
So...To translate Wanted's answer into english: It does exactly what you have stated. Also NextPlayer will logout first, SwitchToPlayer doesn't.

Share this post


Link to post
Share on other sites
So...To translate Wanted's answer into english: It does exactly what you have stated. Also NextPlayer will logout first, SwitchToPlayer doesn't.

 

i just had a brain fart... answers were right there whole time.. err.. thanks guys. sorry for the stupid question.

Share this post


Link to post
Share on other sites
i just had a brain fart... answers were right there whole time.. err.. thanks guys. sorry for the stupid question.
I wouldn't worry about it. You ain't got nothing on some of the dumb questions I have asked in the past.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×