#include <a_samp> public OnGameModeInit() { //Debug Mode if(DetectarSpam("190.218.8.452:7777")) print("Esta haciendo spam"); return 1; } public OnPlayerText(playerid, text[]) { //Debug Mode if(DetectarSpam(text)) { SendClientMessage(playerid,0xFFFFFFFF,"VZ-RP: El spam no esta permitido en este servidor"); return 0; } return 1; } stock DetectarSpam(SPAM[]) { new SSPAM; new CUENTAP,CUENTAN,CUENTAW,CUENTADP,CUENTAGB; for(SSPAM = 0; SSPAM < strlen(SPAM); SSPAM ++) { if(SPAM[SSPAM] == '.') CUENTAP ++; //Cuenta los Puntos if(SPAM[SSPAM] == '0' || SPAM[SSPAM] == '1' || SPAM[SSPAM] == '2' || SPAM[SSPAM] == '3' || SPAM[SSPAM] == '4' || SPAM[SSPAM] == '5' || SPAM[SSPAM] == '6' || SPAM[SSPAM] == '7' || SPAM[SSPAM] == '8' || SPAM[SSPAM] == '9') CUENTAN ++; //Cuenta los Numeros if(SPAM[SSPAM] == 'w' || SPAM[SSPAM] == 'W') CUENTAW ++; //Cuenta las "W" if(SPAM[SSPAM] == ':') CUENTADP ++; //Cuenta los ":" if(SPAM[SSPAM] == '_') CUENTAGB ++; //Cuenta los "_" } if(CUENTAP >= 3 && CUENTAN >= 4) return 1; if(CUENTAW >= 3) return 1; if(CUENTAN >= 3) return 1; if(CUENTAGB >= 2 && CUENTAN >= 3) return 1; if(strfind(SPAM, ".com", true) != -1 || strfind(SPAM, ".com.ar", true) != -1 || strfind(SPAM, ".org", true) != -1 || strfind(SPAM, ".net", true) != -1 || strfind(SPAM, ".es", true) != -1 || strfind(SPAM, ".tk", true) != -1) return 1; if(CUENTADP >= 1 && CUENTAN >= 4) return 1; return 0; } |
forward MensajeAdmins(color,const string[],nivel);
public MensajeAdmins(color,const string[],nivel)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= nivel) // Variable de admin tuya
{
SendClientMessage(i, color, string);
printf("%s", string);
}
}
}
return 1;
}
forward MensajeAdminsRCON(color,const string[],nivel);
public MensajeAdminsRCON(color,const string[],nivel)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, color, string);
printf("%s", string);
}
}
}
return 1;
}
forward MensajeAdmins(color,const string[],nivel); // Definis el callback; color, texto y nivel.
public MensajeAdmins(color,const string[],nivel) // Chequeas el callback.
{
for(new i = 0; i < MAX_PLAYERS; i++) // Bucle: Chequea a todos los jugadores.
{
if(IsPlayerConnected(i)) // Chequea si estan todos conectados.
{
if(PlayerInfo[i][pAdmin] >= nivel) // Variable de admin tuya
{
SendClientMessage(i, color, string); // Manda mensaje.
printf("%s", string); // Manda mensaje a la consola.
}
}
}
return 1;
}
forward MensajeAdminsRCON(color,const string[],nivel); // Definis el callback; color, texto y nivel.
public MensajeAdminsRCON(color,const string[],nivel) // Chequeas el callback.
{
for(new i = 0; i < MAX_PLAYERS; i++) // Bucle: Chequea a todos los jugadores.
{
if(IsPlayerConnected(i)) // Chequea si estan todos conectados.
{
if(IsPlayerAdmin(i)) // Si estas logueado como Admin RCON manda lo de abajo.
{
SendClientMessage(i, color, string); // Manda mensaje a admins RCON logueados.
printf("%s", string); // Manda mensaje a la consola.
}
}
}
return 1;
}