Register for your free account! | Forgot your password?

You last visited: Today at 13:42

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

Advertisement



GM && VIP tag

Discussion on GM && VIP tag within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2007
Posts: 21
Received Thanks: 0
GM && VIP tag

in this release im going to share a simple code called [tag]. eg. when a player reach VIP LV 1-6 i prefer 5 gets a [VIP] tag in the left or right side of their name. whatever.

paste this in your entity.cs or character.cs
Code:
public void viptag(string oldName, string newName)
        {
            new Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("entities").Set(oldName, newName).Where("UID", UID).Execute();
        }
paste this in your Program.cs this is for the GMs && PMs tag
Code:
#region PMtag
                            
                            if ((int)client.Account.State == 4)
                            {
                                if (!client.Entity.Name.Contains("[PM]"))
                                {
                                    if (!(client.Entity.Name.Length >= 15))
                                    {
                                        client.Entity.viptag("Name", "[PM]" + client.Entity.Name);
                                        client.Disconnect();
                                    }
                                    else
                                    {
                                        client.Entity.Name.Substring(0, 10);
                                        client.Entity.viptag("Name", "[PM]" + client.Entity.Name);
                                        client.Disconnect();
                                    }
								
                            }
							}
                            else
                            {
                                if (client.Entity.Name.Contains("[PM]"))
                                {
                                    string viptag = client.Entity.Name;
                                    viptag = viptag.Replace("[PM]", "");
                                    client.Entity.viptag("Name", viptag);
                                    client.Disconnect();
                                }
								
                            }
                            
                            #endregion PMtag
This is the VIP tag paste this in your program.cs
Code:
#region VIP
                            
                            if (client.Entity.VIPLevel > 4 && (int)client.Account.State != 4)
                            {
                                if (!client.Entity.Name.Contains("[VIP]"))
                                {
                                    if (!(client.Entity.Name.Length >= 15))
                                    {
                                        client.Entity.viptag("Name", "[VIP]" + client.Entity.Name);
                                        client.Disconnect();
                                    }
                                    else
                                    {
                                        client.Entity.Name.Substring(0, 10);
                                        client.Entity.viptag("Name", "[VIP]" + client.Entity.Name );
                                        client.Disconnect();
                                    }

                                }
								
							
                            }

                            else if ((int)client.Account.State == 4)
                            
							
							{
                                if (client.Entity.Name.Contains("[VIP]") && !client.Entity.Name.Contains("[PM]") && !(client.Entity.Name.Length >= 15))
                                {
                                    string viptag = client.Entity.Name;
                                    viptag = viptag.Replace("[VIP]", "");
                                    client.Entity.viptag("Name", viptag);
                                    client.Disconnect();
                                  
						}
						}
							else if (client.Entity.VIPLevel < 5)
							{
                                if (client.Entity.Name.Contains("[VIP]"))
                                {
                                    string viptag = client.Entity.Name;
                                    viptag = viptag.Replace("[VIP]", "");
                                    client.Entity.viptag("Name", viptag);
									client.Disconnect();
                                }
							
							}
							 
                            #endregion VIP

BTW if youre wondering why not just combine the codes together. answer is i tried combining it but i get alot of conflicts i dunno y. if you guys figured that out post it here so everyone will know especially me

and one last thing the "oldName" && "newName" is the thing when you change your name in namechanger in the game.
pounder is offline  
Old 07/30/2013, 02:43   #2
 
elite*gold: 0
Join Date: Apr 2012
Posts: 58
Received Thanks: 1
AHAHAHAH, copied from egy forum, try to make the code by your own don't copy paste again
Mero.El.Omda is offline  
Old 07/30/2013, 09:01   #3
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Wow some horrible codes.
Super Aids is offline  
Thanks
2 Users
Old 07/30/2013, 09:36   #4
 
elite*gold: 0
Join Date: Oct 2007
Posts: 21
Received Thanks: 0
Quote:
Originally Posted by Mero.El.Omda View Post
AHAHAHAH, copied from egy forum, try to make the code by your own don't copy paste again
i didnt copy it.. sorry to disappoint you.

Quote:
Originally Posted by Super Aids View Post
Wow some horrible codes.
appreciated it.
pounder is offline  
Old 07/31/2013, 16:06   #5


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
why... how... I don`t even wanna know.
KraHen is offline  
Old 07/31/2013, 16:20   #6
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Personally, I like the way we handled 'tags' in Albetros -- add new entries to the existing ini/title.ini file and use the title system.
nTL3fTy is offline  
Old 03/27/2025, 06:57   #7
 
elite*gold: 0
Join Date: Mar 2017
Posts: 5
Received Thanks: 0
Can someone convert this to NewestCoServer for me please " #region VIP

if (client.Entity.VIPLevel > 4 && (int)client.Account.State != 4)
{
if (!client.Entity.Name.Contains("[VIP]"))
{
if (!(client.Entity.Name.Length >= 15))
{
client.Entity.viptag("Name", "[VIP]" + client.Entity.Name);
client.Disconnect();
}
else
{
client.Entity.Name.Substring(0, 10);
client.Entity.viptag("Name", "[VIP]" + client.Entity.Name );
client.Disconnect();
}

}


}

else if ((int)client.Account.State == 4)


{
if (client.Entity.Name.Contains("[VIP]") && !client.Entity.Name.Contains("[PM]") && !(client.Entity.Name.Length >= 15))
{
string viptag = client.Entity.Name;
viptag = viptag.Replace("[VIP]", "");
client.Entity.viptag("Name", viptag);
client.Disconnect();

}
}
else if (client.Entity.VIPLevel < 5)
{
if (client.Entity.Name.Contains("[VIP]"))
{
string viptag = client.Entity.Name;
viptag = viptag.Replace("[VIP]", "");
client.Entity.viptag("Name", viptag);
client.Disconnect();
}

}

#endregion VIP "
inyourdreams17 is offline  
Old 03/27/2025, 07:45   #8
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,190
Quote:
Originally Posted by inyourdreams17 View Post
Can someone convert this to NewestCoServer for me please " #region VIP

if (client.Entity.VIPLevel > 4 && (int)client.Account.State != 4)
{
if (!client.Entity.Name.Contains("[VIP]"))
{
if (!(client.Entity.Name.Length >= 15))
{
client.Entity.viptag("Name", "[VIP]" + client.Entity.Name);
client.Disconnect();
}
else
{
client.Entity.Name.Substring(0, 10);
client.Entity.viptag("Name", "[VIP]" + client.Entity.Name );
client.Disconnect();
}

}


}

else if ((int)client.Account.State == 4)


{
if (client.Entity.Name.Contains("[VIP]") && !client.Entity.Name.Contains("[PM]") && !(client.Entity.Name.Length >= 15))
{
string viptag = client.Entity.Name;
viptag = viptag.Replace("[VIP]", "");
client.Entity.viptag("Name", viptag);
client.Disconnect();

}
}
else if (client.Entity.VIPLevel < 5)
{
if (client.Entity.Name.Contains("[VIP]"))
{
string viptag = client.Entity.Name;
viptag = viptag.Replace("[VIP]", "");
client.Entity.viptag("Name", viptag);
client.Disconnect();
}

}

#endregion VIP "
You should never copy / "convert" code without understanding what it does and what vulnerabilities it may introduce your server to.
Spirited is offline  
Old 03/30/2025, 20:33   #9
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,785
Received Thanks: 5,304
The good ole days of checking for substrings instead of an account having permission level attributes. Simpler times.
Arcо is offline  
Reply




All times are GMT +1. The time now is 13:46.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.