Jump to content
  • Global

    Global

    Chatroom Rules

    • NO SE DA SOPORTE EN CHATBOX
    • NO SPAM
    • NO FLOOD

Recommended Posts

  • Usuario
Posted (edited)

Bueno les presento un anti-ip básico para evitar a los "SPAMMERS" en su sv

1* nos vamos a la public OnPlayerText y añadimos debajo de los NEW de al principio:

if(IPdetectada(text))
{
   newstring[128];
   GetPlayerName(playerid, string, 20);
   format(string, sizeof(string), "[AntiIP]%s Ha sido baneado por SPAM DE IP! /*[ANDA A LAVARTE LA CONCHA CON CACA]*/",string);
   SendClientMessageToAll(0xFFFFFFFF, string);
//para los rp: PlayerInfo[giveplayerid][pLevel] = -999;   
   return Ban(playerid), false;
}

2* Luego de esto nos dirigimos a los stock y debajo de cualquiera ponemos:

stock IPdetectada(text[])
{
   new
       dotCount
   ;
   for(new i; i < strlen(text); ++i)
   {
       if('0' <= text[i] <= '9')
       {
           do
           {
               if(text[i] == '.') ++dotCount;
               ++i;
           }
           while(('0' <= text[i] <= '9') || text[i] == '.' || text[i] == ':');
       }
   }
   if(dotCount >= 3) return true;
   return false;
}

3* Después de esto vamos a los canales como el RP como /b o en el caso de GTAchile /pm o /yo y añadimos debajo del if mas pronto:

if(IPdetectada(cmdtext))
		{
   		new string[256];
   		GetPlayerName(playerid, string, 20);
   		format(string, sizeof(string), "[AntiIP]%s Ha sido baneado por SPAM DE IP! /*[ANDA A LAVARTE LA CONCHA CON CACA]*/", string);
   		SendClientMessageToAll(0xff0000ff, string);
   		//funcion para rp autban: PlayerInfo[giveplayerid][pLevel] = -999;
	Ban(giveplayerid);
   		return 1;
	}

Es IMPORTANTE que pongan en la ultima de los canales: if(IPdetectada(cmdtext)) PARA EVITAR ERRORES ya que seria como un cmd con result

CUALQUIER BUG Y/O SUGERENCIA INFORMAR POR ESTE POST

Edited by 0wN3D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...