Author Topic: Tags help  (Read 3452 times)

So for my server I'm making a tag system where if your admin it gives you the tags "A" and SA's get "SA"
then when you chat it'll say [test]Zedrow: Hi!
If I use the loading tags mod as a guide is that a good thing?
function ServerCmdMessageSent(%client, %message)
   {
      %oldPrefix = %client.clanPrefix;
      if(!%Client.hasSpawnedOnce)
      {
         %client.ClanPrefix = "\c7[\c1Loading\c7] " @%OldPrefix;
      }
      else
      {
         %client.ClanPrefix = "" @%oldPrefix;
      }
      parent::ServerCmdMessageSent(%client, %message);
      %client.clanPrefix = %oldPrefix;
   }

Then I tried it out:
package Tags
{
   function ServerCmdMessageSent(%client, %message)
   {
      %oldPrefix = %client.clanPrefix;
      if(!%Client.isAdmin)
      {
         %client.ClanPrefix = "\c7[\c1[A]\c7] " @%OldPrefix;
      }
      else
      {
         %client.ClanPrefix = "" @%oldPrefix;
      }
      parent::ServerCmdMessageSent(%client, %message);
      %client.clanPrefix = %oldPrefix;
   }
};
activatePackage(Tags);

is that correct?

Looks good to me.

I don't think you need this since it is going to reset anyways. (It looks the same as the %client.clanPrefix = %oldPrefix;)
else
{
    %client.ClanPrefix = "" @%oldPrefix;
}

Looks good to me.

I don't think you need this since it is going to reset anyways. (It looks the same as the %client.clanPrefix = %oldPrefix;)
else
{
    %client.ClanPrefix = "" @%oldPrefix;
}

So basically this:

package Tags
{
   function ServerCmdMessageSent(%client, %message)
   {
      %oldPrefix = %client.clanPrefix;
      if(!%Client.isAdmin)
      {
         %client.ClanPrefix = "\c7[\c1[A]\c7] " @%OldPrefix;
           
};
activatePackage(Tags);

Missing a  }. Also, I'd use gameconnection::. Less things to happening and would be good practice with values.

Oh, and parent. That's probably a snippet of the code so nvm.

Okay, thanks!
I got it to work!