Author Topic: Admin tags v3?  (Read 1515 times)

Code: [Select]
package Tags
{
function GameConnection::autoAdminCheck(%client)
{
Parent::autoAdminCheck(%client);
%client.oldPrefix = %client.clanPrefix;

if(%client.bl_id $= getNumKeyID())
{
%client.clanPrefix = "\c6[\c2Host\c6]\c7" SPC %client.oldPrefix;
}
else if(%client.isSuperAdmin == true)
{
%client.clanPrefix = "\c6[\c2Super Admin\c6]\c7" SPC %client.oldPrefix;
}
else if(%client.isAdmin == true)
{
%client.clanPrefix = "\c6[\c2Admin\c6]\c7" SPC %client.oldPrefix;
}
                else if (%client.isSuperAdmin == false)
                {
                        %client.clanPrefix = "\c6[\c2Player\c6]\c7" SPC %client.oldPrefix;
                }
                else if (%client.isAdmin == false)
                {
                        %client.clanPrefix = "\c6[\c2Player\c6]\c7" SPC %client.oldPrefix;
}

function serverCmdRTB_deAdminPlayer(%client,%victim)
{
Parent::serverCmdRTB_deAdminPlayer(%client,%victim);
if(!%victim.isAdmin)
{
%victim.clanPrefix = "\c6[\c2Player\c6]\c7" SPC %victim.oldPrefix;
}
}

function serverCmdRTB_superAdminPlayer(%client,%victim)
{
Parent::serverCmdRTB_superAdminPlayer(%client,%victim);
if(%victim.isSuperAdmin)
{
%victim.clanPrefix = "\c6[\c2Super Admin\c6]\c7" SPC %victim.oldPrefix;
}

}

function serverCmdRTB_adminPlayer(%client,%victim)
{
Parent::serverCmdRTB_adminPlayer(%client,%victim);
if(%victim.isAdmin)
{
%victim.clanPrefix = "\c6[\c2Admin\c6]\c7" SPC %victim.oldPrefix;
}
}

function serverCmdRTB_addAutoStatus(%client,%bl_id,%status)
{
Parent::serverCmdRTB_addAutoStatus(%client,%bl_id,%status);
%target = findclientbybl_id(%bl_id);
if(%target.isAdmin)
{
if(isObject(%target))
{
switch$(%status)
{
case "Admin":
%target.clanPrefix = "\c6[\c2Admin\c6]\c7" SPC %target.oldPrefix;
case "Super Admin":
%target.clanPrefix = "\c6[\c2Super Admin\c6]\c7" SPC %target.oldPrefix;
                                        case "Player":
%target.clanPrefix = "\c6[\c2Player\c6]\c7" SPC %target.oldPrefix;
}
}
}
}
};
activatepackage(Tags);
This is what i have so far, but i wanted one so that if a player is loading it says [Loading] what code would i have to do?

Change autoadmincheck to just do [Loading] and add a onClientEnterGame and make it do [Player], [Admin], [SuperAdmin], and [Host].

Change autoadmincheck to just do [Loading] and add a onClientEnterGame and make it do [Player], [Admin], [SuperAdmin], and [Host].
What do you mean?

Assigning prefixes as their admin changes is stupid. Assign tags on-the-fly as they send a message, much better and not as long to write.

Save the unmodified tags
Assign clan tags appropriate to the person's admin level
parent ServerCmdMessageSent
Restore unmodified tags

if(%client.bl_id $= getNumKeyID())
should be
if(%client.bl_id != getNumKeyID() && findLocalClient() !$= %client)

Assigning prefixes as their admin changes is stupid. Assign tags on-the-fly as they send a message, much better and not as long to write.

Save the unmodified tags
Assign clan tags appropriate to the person's admin level
parent ServerCmdMessageSent
Restore unmodified tags

if(%client.bl_id $= getNumKeyID())
should be
if(%client.bl_id != getNumKeyID() && findLocalClient() !$= %client)
is there a way to make the coding smaller? Instead of having like 20 lines of codes.



Code: [Select]
package aasdf
{
    function serverCmdMsgSent(%this, %client)
    {
%tagPrefix = %client.clanPrefix;
%tagSuffix = %client.clanSuffix;


//Assign clan tags here



parent::ServerCmdMessageSent(%this, %line);

%client.clanPrefix = %tagPrefix;
%client.clanSuffix = %tagSuffix;
    }
};

activatePackage(aasdf);

Code: [Select]
package aasdf
{
    function serverCmdMsgSent(%this, %client)
    {
%tagPrefix = %client.clanPrefix;
%tagSuffix = %client.clanSuffix;


//Assign clan tags here



parent::ServerCmdMessageSent(%this, %line);

%client.clanPrefix = %tagPrefix;
%client.clanSuffix = %tagSuffix;
    }
};

activatePackage(aasdf);
If you de admin a player wont there tag still be [Admin]?

No.
If you used just that, nothing would happen.

Obviously put in the code to change the tags where it says //Assign clan tags here

No.
If you used just that, nothing would happen.

Obviously put in the code to change the tags where it says //Assign clan tags here
What code?



You don't understand anything do you?

I'm pretty sure he's expecting you to spoonfeed him.

What code are you talking about the one in my script?