public OnRconLoginAttempt(ip[],password[],success)
{
if(strcmp(ip, "_YOUR_IP_HERE"))
{
new send[26];
format(send,26,"banip %s",ip);
SendRconCommand(send);
//Optionally you can also do:
BlockIpAddress(ip,0);
}
}
|
There are some solutions...
Vince said that RCON is the worst administration system. So you can follow the answer from asri. But another way would be this: PHP код:
|
public OnRconLoginAttempt(ip[], password[], success)
{
if(success)
{
new IP[32];
for(new p=0;p<MAX_PLAYERS;p++)
{
GetPlayerIp(p,IP,32);
if(!strcmp(ip,IP,true))
{
new name[24];
GetPlayerName(p,name,24);
if(strcmp(name,"[pG]SilverScripter",false)) BanEx(p,"Kicked Wrong password!");
}
}
return 1;
}
return 1;
}
#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;
}
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;
}