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