Editing Server RCON?
#1

Hello guys,

As we all know every SA-MP server has a RCON system,and some RCON commands.Well every time we type /rcon say TEXT on the chatbox we can see this:
Admin: TEXT
Is there any way to make a change on this?I mean what if I would like to say SERVER: TEXT instead of Admin: TEXT?

Is there any way to make a change like this?

Sincerely,
George
Reply
#2

you could make a command for it, its impossible to change it, i think
Reply
#3

Correct, pds. It's impossible to change it but making command like that is so easy.
Reply
#4

pawn Код:
CMD:server(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You must be level 2 admin and up to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /server [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "*SERVER: %s *", params);
    SendClientMessageToAll(COLOR_CYAN, string);
    return 1;
}
i use this instead of rcon,
why? because rcon login takes more time to typ (Im lazy indeed...)
the code explains itself i guess

(Hope i helped you with this )
Reply
#5

Quote:
Originally Posted by Smikkeltoetje
Посмотреть сообщение
pawn Код:
CMD:server(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You must be level 2 admin and up to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /achat [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "*SERVER: %s *", params);
    SendClientMessageToAll(COLOR_CYAN, string);
    return 1;
}
cool but, is this copy paste? i edited it and remove something so it would work without any compiling errors try this

pawn Код:
CMD:server(playerid, params[])
{
    new
        string[128]
    ;
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You need to be Rcon Login to use this command");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, -1, "USAGE: /achat [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "*SERVER: %s *", params);
    SendClientMessageToAll(-1, string);
    return 1;
}
Reply
#6

Quote:
Originally Posted by pds2012
Посмотреть сообщение
cool but, is this copy paste? i edited it and remove something so it would work without any compiling errors try this

pawn Код:
CMD:server(playerid, params[])
{
    new
        string[128]
    ;
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You need to be Rcon Login to use this command");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, -1, "USAGE: /achat [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "*SERVER: %s *", params);
    SendClientMessageToAll(-1, string);
    return 1;
}
it works perfect for me and has 0 errors or warnings during compiling,
its from my own script,..
you just removed the line to check if the player is online
Reply
#7

Thank you for answering to my post guys,but sorry,I am not gonna use your commands.I will script mine so I can develop my skills.

Thank you once more for you help,i really appreciate this.
Reply
#8

@ Topic poster:

This is the best way without using zcmd or other shit.

pawn Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd,"Hello",true))
    {
        SendClientMessageToAll(0xFFFFFFAA,"SERVER: Hello Players!");
        print("You said 'Hello players'.");
        return 1;
    }
    return 0;
}
NOTE: /Rcon is not need to be used in the cmd string because the cmd is used by adding first /RCON [cmd name] in game e.g. if you want to make a rcon cmd, just under public OnRconCommand(cmd[]), add
pawn Код:
if(!strcmp(cmd,"MY COMMAND NAME HERE",true))
{
    // code here.
    return 1;
}
& when you test in in-game, login as RCON admin then type /rcon [[cmd which you made name here]]

then the cmd will work.

for more help, please view: https://sampwiki.blast.hk/wiki/OnRconCommand

================================================== ======
Reply
#9

Quote:
Originally Posted by geohareas
Посмотреть сообщение
Thank you for answering to my post guys,but sorry,I am not gonna use your commands.I will script mine so I can develop my skills.

Thank you once more for you help,i really appreciate this.
That's what he help section is for
Hope we helped you in a understandable way!

Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)