Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- new SwearWarn[MAX_PLAYERS];
- new SwearKick[MAX_PLAYERS];
- new str[128], string[128];
- public OnPlayerConnect(playerid)
- {
- SwearWarn[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SwearWarn[playerid] = 0;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(SwearWarn[playerid] == 5)
- {
- format(string, 128, "[Swear Bot]: You have been kicked for swearing!");
- KickWithMessage(playerid, string);
- SwearKick[playerid] ++;
- return 0;
- }
- if(SwearKick[playerid] == 5)
- {
- Ban(playerid);
- return 0;
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(strfind(text, "fuck", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "nigga", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "hoe", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "bitch", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "shit", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "dick", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "cock", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- if(strfind(text, "twat", true))
- {
- format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
- SendClientMessage(playerid, -1, str);
- SwearWarn[playerid] ++;
- return 0;
- }
- return 1;
- }
- forward KickPublic(playerid);
- public KickPublic(playerid) { Kick(playerid); }
- stock KickWithMessage(playerid, message[])
- {
- SendClientMessage(playerid, 0xFF4444FF, message);
- SetTimerEx("KickPublic", 1000, 0, "d", playerid);
- }
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- return Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement