Dolphin86 Posted April 29, 2020 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 757 Reputation: 17 Joined: 01/07/12 Last Seen: December 18, 2024 Share Posted April 29, 2020 hye i would like to request for this npc script, can someone add a chat box on top of the npc and tell how many player are currently online example : 10 Player Online neko_isle,93,99,4 script PlayerOnline 512,{ query_sql "SELECT `name` , `class` FROM `char` WHERE `online` = '1'", .@name$, .@class; mes "-----------------------------------"; mes "Online Users: " + getusers(1); mes "-----------------------------------"; for( set .@a,0; .@a < getarraysize(.@name$); set .@a,.@a + 1) mes .@name$[.@a]+ " | Job: " +jobname(.@class[.@a]); mes "-----------------------------------"; close; } Quote Link to comment Share on other sites More sharing options...
1 Emistry Posted May 1, 2020 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted May 1, 2020 neko_isle,93,99,4 script PlayerOnline 512,{ query_sql "SELECT `name` , `class` FROM `char` WHERE `online` = '1'", .@name$, .@class; mes "-----------------------------------"; mes "Online Users: " + getusers(1); mes "-----------------------------------"; for( set .@a,0; .@a < getarraysize(.@name$); set .@a,.@a + 1) mes .@name$[.@a]+ " | Job: " +jobname(.@class[.@a]); mes "-----------------------------------"; close; OnInit: OnPCLoginEvent: OnPCLogoutEvent: delwaitingroom; waitingroom "Online Users: " + getusers(1), 0; end; } avoid loop ... use the PC login/logoff event instead. Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted April 29, 2020 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted April 29, 2020 (edited) *getusers(<type>) This function will return a number of users on a map or the whole server. What it returns is specified by Type. Type can be one of the following values, which control what will be returned: 0 - Count of all characters on the map of the invoking character. 1 - Count of all characters in the entire server. 8 - Count of all characters on the map of the NPC the script is running in. Usage : prontera,150,180,0 script njhaksdn 123,{ end; OnInit: while (1) { waitingroom "Players Online : "+ getmapusers(1), 0; sleep 5000; // updates every 5 sec delwaitingroom; } } Edited April 29, 2020 by Mabuhay Quote Link to comment Share on other sites More sharing options...
Question
Dolphin86
hye i would like to request for this npc script, can someone add a chat box on top of the npc and tell how many player are currently online
example : 10 Player Online
neko_isle,93,99,4 script PlayerOnline 512,{ query_sql "SELECT `name` , `class` FROM `char` WHERE `online` = '1'", .@name$, .@class; mes "-----------------------------------"; mes "Online Users: " + getusers(1); mes "-----------------------------------"; for( set .@a,0; .@a < getarraysize(.@name$); set .@a,.@a + 1) mes .@name$[.@a]+ " | Job: " +jobname(.@class[.@a]); mes "-----------------------------------"; close; }
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.