Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define COLOR_RED 0xFF0000AA
- #define ERSTERWARN 2
- #define ZWEITERWARN 3
- #define KICKW 4
- #define Timer 3
- new Spam[MAX_PLAYERS];
- new Nachricht[MAX_PLAYERS],msg1[156];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Anti Spam System ||| By KingClem");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("-------------------------------");
- print("Anti Spam System ||| By KingClem");
- print("-------------------------------\n");
- return 1;
- }
- public Timer1()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(Spam[i] > 0 )
- Spam[i]--;
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Spam[playerid] = 0;
- Nachricht[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new name[156],string[256];
- GetPlayerName(playerid,name,sizeof(name));
- if(Nachricht[playerid]==0)
- {
- Nachricht[playerid]++;
- format(msg1,sizeof(msg1),"%s",text);
- }else if(Nachricht[playerid] == 1)
- {
- if(strcmp(msg1,text,true) == 0){
- Nachricht[playerid]++;
- SendClientMessage(playerid,COLOR_RED,"Flooding Control - Noch einmal die Selbe Nachricht und du wirst gekickt.");
- }
- }else if(Nachricht[playerid] == 2)
- {
- if(strcmp(msg1,text,true) != 0) return Nachricht[playerid] = 0;
- format(string,sizeof(string),"Flooding Control - %s wurde gekickt.",name);
- SendClientMessageToAll(COLOR_RED,string);
- Kick(playerid);
- }
- Spam[playerid]++;
- if(Spam[playerid] == ERSTERWARN){
- SendClientMessage(playerid,COLOR_RED,"Flooding Control - Stop das spammen oder du wirst gekickt[Warnung 1/3]");
- }
- if(Spam[playerid] == ZWEITERWARN){
- SendClientMessage(playerid,COLOR_RED,"Flooding Control - Stop das spammen oder du wirst gekickt[Warnung 2/3]");
- }
- if(Spam[playerid]== KICKW){
- format(string,sizeof(string),"Flooding Control - %s wurde gekickt.",name);
- SendClientMessageToAll(COLOR_RED,string);
- Kick(playerid);
- }
- SetTimer("Timer1", Timer*1000, 0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement