Register for your free account! | Forgot your password?

You last visited: Today at 14:56

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

Advertisement



[Release] /Admin Command

Discussion on [Release] /Admin Command within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
[Release] /Admin Command

Sup guys. Small release coded in about 2 minutes, not tested ( as usual ). The reason im not testing is because im to lazy installing appserv, lawl. Well, here you are.

This is what it does:
If an player types /admin, it will list up all admins that are online , if there isnt any admin online, it says that.

Search for /save or something like that where the playercommands are, and add this somewhere.

Code:
if (Message == "/admin")
                            {
                                string BackMsg = "";
                                foreach (DictionaryEntry DE in World.AllChars)
                                {
                                    Character Char = (Character)DE.Value;

                                    if (Char.MyClient.Status == 8 || Char.MyClient.Status == 7)
                                    {
                                        BackMsg += Char.Name + ", ";
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "There are no admin's online.", 2000));
                                    }
                                    if (BackMsg.Length > 1)
                                    {
                                        BackMsg = BackMsg.Remove(BackMsg.Length - 2, 2);
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Admin(s) Online : " + BackMsg, 2000));
                                    }
                                 }
                            }


Emme
_Emme_ is offline  
Thanks
9 Users
Old 12/10/2008, 14:00   #2
 
Beta Limit's Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 493
Received Thanks: 71
Thanks Emme this is a cool command.
Beta Limit is offline  
Old 12/10/2008, 15:03   #3
 
~jochemke~'s Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
nice release
didn't thought about something like that but i can save some broadcast spam
like any gm on? gm?
~jochemke~ is offline  
Old 12/11/2008, 00:45   #4
 
elite*gold: 0
Join Date: Nov 2008
Posts: 44
Received Thanks: 6
You should at least look your code over for logical errors.
Code:
if (Message == "/admin")
                            {
                                string BackMsg = "";
                                foreach (DictionaryEntry DE in World.AllChars)
                                {
                                    Character Char = (Character)DE.Value;

                                    if (Char.MyClient.Status == 8 || Char.MyClient.Status == 7)
                                    {
                                        BackMsg += Char.Name + ", ";
                                    }
                                    [color=red]else
                                    {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "There are no admin's online.", 2000));
                                    }
                                    if (BackMsg.Length > 1)
                                    {
                                        BackMsg = BackMsg.Remove(BackMsg.Length - 2, 2);
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Admin(s) Online : " + BackMsg, 2000));
                                    }[/color]
                                 }
                            }
By having the last two conditional statements in that foreach loop, are you not repeating those two constantly? Wouldn't they be better placed outside of the loop?
Rab is offline  
Old 12/11/2008, 02:50   #5
 
scottdavey's Avatar
 
elite*gold: 0
Join Date: Dec 2006
Posts: 684
Received Thanks: 238
It's compatible with one source, how is it a release?
scottdavey is offline  
Reply


Similar Threads Similar Threads
[Release] a new command
07/16/2009 - CO2 PServer Guides & Releases - 8 Replies
ok this is the /pet command ok its not hard to do and i thank it will only work if u have the summon guard working becaz i us its atk type or u can edit it if u want but ul hafe to fix it up so it wont atk its self if u do that well any way here u go find wear u put commands in and put this if (Splitter == "/pet") { // /pet HP atk name mech lvl ...
[Release]-- New Command --
12/10/2008 - CO2 PServer Guides & Releases - 7 Replies
GOT That Damianpesta _1_
admin's command
12/08/2005 - Lineage 2 - 0 Replies
i have a admin pass, but i don't know how to command, can anyone help me plzzz thx



All times are GMT +2. The time now is 14:56.


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.