rcon say
#1

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?
Reply
#2

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

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?
Reply
#4

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..
Reply
#5

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

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.
Reply
#7

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;
}
Reply
#8

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)