Author Topic: Code For Adding tags...  (Read 708 times)

Hello, If you know the code for when someine joins and is admin or super admin it adds tags automaticlly. Please help!

I think it goes something like this:
Code: [Select]
package clantags
{
     gameConnection::autoAdminCheck
       if(%client.isadmin)
     %client.setClanPrefix = "Admin";
     {
          if(%client.isSuperAdmin)
            %client.setClanPrefix = "SuperAdmin";
     }
};
activatepackage (clantags)
or something like that.  I'm too tired to work on it.

tertantary operator go!
Code: [Select]
package adminTags {
function gameConnection::autoAdminCheck(%c)
{
if(%c.isAdmin)
%c.clanPrefix=%c.isSuperAdmin?"Super Admin":"Admin";
parent::autoAdminCheck(%c);
}
};
activatePackage(adminTags);
« Last Edit: September 05, 2009, 12:04:11 AM by Slicksilver555 »

« Last Edit: September 05, 2009, 10:29:26 AM by MB2468 »

You should do that after the auto admin check or nobody will get any tags.

You should do that after the auto admin check or nobody will get any tags.

Code: [Select]
package CustomTags
{
function GameConnection::autoAdminCheck(%this)
{
// First perform the auto admin check. You need to assign it's
// value to a variable since the parent must be returned later.
%a = Parent::autoAdminCheck(%this);

if(%this.isAdmin)
{
// Are they also super admin? If so, perform just the top functions.
if(%this.isSuperAdmin)
{
// Put a red SA before their normal clan tag. (Append the two.)
%this.clanPrefix = "\c0(SA) \c7" @ %this.clanPrefix;
}
else
{
// Put a yellow A before their normal clan tag. (Append the two.)
%this.clanPrefix = "\c3(A) \c7" @ %this.clanPrefix;
}
}

// Return the value of the function as it should normally do.
return %a;
}
};
activatePackage(CustomTags);

You should do that after the auto admin check or nobody will get any tags.
I had mine executed on my server an everyone besides admins had clanprefix/suffixes.