SRL Archive - S.M.A.R.T.

Logged In Player is not in Players array


Shuttleu

2008-07-17 10:53:57

hi i have made a script (well updated one) and it works fine but when i add smart it is about to log me on then it comes out with this error
Logged In Player is not in Players array

why is this happening?

could it be because the script is using a players form?

anyone who can answer the question will recieve rep

~shut

ZephyrsFury

2008-07-17 11:03:15

The problem is with LoginPlayer. It tries to find your username in the bottom left of the chat box to verify that the logged in player is in the Players array. If it doesn't it logs out. Unfortunately it doesn't seem to be working too well so I'd suggest you go to Login.scar and remove this bit from LoginPlayer (Line 456):


T := GetSystemTime;
while (not(FindColor(Tx, Ty, 0, 8, 458, 45, 470))) and (GetSystemTime - T < 5000) do
Wait(100);
if (FindColor(Tx, Ty, 0, 8, 458, 45, 470)) then
if (not(FindTextTpa(0, 0, 7, 457, 137, 475, Players[CurrentPlayer].Nick, SmallChars, Nothing))) then //Double check if logged in player is what we think it is
begin
WriteLn('Logged In Player is not in Players array.');
LogOut;
Wait(1000 + Random(1000));
LoginPlayer;
Exit;
end;

Shuttleu

2008-07-17 11:17:11

hmmm… i forgot to say that it doesnt even log in it just hovers around the text that says please log in after you have pushed the first log in

if its unclear i will post a screenshot

as you can see the red dot is on the please log in writing but it wont put my username or password in

does loginplayer not work with smart properly?

~shut

ZephyrsFury

2008-07-17 11:33:50

Its works for me for both normal rs client and for SMART. I'm not sure…

Shuttleu

2008-07-17 11:41:49

well here is the script
could you have a look at it and see if you can find out what is wrong?

~shut

ZephyrsFury

2008-07-17 11:44:30

You didn't SetTargetDC(SmartGetDC); :)

Shuttleu

2008-07-17 11:49:59

ohh yeah… i cant believe i forgot that :duh:

thank you rep++

~shut

P1nky

2008-07-17 19:11:55

lol thank you zeph had same prob evn made the same thread question just deleted thanks! rep+

Waddo

2008-07-23 11:45:53

it only does it sometimes so try restarting scar.

Shuttleu

2008-07-25 13:42:42

From: Waddo
it only does it sometimes so try restarting scar.

if you look tree posts above yours then you will se that the question has been answered and it was my fault for not adding a line

~shut

Wanted

2008-07-27 00:00:50

I've had the same thing happen for forgetting {.Include SRL\SRL\Misc\SMART.SCAR} make sure you follow all the steps in 'Make any script a SMART' script to be 100% sure.

P1nky

2008-07-28 02:10:40

zeph solved prob lol.. so its okay?

SubiN

2008-08-02 21:06:27

lol i get the same error and i have included SetTargetDC(SmartGetDC).

well this problem only happes when i use an account which has a username such as "h noob" (one letter in front and then space). Anyone has any other solutions ? Thanx

ZephyrsFury

2008-08-02 22:35:33

From: SubiN
lol i get the same error and i have included SetTargetDC(SmartGetDC).

well this problem only happes when i use an account which has a username such as "h noob" (one letter in front and then space). Anyone has any other solutions ? Thanx


The best way to fix the error is just to remove it from LoginPlayer. Read the 2nd post on this thread for instruction on doing that.

SubiN

2008-08-03 02:46:46

yeah already done that and it works now =]. but was just looking for an alternative without doing that.