Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- GameZTotaL - FilterScript.
- Script AntiFloodChat número 3.
- Las características son las siguientes:
- 1) Al enviar un mensaje repetida mente (lo mismo) el servidor
- te advertirá que no lo hagas.
- No habrá mas versiones de este script.
- Para mayor información del script visite la Web oficial www.gameztotal.com.
- */
- /*||-----------------||Archivos incluidos||-----------------||*/
- #include <a_samp>
- /*||-----------------||Variables jugadores||-----------------||*/
- new UltimoChat[MAX_PLAYERS][60]; //Contenedora del último mensaje
- new PenultimoChat[MAX_PLAYERS][60]; //Contenedora del penúltimo mensaje
- new AntepenultimoChat[MAX_PLAYERS][60]; //Contenedora del antepenúltimo mensaje
- public OnPlayerConnect(playerid)
- {
- //Esto varia las variables de los jugadores al entrar al servidor
- UltimoChat[playerid] = " ";
- PenultimoChat[playerid] = " ";
- AntepenultimoChat[playerid] = " ";
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(strcmp(UltimoChat[playerid], " ", true) == 0)
- {
- //Esto ocurrirá si todavía no se escribe en la primera variable
- //Esto hace que la variable que contiene el último chat escrito, sea la que escribio
- strcat(UltimoChat[playerid], text);
- }
- else
- {
- //Esto ocurrirá si la variable contenedora del último chat escrito contiene información
- new final[200];
- format(final, sizeof(final), "%s", text);
- strcat(UltimoChat[playerid], final, sizeof(final));
- }
- if(strcmp(PenultimoChat[playerid], " ", true) == 0)
- {
- //Esto ocurrirá si todavía no se escribe en la segunda variable
- //Esto hace que la variable que contiene el penúltimo chat, sea lo que escribio penultimamente
- strcat(PenultimoChat[playerid], UltimoChat[playerid]);
- }
- else
- {
- //Esto ocurrirá si la variable contenedora del penúltimo chat contiene información
- new final[200];
- format(final, sizeof(final), "%s", UltimoChat[playerid]);
- strcat(PenultimoChat[playerid], final, sizeof(final));
- }
- if(strcmp(AntepenultimoChat[playerid], " ", true) == 0)
- {
- //Esto ocurrirá si todavía no se escribe en la tercera variable
- //Esto hace que la variable que contiene el antepenúltimo chat, sea lo que escribio antepenultimamente
- strcat(AntepenultimoChat[playerid], PenultimoChat[playerid]);
- }
- else
- {
- //Esto ocurrirá si la variable contenedora del antepenúltimo chat contiene información
- new final[200];
- format(final, sizeof(final), "%s", PenultimoChat[playerid]);
- strcat(AntepenultimoChat[playerid], final, sizeof(final));
- }
- if(strcmp(text, UltimoChat[playerid], true) == 0)
- {
- //Esto ocurrirá si el texto escrito es igual al anterior
- SendClientMessageError(playerid, "no hagas flood");
- return 0;
- }
- else if(strcmp(text, PenultimoChat[playerid], true) == 0)
- {
- //Esto ocurrirá si el texto escrito es igual al penúltimo escrito
- SendClientMessageError(playerid, "no hagas flood");
- return 0;
- }
- else if(strcmp(text, AntepenultimoChat[playerid], true) == 0)
- {
- //Esto ocurrirá si el texto escrito es igual al antepenúltimo escrito
- SendClientMessageError(playerid, "no hagas flood");
- return 0;
- }
- return 1;
- }
- stock SendClientMessageError(jugadorid, const cadena[])
- {
- new contenedor[500];
- format(contenedor, sizeof(contenedor), ">> Error: {FFFFFF}%s.", cadena);
- SendClientMessage(jugadorid, 0x960000FF, contenedor);
- }
Advertisement
Add Comment
Please, Sign In to add comment