Simply disable rcon in server.cfg: open your server.cfg, find the line with "rcon" and put 0.
Kick players attempting to /rcon login. I do not know if with rcon disabled the /rcon login command will be read by the server, never tried it, anyways you can do:
Код:
#include a_samp
#include foreach
main()
{
printf("Hello Moon!");
}
new KickStr[64];
forward Kicked(playerid); // Callback To Kick A Player
public OnRconLoginAttempt(ip[], password[], success )
{
new PlayerIP[16];
foreach(Player, i)
{
GetPlayerIp(i, PlayerIP, sizeof PlayerIP);
if( !strcmp(ip, PlayerIP, true) )
{
format(KickStr,sizeof KickStr, "{ff0000}Do not try to login into RCON!");
SendClientMessage(i, -1, KickStr);
SetTimerEx("Kicked", 750, false, "i", i);
}
}
return 1;
}
public Kicked(playerid)
{
Kick(playerid);
return 1;
}
And after disabling RCON system, create your own Administration system, which will have an enum for players, with a variable to save a player admin level. Create your admin levels, and allow high levels to send RCON commands via the
SendRconCommand function.
Код:
CMD:mapname(playerid, params[])
{
if(PlayerVariable[playerid][AdminLevel] < 2) return SendClientMessage(playerid, -1, "{ff0000}Error: You need to be admin level 2.");
new string[64];
format(string, sizeof string, "mapname %s", params);
SendRconCommand(string);
return 1;
}
Usage of this command: /mapname [TEXT].
This will change the mapname visible on the SA-MP client, it is a RCON command and it has been sent without logging into RCON.