Jump to content
  • 0

who's online npc


xmaniacx

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

can i request an npc where it shows the current online players on the server by 10 entries per page.

it would display something like this


"1. Name ( Base/Job ) - Class [ Map ]";

"2. Name ( Base/Job ) - Class [ Map ]";

"3. Name ( Base/Job ) - Class [ Map ]";

"4. Name ( Base/Job ) - Class [ Map ]";

"5. Name ( Base/Job ) - Class [ Map ]";

"6. Name ( Base/Job ) - Class [ Map ]";

"7. Name ( Base/Job ) - Class [ Map ]";

"8. Name ( Base/Job ) - Class [ Map ]";

"9. Name ( Base/Job ) - Class [ Map ]";

"10. Name ( Base/Job ) - Class [ Map ]";

 

next;  <<--- if the user is below 10 if you press next you would go to the menu while if its over 10 it continues to the page 2

 

"11. Name ( Base/Job ) - Class [ Map ]";

"12. Name ( Base/Job ) - Class [ Map ]";

"13. Name ( Base/Job ) - Class [ Map ]";

"14. Name ( Base/Job ) - Class [ Map ]";

"15. Name ( Base/Job ) - Class [ Map ]";

"16. Name ( Base/Job ) - Class [ Map ]";

"17. Name ( Base/Job ) - Class [ Map ]";

"18. Name ( Base/Job ) - Class [ Map ]";

"19. Name ( Base/Job ) - Class [ Map ]";

"20. Name ( Base/Job ) - Class [ Map ]";

next;

"21. Name ( Base/Job ) - Class [ Map ]";

"22. Name ( Base/Job ) - Class [ Map ]";

"23. Name ( Base/Job ) - Class [ Map ]";

"24. Name ( Base/Job ) - Class [ Map ]";

"25. Name ( Base/Job ) - Class [ Map ]";

"26. Name ( Base/Job ) - Class [ Map ]";

"27. Name ( Base/Job ) - Class [ Map ]";

"28. Name ( Base/Job ) - Class [ Map ]";

"29. Name ( Base/Job ) - Class [ Map ]";

"30. Name ( Base/Job ) - Class [ Map ]";

 

 


 

Edited by xmaniacx
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

I suggest that add a close button, because if you have 100 players, you will be force to finish all the pages.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


prontera,159,180,5    script    hjkl    456,{

    query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1 ORDER BY `name` DESC LIMIT 128", .@account_id;

    .@self = getcharid(3);

    mes "x. Name ( Base/Job ) - Class [Map]";

    for( .@i = 0; .@i < getarraysize( .@account_id ); .@i++ )

        if( attachrid( .@account_id [ .@i ]  ) ) {

            .@name$ = rid2name( .@account_id[ .@i ] );

            .@base = BaseLevel;

            .@jobl = JobLevel;

            .@jname$ = jobname( Class );

            .@map$ = strcharinfo(3);

            attachrid( .@self );

            mes ( .@j++ ) + ". ^777777"+ .@name$ +" ^FF0000"+ .@base +"/"+ .@jobl +"^000000 - ^CC0066"+ .@jname$ +" ^6666FF[ "+ .@map$ +" ]^000000";

            if( .@j%10 )

                if( select( "^777777~ Continue", "~ Leave^000000" ) -1 ) close;

        }

    close;

}

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

prontera,159,180,5    script    hjkl    456,{
    query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1 ORDER BY `name` DESC LIMIT 128", .@account_id;
    .@self = getcharid(3);
    mes "x. Name ( Base/Job ) - Class [Map]";
    for( .@i = 0; .@i < getarraysize( .@account_id ); .@i++ )
        if( attachrid( .@account_id [ .@i ]  ) ) {
            .@name$ = rid2name( .@account_id[ .@i ] );
            .@base = BaseLevel;
            .@jobl = JobLevel;
            .@jname$ = jobname( Class );
            .@map$ = strcharinfo(3);
            attachrid( .@self );
            mes ( .@j++ ) + ". ^777777"+ .@name$ +" ^FF0000"+ .@base +"/"+ .@jobl +"^000000 - ^CC0066"+ .@jname$ +" ^6666FF[ "+ .@map$ +" ]^000000";
            if( .@j%10 )
                if( select( "^777777~ Continue", "~ Leave^000000" ) -1 ) close;
        }
    close;
}

boss the script is working fine however its displaying 1. for the 10 players

1. boom

1. dawda

1. 123

1. 1241231

1. and so on........

Edited by xmaniacx
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

prontera,159,180,5	script	hjkl	456,{
	query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1 ORDER BY `name` DESC LIMIT 128", .@account_id;
	.@self = getcharid(3);
	mes "x. Name ( Base/Job ) - Class [Map]";
	for( .@i = 0; .@i < getarraysize( .@account_id ); .@i++ )
		if( attachrid( .@account_id[ .@i ] ) ) {
			.@name$ = rid2name( .@account_id );
			.@base = BaseLevel;
			.@jobl = JobLevel;
			.@jname$ = jobname( Class );
			.@map$ = strcharinfo(3);
			attachrid( .@self );
			mes ( .@j++ ) + ". ^777777"+ .@name$ +" ^FF0000"+ .@base +"/"+ .@jobl +"^000000 - ^CC0066"+ .@jname$ +" ^6666FF[ "+ .@map$ +" ]^000000";
			if( .@j%10 == 0 ) {
				next;
				if( select( "^777777~ Continue", "~ Leave^000000" ) -1 ) close;
			}
		}
	close;
}

I didn't test it

This one works fine with me (lastest rAthena)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

i think its on this part

 mes ( .@j++ ) + ". ^777777"+ .@name$ +" ^FF0000"+ .@base +"/"+ .@jobl +"^000000 - ^CC0066"+ .@jname$ +" ^6666FF[ "+ .@map$ +" ]^000000";

there's no "for ( set" something i think.... but.. who knows, i don't know what i'm talking about coz im a noob T_T

Edited by xmaniacx
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Well .@j++ is equivalent to set .@j, .@j + 1;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

.................

Edited by caspa
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   1
  • Joined:  04/03/12
  • Last Seen:  

solved

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...