Rcon HELP
#1

Hey guys. Is it possible the rcon chat to be other color?

Example:
pawn Code:
SendRconCommand("say TEST");
And the text is white blue color. How to make the text yellow?
Reply
#2

here u go,
pawn Code:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "say", true) == 0)
    {
        new string[256], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"*Admin %s:  %s",pName,string);
        SendClientMessageToAll(0xFFFF00AA,string);//yellow
    }
    return 1;
}
Reply
#3

Ooo thanks for telling, i never could you can do that
Reply
#4

Thanks, it was saying an error with the playerid but i just add new playerid; +REP for you.
Reply
#5

Quote:
Originally Posted by XtremeR
View Post
here u go,
pawn Code:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "say", true) == 0)
    {
        new string[256], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"*Admin %s:  %s",pName,string);
        SendClientMessageToAll(0xFFFF00AA,string);//yellow
    }
    return 1;
}
There's no playerid parameter in that callback. Also, what do you think would happen if you used it from the console or a remote access application?
Reply
#6

Oh it isn't work when i type somethin it stay in blue color.
Reply
#7

It says in blue color because you assigned it in blue ..
Change to
pawn Code:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "say", true) == 0)
    {
        new string[128];
        format(string,sizeof string,"*RCON Admin:  %s",string);
        SendClientMessageToAll(0xFFFFFFFF,string); //------This line to edit to change color-------//
    }
    return 1;
}
For white.. ^^
else if its not the problem .. then Explain it properly!
Reply
#8

I work with defines so the command must be this:

pawn Code:
new string[128];
        format(string,sizeof string,"*RCON Admin:  %s",string);
        SendClientMessageToAll(COLOR_YELLOW,string);
Still don't see the problem.
Reply
#9

add return 0 after sendclientmessagetoall?
Reply
#10

Nevermind i fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)