Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 21:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Request] Selected Item in listbox

Discussion on [Request] Selected Item in listbox within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2007
Posts: 118
Received Thanks: 37
[Request] Selected Item in listbox

Ok so i've been working on my own Admin panel for a LOTF source and been working on the disconnect from a listbox option.

Code:
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charr = (Character)DE.Value;
                if (Charr.MyClient.Online)
                {
                    listBox1.SelectedItem = listBox1.SelectedItem;
                    Charr.MyClient.Drop();
                    return;
                }
            }
that is for the disconnect button

only problem is that even you select a different character it disconnects the very first one

im guessing it has to do with looking for the number if items in the listbox and then clicking it and disconnecting that client corresponding to the object number
GrandSlam is offline  
Old 11/22/2008, 06:23   #2
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Quote:
Originally Posted by GrandSlam View Post
Ok so i've been working on my own Admin panel for a LOTF source and been working on the disconnect from a listbox option.

Code:
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charr = (Character)DE.Value;
                if (Charr.MyClient.Online)
                {
                    listBox1.SelectedItem = listBox1.SelectedItem;
                    Charr.MyClient.Drop();
                    return;
                }
            }
that is for the disconnect button

only problem is that even you select a different character it disconnects the very first one

im guessing it has to do with looking for the number if items in the listbox and then clicking it and disconnecting that client corresponding to the object number
i lol'd...

All thats doing is disconnect every client
if your listbox is in format of the clients name you need to do this:

Code:
            foreach (DictionaryEntry DE in World.AllChars)
            {
                Character Charr = (Character)DE.Value;
                if (Charr.MyClient.Online && Charr.Name == listBox1.SelectedItem.ToString())
                {
                    Charr.MyClient.Drop();
                    return;
                }
            }
Or something like that, its 5 am excuse me if that fails
© Haydz is offline  
Old 11/22/2008, 08:06   #3
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
maybe this should work if you delete: Charr.MyClient.Drop();

cuz Drop(); is also for dcing in game so ya
turk55 is offline  
Old 11/22/2008, 08:49   #4
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Quote:
Originally Posted by turk55 View Post
maybe this should work if you delete: Charr.MyClient.Drop();

cuz Drop(); is also for dcing in game so ya
lol`d?, rotfl , using Charr.MyClient.Drop(); , it disconect the selected char from World.AllChars , kinda
if(Char.Name == "learnsomething")
{
Char.MyClient.Drop();
}
else
Console.WriteLine("GO Learn MORE!");
alexbigfoot is offline  
Old 11/22/2008, 15:34   #5
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by alexbigfoot View Post
lol`d?, rotfl , using Charr.MyClient.Drop(); , it disconect the selected char from World.AllChars , kinda
if(Char.Name == "learnsomething)
{
Char.MyClient.Drop();
}
else
Console.WriteLine("GO Learn MORE!");

LOL ? dude im just like a week or 2 busy with it so dont flame at me!
turk55 is offline  
Old 11/22/2008, 16:26   #6
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
yea, i know ur new here, but still i know that u, want to make a server , without knowing stuff like this , to dc only the selected item ,try to understand Haydz`s code from...........^
.................................................. .................................................. .....|
alexbigfoot is offline  
Old 11/22/2008, 16:29   #7
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Can you screeny your listbox for me?
© Haydz is offline  
Reply


Similar Threads Similar Threads
[HTML/CSS] Frage: Navigation Hover/Selected/Selected Hover
08/28/2010 - Web Development - 1 Replies
Hallo zusammen. Ich bin gerade dabei ein Wordpress Layout umzusetzen und habe in Photoshop eine schicke Navigation gebastelt. Ich habe 5 Navipunkte, jedoch soll später im design unterschieden werden zwischen: Normal, Hover, Selected und Selected Hover. Einen einfachen Hovereffekt konnte ich ganz einfach erzeugen mit: <a href="http://lalala.lala/"><img src="http://localhost/wordpress/wp-content/th emes/eskapism/images/home.png"></a> <img...
[Frage]VB08 listbox
05/15/2010 - .NET Languages - 3 Replies
Hi, wollte fragen, wie man das aktuell angewählte Item umändert sprich: Listbox1.items = Metin2, WoW, 4 Story jetzt will ich WoW in Runescape verändern ohne das es die 2te Position verlässt! Wie mache ich das?? MfG Bestshocker
[Request]How to Change Item Colour or selected item when use lootalarm
05/14/2010 - 12Sky2 - 0 Replies
ex1. item is rare colour i want to change to elite colour. ex2. item is rare but i don't want it then no alarm.
[VB]Mehrer Fenster in Listbox
01/02/2010 - .NET Languages - 0 Replies
Howdi, wollt mal fragen wie ich mehrere Fenster mit dem "fast" gleichen namen in eine Lisbox bekomme ? Die Fenster sehen so aus Sbot v1.51 Sbot v1.51 Ich würde diese fenster gerne in eine Listbox einlesen.
[help] c# listbox databinding not updating
07/29/2009 - CO2 Programming - 3 Replies
Hi guys, I'm new to c#... my first time, and hopefully not he last. :D Just having trouble with listbox data-binding atm. For reasons I don't know, when changes are made to the data which the listbox is bounded to, the changes are not reflected inside the listbox. The following is some of the code i'm using. Firstly the intialisation and the bounding of the data to the listbox.



All times are GMT +2. The time now is 21:28.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.