Author Topic: In-Game Host label  (Read 655 times)

ok, so, basically, what i would like to do, is have in game, a mod, that puts a:

[Host]

before the name of the host when chatting. ik this is simple, but im kinda lost.

package blahtest
{
   function serverCmdMessageSent(%client,%msg)
   {
      if(%client.bl_id == getNumKeyID())
         %client.clanPrefix = "\c7[\c4Host\c7]" SPC %client.clanPrefix;
      parent::serverCmdMessageSent(%client,%msg);
   }
};activatepackage(blahtest);

package blahtest
{
   function serverCmdMessageSent(%client,%msg)
   {
      if(%client.bl_id == getNumKeyID())
         %client.clanPrefix = "\c7[\c4Host\c7]" SPC %client.clanPrefix;
      parent::serverCmdMessageSent(%client,%msg);
   }
};activatepackage(blahtest);

You should also account for LAN servers

if I add this to a gamemode, like, Jail mod, should I integrate it into the server.cs, or make a new .cs?

if I add this to a gamemode, like, Jail mod, should I integrate it into the server.cs, or make a new .cs?
anywhere will work.

if I add this to a gamemode, like, Jail mod, should I integrate it into the server.cs, or make a new .cs?
Anywhere in an executed .cs file will work.

If you are creating a new.cs file, you have to make sure it is executed. Easiest thing to do is add
exec("./new.cs");
To the existing server.cs

package blahtest
{
   function serverCmdMessageSent(%client,%msg)
   {
      if(%client.bl_id == getNumKeyID())
         %client.clanPrefix = "\c7[\c4Host\c7]" SPC %client.clanPrefix;
      parent::serverCmdMessageSent(%client,%msg);
   }
};activatepackage(blahtest);

This will add another [Host] tag every time you send a message.

This will add another [Host] tag every time you send a message.

How do I fix it?

How do I fix it?
Store the clanPrefix before editing it, the restore it after calling the parent. You can look at that admin shields script for something that did pretty much he same thing this does.