PDA

View Full Version : Rcon HELP


necrobg3
03/10/2012, 07:08 AM
Hey guys. Is it possible the rcon chat to be other color?

Example:

SendRconCommand("say TEST");

And the text is white blue color. How to make the text yellow?

XtremeR
03/10/2012, 07:37 AM
here u go,
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;
}

SupaVZ
03/10/2012, 07:44 AM
Ooo thanks for telling, i never could you can do that :D

necrobg3
03/10/2012, 11:30 AM
Thanks, it was saying an error with the playerid but i just add new playerid; +REP for you.

KingHual
03/10/2012, 11:35 AM
here u go,
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?

necrobg3
03/10/2012, 02:50 PM
Oh it isn't work when i type somethin it stay in blue color.

Jarnu
03/10/2012, 02:57 PM
It says in blue color because you assigned it in blue ..
Change to

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!

necrobg3
03/10/2012, 05:30 PM
I work with defines so the command must be this:


new string[128];
format(string,sizeof string,"*RCON Admin: %s",string);
SendClientMessageToAll(COLOR_YELLOW,string);


Still don't see the problem.

CmZxC
03/10/2012, 05:34 PM
add return 0 after sendclientmessagetoall?

necrobg3
04/10/2012, 10:23 AM
Nevermind i fixed it.