SRL Archive - Help

Wtf is wrong


Bob The Cat

2012-06-11 18:08:37

procedure DeclarePlayerz;
begin
HowManyPlayers := 0;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'My name'; //Your Runescape username
Players[0].Pass := 'password'; //Your Runescape password
Players[0].Active := True; //Set to true if you want to use this player. Set to False to disable this player.
end;

And i get this:

Error: Out Of Range at line 42
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Main

2012-06-11 18:13:04

wrong forum buddy
http://forums.scar-divi.com/activity.php


might just be an oudated osi?

Kasi

2012-06-11 18:16:03

howmanyplayers := 1;

0 based arrays… starts from 0 which is player[0] meaning the length has to be 1

putonajonny

2012-06-11 18:16:15

From: Bob The Cat
procedure DeclarePlayerz;
begin
HowManyPlayers := 0;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'My name'; //Your Runescape username
Players[0].Pass := 'password'; //Your Runescape password
Players[0].Active := True; //Set to true if you want to use this player. Set to False to disable this player.
end;
And i get this:

Error: Out Of Range at line 42
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Should be:
HowManyPlayers := 1;//Since you are going to have at least 1 player

Bob The Cat

2012-06-11 18:16:15

Fixed it myself

  HowManyPlayers := 0;

had to be:
  HowManyPlayers := 1;


E: Thanks Putonajonny, and Pureblood! i figured it out myself but still thank you for posting!

Flight

2012-06-11 22:21:12

From: Bob The Cat
Fixed it myself

  HowManyPlayers := 0;

had to be:
  HowManyPlayers := 1;


E: Thanks Putonajonny, and Pureblood! i figured it out myself but still thank you for posting!


Very good. :) What matters is if you understand why that fixes it. HowManyPlayers will act as a 'length' of your player array, while Player[] is the actual array, and as everyone knows all arrays begin with [0]. So if your Player[] array is Player[0, 1, 2] then your length (HowManyPlayers) would be 3.