Rcon HELP - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Rcon HELP (
/showthread.php?tid=382372)
Rcon HELP -
necrobg3 - 03.10.2012
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?
Re: Rcon HELP -
XtremeR - 03.10.2012
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;
}
Re: Rcon HELP -
SupaVZ - 03.10.2012
Ooo thanks for telling, i never could you can do that
Re: Rcon HELP -
necrobg3 - 03.10.2012
Thanks, it was saying an error with the playerid but i just add new playerid; +REP for you.
Re: Rcon HELP -
KingHual - 03.10.2012
Quote:
Originally Posted by XtremeR
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?
Re: Rcon HELP -
necrobg3 - 03.10.2012
Oh it isn't work when i type somethin it stay in blue color.
Re: Rcon HELP - Jarnu - 03.10.2012
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!
Re: Rcon HELP -
necrobg3 - 03.10.2012
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.
Re: Rcon HELP -
CmZxC - 03.10.2012
add return 0 after sendclientmessagetoall?
Re: Rcon HELP -
necrobg3 - 04.10.2012
Nevermind i fixed it.