Player Start error

dear members,

i was trying a script which stops one player (A) if i start another one (B) OR it will fade out the cartwall if i will start a player. here is the script.

[code]procedure OnPlayerStart(PlaylistIndex: integer; PlayerIndex: integer);
var
i: integer;
ii: integer;

begin
for i := 0 to Engine.GetPlayBackControl(0).GetPlayerCount - 1 do
begin
if i <> PlayerIndex then
Engine.GetPlaybackControl(0).GetPlayer(i).Stop;
end;

for ii := 0 to Engine.GetCartwallControl.GetPlayerCount - 1 do
  Engine.GetCartwallControl.GetPlayer(ii).FadeOut;

end;

begin
end.[/code]

interestingly the script works “fine”. so the player stops and cartwall fades out BUT i got an error message everytime when i start the player:

Runtime error “List index out of bounds (4711113)” in notification script XXXXXXXXXXXXXXXXX.mls, handling message: PLAYERCONTROL_START 4470231B252F618E 0 0000 0001 ?

Add another Parameter “Item: PlaylistItem” to the parameter list of OnPlayerStart, like this:

procedure OnPlayerStart(PlaylistIndex: integer; PlayerIndex: integer; Item: IPlaylistItem);

It was added some time ago as an additional parameter.

Unfortunately the script engine cannot check if the parameter list is correct, and if it’s not, it will result in errors like the one you saw.

Hey Torben,

thank you very much for help. Now, it works fine.