Hehe ok no problem I show it you - was very easy to do in the hooks.cpp.
Just as an information why I got 3 strings: The msg->message was not writeable, and I just got knowledge in C so I don't know if there are better methodes in C++ ;D I paste the msg-> message into MeMessage and than I say that the beginning of OutputMeMessage gets all values since the third or forth place (I ask for a space, if someone writes /meis afk, or /me is afk, would be bad if by the first one would be written: Whitefire s afk
I add the '\0' to solve wrong output of ugly signs... to say where the string ends 1000 is just a value, I can change it, I think the buffer allows only 512 letters right? If yes I will reduce it to the same value..
else if(!strncmp(msg->message, "/me"))
{
int iCount;
int iCount2 = 0;
char OutputMeMessage[1000];
char MeMessage[1000];
strcpy(MeMessage, msg->message);
if(MeMessage[3] == ' ')
{
iCount = 4;
}
else
{
iCount = 3;
}
for(iCount = iCount; MeMessage[iCount] != '\0';iCount++)
{
OutputMeMessage[iCount2] = MeMessage[iCount];
iCount2++;
}
OutputMeMessage[iCount2] = '\0';
char buf[512] = {0};
str_format(buf, sizeof(buf), "%s %s", server_clientname(client_id), OutputMeMessage);
game.send_chat(-1, GAMECONTEXT::CHAT_ALL, buf);
for(iCount = 0; iCount < 1000; iCount++)
{
MeMessage[iCount] = ' ';
OutputMeMessage[iCount] = ' ';
}
MeMessage[0] = '\0';
OutputMeMessage[0] = '\0';
}
At which line in the hook.cpp?
I searched for:
if(msgtype == NETMSGTYPE_CL_SAY)
{
NETMSG_CL_SAY *msg = (NETMSG_CL_SAY *)rawmsg;
int team = msg->team;
if(team)
team = p->team;
else
team = GAMECONTEXT::CHAT_ALL;
If you haven't written there already an own "if" than you have to write "if" and not "else if".
So if we write "/me is afk" than a yellow game message will appear:
*** Whitefire is afk
What I want to change is the color or / and to remove the ***
Edit: Ah forgot to say, this worked in the nrace (where I was testing first). In the normal teeworlds source code is a library or something like that missed, cause BAM says he don't know msg->message when I compile... -.- And I need it there too, but well thats just a small problem, I think I will solve that
Avatar by Crises
Tee-Project - Website coming soon... [http://project.tee-city.net]