[HELP]BanIP
#1

Hello I can not board with this code you help us? I wish that he who has the IP you got there I will ban if you can rcon ... I can not even with the Board thank you for every help

This Is my Code
Код:
public OnRconLoginAttempt(ip[], password[], success)
{
	if(success)
	{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	if(IsPlayerConnected(i))
	{//90
	if(!strcmp(ip,"84.47.44.220",true) || !strcmp(ip,"91.127.120.7",true) || !strcmp(ip,"78.98.103.55",true) || !strcmp(ip,"95.102.204.10",true))
	{
	SendClientMessage(i,0x33AA33AA,"[SERVER] IP passed!");
	}
	else
	{
	SendClientMessage(i,0x33AA33AA,"[SERVER] Ban!");
	// banip Kick(PlayerIp);
	//SendRconCommand("banip");
	RangeBan(playerid);
	} 
	}
	}
	}
	return 1;
}

stock PlayerIp(playerid)
{
	new ip[16];
	if(IsPlayerConnected(playerid)){
 	GetPlayerIp(playerid, ip, sizeof(ip));
	}
	return ip;
}
stock RangeBan(playerid)
{
  if(!IsPlayerConnected(playerid)) return 0;
  new total[16],ip[16],string[100];
  GetPlayerIp(playerid, ip, sizeof(ip));
  new cnt;
  for(new i=0;i<strlen(ip);i++)
  {
    if(ip[i] == '.') cnt++;
    if(cnt == 2)
    {
      i++;
      strdel(ip, i, strlen(ip));
      format(total,sizeof(total),"%s*.*",ip);
    }
  }
  format(string, sizeof(string),"banip %s",total);
  SendRconCommand(string);
  return 1;
}
stock PlayerName(playerid)
{
  new name[MAX_PLAYER_NAME];
	if(IsPlayerConnected(playerid)) GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	return name;
}
Reply
#2

please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)