manbearpig Posted July 6, 2009 Author Share Posted July 6, 2009 Hello every one! blue here and i have a question/Request Does any one know how i can put a thing on my main menu saying Total Players Online: (Player amount here)Ive looked in the source index :P and cant find it i dont think any one made it yet =D if you know pm me or post it =)Thank youAny help is appreciated. Link to comment Share on other sites More sharing options...
damian666 Posted July 6, 2009 Share Posted July 6, 2009 kryce online has it ^^maybe he wants to share with ya, i am also trying to do it, but its not as easy as it looks XDDamian666 Link to comment Share on other sites More sharing options...
manbearpig Posted July 6, 2009 Author Share Posted July 6, 2009 wouldnt you make a label saying Total players online then another label saying Call totalplayersonline idk lolEDITTHAT JUST GAVE ME A IDEA ( if it works ill make a tut.)Edit =(Never mind its not as easy as you think.. Link to comment Share on other sites More sharing options...
Joyce Posted July 7, 2009 Share Posted July 7, 2009 It should be easy… Send a packet named 'top' to the server, get the response and tadaaa! There's your amount of players. Link to comment Share on other sites More sharing options...
damian666 Posted July 7, 2009 Share Posted July 7, 2009 well, thats exactly what is wrong fr me…dont know how to retrieve that information server sided, so i cant send it either... XDDamian666 Link to comment Share on other sites More sharing options...
Joyce Posted July 7, 2009 Share Posted July 7, 2009 If you don't even know how all that works, why bother trying it? There is a packet named 'top' in Eclipse by default… Use that, look it up in the server, and see what it returns... Come on, it's not THAT hard... That's basic stuff :/ Link to comment Share on other sites More sharing options...
damian666 Posted July 7, 2009 Share Posted July 7, 2009 lol, i just never saw it thats all.i am used to sending packets, and recieving them too, a guy can overlook you know :/Damian666 Link to comment Share on other sites More sharing options...
emblem Posted July 7, 2009 Share Posted July 7, 2009 *sigh* Give me 2 minutes, I'll cook up some code for it. Link to comment Share on other sites More sharing options...
balliztik1 Posted July 7, 2009 Share Posted July 7, 2009 ```Sub SendOnlineList()  Dim packet As String  Dim PlayerCount As Long  Dim i As Long  For i = 1 To MAX_PLAYERS    If IsPlaying(i) Then      packet = packet & SEP_CHAR & GetPlayerName(i) & SEP_CHAR      PlayerCount = PlayerCount + 1    End If  Next i  Call SendDataToAll("ONLINELIST" & SEP_CHAR & PlayerCount & packet & END_CHAR)End Sub``````  ' ::::::::::::::::::::::::::  ' :: Get Online List ::  ' ::::::::::::::::::::::::::  If casestring = "onlinelist" Then    frmMirage.lstOnline.Clear    n = 2    z = Val(parse(1))    For x = n To (z + 1)      frmMirage.lstOnline.addItem Trim$(parse(n))      n = n + 2    Next x    Exit Sub  End If```Alter this to be usable from the main menu. Link to comment Share on other sites More sharing options...
emblem Posted July 7, 2009 Share Posted July 7, 2009 Ok. Got it. It works.Client Side**Add a label to frmMainMenu called lblPlayers, then add the codes bellow as it sais:**```    lblOnline.Caption = "Offline"    lblOnline.ForeColor = vbRed  End If``````  Call SendData("getonline" & END_CHAR)``````  If (casestring = "playernewxy") Then    X = Val(parse(1))    y = Val(parse(2))    If Not GetPlayerX(MyIndex) = X Then Call SetPlayerX(MyIndex, X)    If Not GetPlayerY(MyIndex) = y Then Call SetPlayerY(MyIndex, y)    Exit Sub  End If``````  If (casestring = "totalonline") Then    frmMainMenu.lblPlayers.Caption = "Players Online: " & Trim(parse(1))    Exit Sub  End If```ServerSide**No controls to add here, just code edits.**```    Case "getclasses"      Call Packet_GetClasses(Index)      Exit Sub``````    Case "getonline"      Call Packet_GetWhosOnline(Index)      Exit Sub``````Public Sub Packet_GetWhosOnline(ByVal Index)  Call SendDataTo(Index, "totalonline" & SEP_CHAR & TotalOnlinePlayers & END_CHAR)End Sub```CreditsNo credits needed, you can steal this tutorial and this code and claim it as your own for as much as I care. It tooks like, 3 minutes to do which is nothing. Link to comment Share on other sites More sharing options...
damian666 Posted July 7, 2009 Share Posted July 7, 2009 lol >.<, and right after i did it myself :Pdamn it, another brain cycle wasted ^^oh well, thanx man :)i did it with the givemethemax packet, add a extra one to it, and parse it on mainmenu, but hee, this works too :)Damian666 Link to comment Share on other sites More sharing options...
emblem Posted July 7, 2009 Share Posted July 7, 2009 I was gonna do that originally, but then I remembered the number wouldn't update if someone joined the game while the main menu was open. Link to comment Share on other sites More sharing options...
manbearpig Posted July 8, 2009 Author Share Posted July 8, 2009 Thanks so much but what does this mean whats add after??Code: (Add After) [Select]  If (casestring = "totalonline") Then    frmMainMenu.lblPlayers.Caption = "Players Online: " & Trim(parse(1))    Exit Sub  End Ifadd after this??Code: (Find (frmMainMenu.Sub Status_Timer)) [Select]    lblOnline.Caption = "Offline"    lblOnline.ForeColor = vbRed  End If Link to comment Share on other sites More sharing options...
kris_hole Posted August 5, 2009 Share Posted August 5, 2009 lawl. i liek how everyone wants the players online counter since i installed mine into kryce :Pat least i scored one thing that no other eclipse game had i think. =D Link to comment Share on other sites More sharing options...
damian666 Posted August 6, 2009 Share Posted August 6, 2009 untrue, it was done before, but yeah, you did make it populair ^^Damian666 Link to comment Share on other sites More sharing options...
minipimp Posted August 6, 2009 Share Posted August 6, 2009 @[SB:> Damian666 link=topic=47718.msg515223#msg515223 date=1249542799]> untrue, it was done before, but yeah, you did make it populair ^^> > Damian666Yes thats kind of why i wanted it it mine too. Kryce did make it popular Link to comment Share on other sites More sharing options...
kris_hole Posted August 6, 2009 Share Posted August 6, 2009 HUZZZAAAHHH!!!!so how is everyone :P? Link to comment Share on other sites More sharing options...
Patrick Posted August 6, 2009 Share Posted August 6, 2009 I never sawit on the main menu? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now