PDA

View Full Version : Help With Multi Players



da_professa
12-08-2006, 09:15 AM
I am having trouble with my power wood cutter. The problem is that it only detects player one. For example i tell it to switch from player 1 to player 2 it wont do it..
Here is the basics of what my player switching is using.. This script is supposed to log in with one player than switch etc... BUt all it does is logs in with first player and for second player it just stays there on the login screen ..

Plz help me out.. I am like soooooooo madddddddd Can't get it to work........

program New;
{.include SRL/srl.scar}
Procedure DeclarePlayers;
begin
NumberOfPlayers(4);

Players[0].Name :='---------';
Players[0].Pass :='----------';
Players[0].Nick :='---';
Players[0].Active:=True;

Players[1].Name :='';
Players[1].Pass :='----';
Players[1].Nick :='---';
Players[1].Active:=True;

Players[2].Name :='------------';
Players[2].Pass :='-------------';
Players[2].Nick :='---';
Players[2].Active:=True;

Players[3].Name := '------';
Players[3].Pass := '-------------';
Players[3].Nick := '---';
Players[3].Active := True;
end;
begin
setupsrl;
declareplayers;
loginplayer;
wait(100);
nextplayer(false);
repeat;
wait(100);
NextPlayer(false);
until(false);
end.

TOB
12-08-2006, 09:44 AM
Procedure DeclarePlayers;
begin
NumberOfPlayers(4);
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;

da_professa
12-08-2006, 10:21 AM
I don't understand how that is different than my procedure... some words would help ..
thx

TOB
12-08-2006, 10:28 AM
You put


Procedure DeclarePlayers;
begin
NumberOfPlayers(4);

You need to set the array length and which player to start using.

Wrycu
12-08-2006, 11:56 AM
So the new code starts on player 0, which should stop you from starting on player 1. Get it?

Yakman
12-08-2006, 12:17 PM
he did set the array length, its set in NumberOfPlayers

the script looks fine to me, i dont know whats causing it, the only thing i can think of is to add this

const
startplayer = 0;

procedure declareplayers;
begin
currentplayer:= startplayer;

WT-Fakawi
12-08-2006, 01:51 PM
Actually, it is an issue that has been bothering me for some time now. It wont swap due to the fact that the Global Variable HowManyPlayers isnt set. Now, this Global Var is in fact totally obsolete, but for some reason (my bad prolly :) ) its still there.

So,

set

HowManyPlayers:=4;
thats all!

da_professa
12-10-2006, 07:36 AM
Yeah it worked with the fakawi way.. Sorry for not replying guyz, but thx for all your comments