Guest User

Untitled

a guest
Dec 13th, 2011
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.45 KB | None | 0 0
  1. /*
  2.     GameZTotaL - FilterScript.
  3.     Script AntiFloodChat número 3.
  4.     Las características son las siguientes:
  5.         1) Al enviar un mensaje repetida mente (lo mismo) el servidor
  6.             te advertirá que no lo hagas.
  7.     No habrá mas versiones de este script.
  8.     Para mayor información del script visite la Web oficial www.gameztotal.com.
  9. */
  10.  
  11. /*||-----------------||Archivos incluidos||-----------------||*/
  12. #include <a_samp>
  13.  
  14. /*||-----------------||Variables jugadores||-----------------||*/
  15. new UltimoChat[MAX_PLAYERS][60]; //Contenedora del último mensaje
  16. new PenultimoChat[MAX_PLAYERS][60]; //Contenedora del penúltimo mensaje
  17. new AntepenultimoChat[MAX_PLAYERS][60]; //Contenedora del antepenúltimo mensaje
  18.  
  19. public OnPlayerConnect(playerid)
  20. {
  21.     //Esto varia las variables de los jugadores al entrar al servidor
  22.     UltimoChat[playerid] = " ";
  23.     PenultimoChat[playerid] = " ";
  24.     AntepenultimoChat[playerid] = " ";
  25.    
  26.     return 1;
  27. }
  28.  
  29. public OnPlayerText(playerid, text[])
  30. {
  31.     if(strcmp(UltimoChat[playerid], " ", true) == 0)
  32.     {
  33.         //Esto ocurrirá si todavía no se escribe en la primera variable
  34.  
  35.         //Esto hace que la variable que contiene el último chat escrito, sea la que escribio
  36.         strcat(UltimoChat[playerid], text);
  37.     }
  38.     else
  39.     {
  40.         //Esto ocurrirá si la variable contenedora del último chat escrito contiene información
  41.         new final[200];
  42.         format(final, sizeof(final), "%s", text);
  43.         strcat(UltimoChat[playerid], final, sizeof(final));
  44.     }
  45.    
  46.     if(strcmp(PenultimoChat[playerid], " ", true) == 0)
  47.     {
  48.         //Esto ocurrirá si todavía no se escribe en la segunda variable
  49.        
  50.         //Esto hace que la variable que contiene el penúltimo chat, sea lo que escribio penultimamente
  51.         strcat(PenultimoChat[playerid], UltimoChat[playerid]);
  52.     }
  53.     else
  54.     {
  55.         //Esto ocurrirá si la variable contenedora del penúltimo chat contiene información
  56.         new final[200];
  57.         format(final, sizeof(final), "%s", UltimoChat[playerid]);
  58.         strcat(PenultimoChat[playerid], final, sizeof(final));
  59.     }
  60.    
  61.     if(strcmp(AntepenultimoChat[playerid], " ", true) == 0)
  62.     {
  63.         //Esto ocurrirá si todavía no se escribe en la tercera variable
  64.  
  65.         //Esto hace que la variable que contiene el antepenúltimo chat, sea lo que escribio antepenultimamente
  66.         strcat(AntepenultimoChat[playerid], PenultimoChat[playerid]);
  67.     }
  68.     else
  69.     {
  70.         //Esto ocurrirá si la variable contenedora del antepenúltimo chat contiene información
  71.         new final[200];
  72.         format(final, sizeof(final), "%s", PenultimoChat[playerid]);
  73.         strcat(AntepenultimoChat[playerid], final, sizeof(final));
  74.     }
  75.    
  76.     if(strcmp(text, UltimoChat[playerid], true) == 0)
  77.     {
  78.         //Esto ocurrirá si el texto escrito es igual al anterior
  79.        
  80.         SendClientMessageError(playerid, "no hagas flood");
  81.         return 0;
  82.     }
  83.     else if(strcmp(text, PenultimoChat[playerid], true) == 0)
  84.     {
  85.         //Esto ocurrirá si el texto escrito es igual al penúltimo escrito
  86.        
  87.         SendClientMessageError(playerid, "no hagas flood");
  88.         return 0;
  89.     }
  90.     else if(strcmp(text, AntepenultimoChat[playerid], true) == 0)
  91.     {
  92.         //Esto ocurrirá si el texto escrito es igual al antepenúltimo escrito
  93.        
  94.         SendClientMessageError(playerid, "no hagas flood");
  95.         return 0;
  96.     }
  97.    
  98.     return 1;
  99. }
  100.  
  101. stock SendClientMessageError(jugadorid, const cadena[])
  102. {
  103.     new contenedor[500];
  104.     format(contenedor, sizeof(contenedor), ">> Error: {FFFFFF}%s.", cadena);
  105.     SendClientMessage(jugadorid, 0x960000FF, contenedor);
  106. }
  107.  
Advertisement
Add Comment
Please, Sign In to add comment