![]() |
Server Players List - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Server Players List (/showthread.php?tid=649) |
Server Players List - Xlithan - 16-01-2007 I know this was around somewhere before. Basically just a listbox with the characters that are currently playing. - lucidar - 17-01-2007 Code: Function TotalOnlinePlayers() As Long Theres a TotalOnlinePlayers() function in modGameLogic in the server. That may not be exactly what yours looks like... close enough and the concept is the exact same. Just make a listbox named lstOnline within frmServer - Matt - 18-01-2007 I have this somewhere. I can post it if you want? - Xlithan - 18-01-2007 I got one working (See the link below) but I just want the list to show characters and nothing else, so i'll try lucidar's and see what that looks like. http://www.mrpge.chronicalgames.com/ima ... r_main.jpg Edit: lucidar's doesn't work - Elmrok - 19-01-2007 The code i use for mine is Code: Private Sub Form_Load() The way it lists the player is diffrent but it does the same thing. Just it gets the player on a certain map as so i can see who i am chatting with. - Xlithan - 19-01-2007 That seems like a really really really bad method to me ![]() - Elmrok - 19-01-2007 GameBoy Wrote:That seems like a really really really bad method to meHow is that bad? - Xlithan - 19-01-2007 I think I'm just lazy. I'd probably have written it myself if I'd have bothered to sit down and do it. I hate doing the boring bits though!!! :twisted: - lucidar - 20-01-2007 I just took the exact code from my server. (mine also has char,account,map and ip) I think I may of changed when totalonlineplayers() was called though.. whatever, all you gotta do is throw a for loop with a call of >listbox.additem Player(i).Char(Player(i).CharNum).Name < I just put it in the function that I happenned to use whenever a character logged in/out. Just sit down for 5 damn minutes ![]() or for $2 I'll do it to your exact specs. :lol: Elmrok: I thought player index's didn't depend on the map#. Wouldn't you have to go something like: Code: Private Sub Form_Load() Wouldn't it be easier to call that with a command button, so you don't have to reload the form to 'refresh' the list too? - Xlithan - 20-01-2007 Would that only check the online players once when the form loads? What about checking when a player connects and leaves? Unless that's what you want to do. I'll work with a new method, I don't need all the data, just the character name, so I'll get rid of my listview box. - grimsk8ter11 - 20-01-2007 Zel, Elmrok's isn't lazy, he is showing whos on a map, not showing everyone online. Maybe that suites his purpose, and if you just didn't see that, read the whole code first. JoinGame: Code: frmServer.lstOnline.AddItem GetPlayerName(index) LeaveGame: this should be the only time you have to refresh the list, but you could probably manage without it to Code: frmServer.lstOnline.Clear - Xlithan - 21-01-2007 I never said anybody was lazy... lol, what's that all about? - grimsk8ter11 - 21-01-2007 I misread your post about you being lazy then. But the bad method thing is still being scrutinized ![]() - Xlithan - 21-01-2007 It checks the list for all online players when the form loads. That wouldn't really work on frmServer would it, since it only loads once... - grimsk8ter11 - 21-01-2007 Ya, but for what he wanted, it works perfectly for. For what you want, the code i posted is ideal. - Xlithan - 21-01-2007 Written a new one, works fine now. Thanks to everybody for the help. |