Show messages for RCON Admins
#1

Hi, i've been trying to show messages for remote RCON Admins, but nothing works.
I tried:
print
printf
SendRconCommand("echo <here text>");
CallRemoteFunction("OnRconCommand","s","/testmessages <here text>");

I created /testmessages command in a filterscript to use CallRemoteFunction, but messages weren't showed.
When i type /testmessages from rcon console, messages are showed, but not when i use it in the script.

I have also tried:
print
printf
SendRconCommand("echo <here text>");
into /testmessages command, but nothing works, as i said, only works when i use command in the remote rcon console.

(I tried all solutions in this thread, but nothing works)

Any solution?
Reply
#2

Yes, you have to create a loop throught all players and check if a player is an RCON admin.

Here you go:
pawn Код:
stock SendMessageToAdmins(color, message[])
{
    new MaxPlayers = GetMaxPlayers();
    for(new i=0; i<MaxPlayers; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(!IsPlayerAdmin(i)) continue;
        SendClientMessage(i, color, message);
    }
    return 1;
}
Reply
#3

You could create a SendRCONMessage function with SendClientMessage and IsPlayerAdmin.

pawn Код:
stock SendRCONMessage(sendername[24], color, message[])
{
    format(message, sizeof(message), "%s: %s", sendername, message);
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i, color, message);
    }
    return 1;
}
Untested, you may have to give message[] a specific size.
Reply
#4

Why not just use /rcon say <text here> ?
Reply
#5

I know that work, but i want to show messages in rcon console. Screenshot:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)