Author Topic: How to get NewPlayerListGui to load  (Read 1939 times)

How can I get NewPlayerListGui to load all the players before anything else is done?

Note: Does not enter while loop, does echo "Right before while loop"
        Obviously NPL_List.getRowId(0) is returning -1

Note: This is called when I join a server, this also has the function surroundings cut off for no reason

Code: (Torque) [Select]
function KalphSQL::extractID(%this)
{


    %i = 0;
    echo("Right before loop");

    for(%i=0; %i < NPL_List.rowCount(); %i++)
    {
echo("entering while loop");
%rowData = NPL_List.getRowText(%i);
if(!   (getField(%rowData,3) < 100)     &&     (getField(%rowData,3) > 1)  )
{
    echo("adding ID");
    //field 1 is the player's name
    //field 3 is the ID
    //nothing important here
}

else
{
    //
}
%i++;
    }

}

This will fix my ID sapper.
« Last Edit: March 20, 2009, 07:13:31 PM by Kalphiter »

Hehe, you called me a noob.

Tom

Badspot might have disabled all tampering with the player list, even just getting stuff from it.

Actually I found it quite funny how Truce did that.

Badspot might have disabled all tampering with the player list, even just getting stuff from it.
He clearly said that that was the way to do it. I heard him say text ctrl or list ctrl.

How can I get NewPlayerListGui to load all the players before anything else is done?

Snicker-snack!

Note: This is called when I join a server, this also has the function surroundings cut off for no reason

This will fix my ID sapper.

Code: [Select]
for(%i=0;%i<NPL_List.rowCount();%i++)
{
   %row = NPL_List.getRowText(%i);
   //stuffbutt
}
Worked last version, should still work.

It still has no rows because it has gotten the player list yet.

Schedule it to wait a second after joining the server?

The server only sends the player list after you've joined, so you can't immediately process data that doesn't exist.

Ok. Here's an update.

It doesn't enter the loop at all, as proved by an echo()

Ok. Here's an update.

It doesn't enter the loop at all, as proved by an echo()

Post what you've changed the script to so we know how to help you.

Done, didn't expect the fast reply so I didn't post it to the rescue.

First off, why are you increasing %i by one at the end of the loop?
Also, you must not be waiting long enough then. Works fine for me.

Code: [Select]
==>for(%i=0;%i<NPL_List.rowCount();%i++) { echo(NPL_List.getRowText(%i)); }
-^pwnman^0^11293^-^^0
-^king block^0^6460^-^^0
-^Cheese^0^6775^-^^0
A^Ephialtes^0^150^-^^0
-^sk8ter dude^0^11498^-^^0
-^Woodland_Creature^0^644^-^^0
-^Nobody^0^6279^-^^0
-^Kalphiter^0^6643^-^^0
-^littlebud^5^11690^-^^0
-^Baardish^0^11833^-^^0
-^Pew446^0^5844^-^^0
-^Rathgarf^0^9810^-^^0
-^Tman^0^4673^-^^0
-^MRNinja^0^9743^-^^0
-^3www/masterman^0^11357^-^^0
-^Stone Brick^0^7872^-^^0
-^DeviousAssassin^0^8729^-^^0
-^jonny blaze^0^11625^-^^0
-^Nick4t^0^4699^-^^0
-^Sergio^0^4642^-^^0
-^Truce^0^2035^You^^0

Ninja edit:
Oh hey you were in that server.

schedule(1000, 0, %this.extractID());

There is what I'm calling. It DEFINITELY calls and goes into the function

Tom

schedule(1000, 0, %this.extractID());
There is what I'm calling. It DEFINITELY calls and goes into the function
Funny, when I make schedules it gives me syntax errors when I include the () in the function.

schedule(1000, 0, %this.extractID());

There is what I'm calling. It DEFINITELY calls and goes into the function

Haha, Thats totally a syntax error right there. You genuinely have no idea what you're doing.