Forum > Serverside Modding

[C++] Trinity Announce System

(1/5) > >>

Everon Mightbane:
Hey does anyone have or know about a trinity announce system that roughly outputs:

Servername Rank PlayerName: Message

So for example


CoolWoW Admin Bob: Hello world.

Thanks in advance.

Laniax:
you can mod the announce command to include the servername. check out the cs_* and level* files.

Everon Mightbane:
Yeah, I've been able to include the server name but I haven't managed to do the rank part.

Laniax:
You could call the player's GMlevel and then based on that level add a rank to the command

for example:


--- Code: ---uint32 gmlevel = player->GetSession()->GetSecurity();
std::string rank;
switch (gmlevel)
{
   case 1: // gmlevel is 1
     rank = "Moderator"; break;
  case 2: // gmlevel is 2
     rank = "Game Master"; break;
   case 3: // gmlevel is 3
     rank = "Server Admin"; break;
default: rank = ""; break;
}

--- End code ---

that way the 'rank' string has the current playerrank, you can simple add this inside the announce. Adding more ranks should be easy.

schlumpf:

--- Quote from: "Laniax" ---You could call the player's GMlevel and then based on that level add a rank to the command

for example:


--- Code: ---uint32 gmlevel = player->GetSession()->GetSecurity();
std::string rank;
switch (gmlevel)
{
   case 1: // gmlevel is 1
     rank = "Moderator"; break;
  case 2: // gmlevel is 2
     rank = "Game Master"; break;
   case 3: // gmlevel is 3
     rank = "Server Admin"; break;
default: rank = ""; break;
}

--- End code ---

that way the 'rank' string has the current playerrank, you can simple add this inside the announce. Adding more ranks should be easy.
--- End quote ---

I hope their rank variable is enumerated. You may want to use that enumeration instead.

Navigation

[0] Message Index

[#] Next page

Go to full version