SA-MP Forums Archive
Show messages for RCON Admins - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Show messages for RCON Admins (/showthread.php?tid=176164)



Show messages for RCON Admins - Gantzyo - 12.09.2010

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?


Re: Show messages for RCON Admins - Zimon95 - 12.09.2010

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;
}



Re: Show messages for RCON Admins - Mauzen - 12.09.2010

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.


Re: Show messages for RCON Admins - LarzI - 12.09.2010

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


Respuesta: Show messages for RCON Admins - Gantzyo - 12.09.2010

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