Dolphin86 Posted April 29, 2020 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
1 Emistry Posted May 1, 2020 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
0 Mabuhay Posted April 29, 2020 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
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; }
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.