Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- # ====================================== #
- # SA:MP Scripts for all sampers ! #
- # -------------------------------------- #
- # Credits to: 1Geek and SA-MP for include#
- # ====================================== #
- */
- #include <a_samp>
- forward ResetCount(playerid);
- #define SpamLimit (3000)
- public OnFilterScriptInit()
- {
- print("# ======================================== #");
- print("# 1Geek Antispam Loaded Enjoy Guys #");
- print("# ---------------------------------------- #");
- print("# Credits to: 1Geek and SA-MP for include #");
- print("# =========================================#");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("# ======================================== #");
- print("# 1Geek Antispam UnLoaded GoodBye #");
- print("# ---------------------------------------- #");
- print("# Credits to: 1Geek and SA-MP for include #");
- print("# =========================================#");
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new TCount, KMessage[128];
- TCount = GetPVarInt(playerid, "TextSpamCount");
- TCount++;
- SetPVarInt(playerid, "TextSpamCount", TCount);
- if(TCount == 2) {
- SendClientMessage(playerid, 0xFFFFFF, "[Anti-Spam]: Warning you are one message away from being kicked!");
- }
- else if(TCount == 3) {
- GetPlayerName(playerid, KMessage, sizeof(KMessage));
- format(KMessage, sizeof(KMessage), "[Anti-Spam]: %s has been kicked for chat spamming.", KMessage);
- SendClientMessageToAll(0xFFFFFF, KMessage);
- print(KMessage);
- Kick(playerid);
- }
- SetTimerEx("ResetCount", SpamLimit, false, "i", playerid);
- return 1;
- }
- public ResetCount(playerid)
- {
- SetPVarInt(playerid, "TextSpamCount", 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement