In-game clients - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: In-game clients (/Thread-In-game-clients) |
In-game clients - Leonidas - 12-20-2016 06:43 PM So I've noticed that when using %CLIENTS% on spherestatusbase.htm it returns the value of every connection to the server, including people just looking at the server status page on their browser. So I made a little command that runs every world save and checks if the player has a UID or not. It seems to work fine, but I don't know if this is the right way to do it? I'm assuming this may bog down the server at a high playerbase? Code: [FUNCTION F_ONLINECLIENTS] RE: In-game clients - rastrero - 12-20-2016 06:46 PM If I were you, I would disable the sphere web status, and do another one by mysql RE: In-game clients - Leonidas - 12-20-2016 06:48 PM I plan on doing that later on down the road, just wanted to get one going for a bit. RE: In-game clients - Kanibal - 12-20-2016 08:27 PM Do you need only number of connected players or they names etc.? Whatever you can use LISTS. Try something like this: Code: [FUNCTION f_player_online] Code: [FUNCTION f_onserver_timer] // [FUNCTION f_onserver_save] The number of players will be <serv.list.onlineplayers.count> and you can simple get each player name from this list Code: [FUNCTION f_get_players_list] Code: [FUNCTION f_show_list] RE: In-game clients - rastrero - 12-20-2016 09:08 PM As u want. RE: In-game clients - Coruja - 12-21-2016 11:04 AM you can use LIST engine as Kanibal said, but I think webpages can't read info from LIST's, so this code can be useful to show online player list ingame on some dialog/function/etc, but not on webpages if you just want get the online players without count connections without chars connected ingame, you can use an simple function like this Code: [FUNCTION UpdateOnlineClientsVar] RE: In-game clients - Kanibal - 12-21-2016 01:51 PM (12-21-2016 11:04 AM)Coruja Wrote: you can use LIST engine as Kanibal said, but I think webpages can't read info from LIST's, so this code can be useful to show online player list ingame on some dialog/function/etc, but not on webpages or use madskillz (Click to View) P.S. I did not test this thing so try it yourself RE: In-game clients - Leonidas - 12-27-2016 03:45 PM Code: [FUNCTION UpdateOnlineClientsVar] How can I make this check if the player has a tag or not? Trying to make it so staff can use a command to hide and have this not add them to the client count. RE: In-game clients - Coruja - 12-27-2016 05:46 PM you can check using char UID Code: [FUNCTION UpdateOnlineClientsVar] RE: In-game clients - Leonidas - 12-28-2016 10:06 AM Exactly what I needed, thanks alot! |