03.02.2019, 15:13
ґ Anti-Spam "Simples", code ъteis..
Script-Download: https://ghostbin.com/paste/oax3r
Code:
public OnPlayerText(playerid, text[])
{
if(SPAM_PLAYERID(text))
{
printf("DEBUG: SPAM_PLAYERID(const VOLUE[]) chamada com sucesso!"); /* O debug mostrar se a Callback estб funcionando corretamente, e verifica se foi chamada na hora da divulgaзгo */
/* Aqui vocк pode acrescentar mensagem do tipo global, ou nгo global. Caso nгo queira por nenhuma mensagem, apenas ignore */
Kick(playerid); /* Funзгo que leva o player ser kikado do servidor, caso queira efetuar o banimento, utilize a callback do seu sistema, ou efetueo banimento por client-server "Ban(playerid); " */
return false; /* A funзгo Anti-SPAM retornara sempre falsa, e tambйm irб verificar a Callback SPAM_PLAYERID(const VOLUE[]) se foi chamada dentro dos params, mantenham o retorno sempre falso nesta opзгo */
}
retun false; /* Retorno falso para a Callback OnPlayerText e outros script, nгo й necessбrio alterar o mesmo */
}
Code:
SPAM_PLAYERID(const VOLUE[])
{
new
SPAM_DIGITS,
VOLUE_DIGITS
;
for(new PARAMS_DIGIT, PARAMS_DIGITS, PLAYERIP[16], LEN = strlen(VOLUE); PARAMS_DIGIT < LEN; PARAMS_DIGIT ++)
{
if('0' <= VOLUE[PARAMS_DIGIT] <= '9')
{
PARAMS_DIGITS = PARAMS_DIGIT + 1;
while('0' <= VOLUE[PARAMS_DIGITS] <= '9') PARAMS_DIGITS ++;
strmid(PLAYERIP, VOLUE, PARAMS_DIGIT, PARAMS_DIGITS);
if(0 <= strval(PLAYERIP) <= 255) SPAM_DIGITS ++; PARAMS_DIGIT = PARAMS_DIGITS - 1;
else if(SPAM_DIGITS >= 1) VOLUE_DIGITS ++; SPAM_DIGITS = 0;
}
}
if(SPAM_DIGITS >= 1) VOLUE_DIGITS ++;
if(VOLUE_DIGITS >= 4) return true;
return false;
}





