Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- //------------------------------------------------------------------------------
- #define MAX_ADVERTISMENTS 3
- //------------------------------------------------------------------------------
- new Warnings;
- //------------------------------------------------------------------------------
- new InvalidWords[][100] =
- {
- "idiot",
- "stupid",
- "fuck",
- "ass",
- "lick",
- "suck",
- "dick",
- "pussy",
- "cum",
- "sperm",
- "gay"
- };
- //------------------------------------------------------------------------------
- public OnPlayerSpawn(playerid)
- {
- SetTimerEx("Check", 2000, false, "i", playerid);
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerText(playerid, text[])
- {
- new string[128];
- for(new cnt = 0; cnt < sizeof(InvalidWords); cnt++)
- {
- if(strfind(text, InvalidWords[cnt], true) != -1)
- {
- Warnings++;
- format(string, sizeof(string), "{FF0000}[WARNING]: {FFFFFF}Invalid Word has been detected. {FF0000}WARNINGS: {15FF00}[%d/%d]", Warnings, MAX_ADVERTISMENTS);
- SendClientMessage(playerid, -1, string);
- return 0;
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- forward Check(playerid);
- //------------------------------------------------------------------------------
- public Check(playerid)
- {
- new string[128], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(Warnings == MAX_ADVERTISMENTS)
- {
- format(string, sizeof(string), "{FF0000}[INFO]: {FFFFFF}Player {FF0000}%s {FFFFFF}has been kicked for using {FF0000}Invalid Words.", name);
- SendClientMessageToAll(-1, string);
- Kick(playerid);
- }
- return 1;
- }
- //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement