SA-MP Forums Archive
rcon say - 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: rcon say (/showthread.php?tid=234006)



rcon say - grand.Theft.Otto - 02.03.2011

I was wondering if it is possible to change the blue word:

* Admin: [words here]

when speaking to the server using " rcon say " to something like:

*grandTheftOtto from Console: [words here]

Is that possible?


Re: rcon say - Lorrden - 02.03.2011

If You can find the function for Rcon say it's possible.


Re: rcon say - grand.Theft.Otto - 02.03.2011

Quote:
Originally Posted by Lorrden
Посмотреть сообщение
If You can find the function for Rcon say it's possible.
Umm. What function would it be?

pawn Код:
public OnRconCommand(cmd[])
{
    return 1;
}
This?


Re: rcon say - Lorrden - 02.03.2011

Yeh,

pawn Код:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "say", true) == 0)
    {
        new string[256];
        format(string, sizeof(string), "* Admin %s: %s", get the playername, find the message entered after /rcon say);
        SendClientMessageToAll(color, string);
        return false;
    }
    return 1;
}

Or something like that..


Re: rcon say - [WF]Demon - 02.03.2011

I do not think its possible since there is no playerid in OnRconCommand


Re: rcon say - Cameltoe - 02.03.2011

Quote:
Originally Posted by [WF]Demon
Посмотреть сообщение
I do not think its possible since there is no playerid in OnRconCommand
There's always an workaround.

https://sampwiki.blast.hk/wiki/OnRconLoginAttempt

Loop through the ip's store the id in an global variable for later use in the RconCommand callback.


Re: rcon say - grand.Theft.Otto - 02.03.2011

Quote:
Originally Posted by [WF]Demon
Посмотреть сообщение
I do not think its possible since there is no playerid in OnRconCommand
No wonder I kept getting Undefined symbol: playerid ...

But I don't want to get the admin/player's ID, I'm talking about it showing up in-game from typing it from the Remote Console, not from in-game by doing /rcon say [words]

I don't want the ID to show up, I just want the name to show.

I have this at the moment:
pawn Код:
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 From Console:  %s",pName,string);
        SendClientMessageToAll(COLOR_LIGHTNEUTRALBLUE,string);
        return false;
    }
    return 1;
}



Re: rcon say - Lorrden - 02.03.2011

Well, then the admin has to enter his/her name in the console aswell..


Re: rcon say - grand.Theft.Otto - 02.03.2011

Ahh, fuck it, it's too complicated. I'll leave * Admin for now lol.


Re: rcon say - leong124 - 03.03.2011

Why so difficult?
pawn Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd, "asay", true, 5))//Make sure you have to limit the length or it will also compare parameters
    {
        new string[128];
        format(string,sizeof(string),"*grandTheftOtto from Console: %s",cmd[5]);
        SendClientMessageToAll(COLOR_LIGHTNEUTRALBLUE,string);
        return 1;
    }
    return 0;
}
You say you type your chat in the console, and I guess there is only 1 rcon admin.
Directly putting the name there is okay.
BTW, I think you can't replace the original "say" command because those built-in commands are processed first.
I found this when I try to record rcon commands.