KIcking x becuse they didnt load logon to the game
#8

Use an antispam FS, like this one. The player gets kicked from server if spams 3 times
PHP код:
/*
# ========================= #
#  SA-MP Simple Anti-Spam   #
# ------------------------- #
# @Authour(s): ChristopherM #
# ========================= #
*/
#include <a_samp>
forward ResetCount(playerid);
forward ResetCommandCount(playerid);
#define SpamLimit (3000)
public OnFilterScriptInit()
{
    
printf("[*] ChristopherM's Anti-Spam Loaded. Limit: %d"SpamLimit);
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"[*] ChristopherM's Anti-Spam Unloaded.");
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    new 
TCountKMessage[128];
    
    
TCount GetPVarInt(playerid"TextSpamCount");
    
    
TCount++;
    
    
SetPVarInt(playerid"TextSpamCount"TCount);
    
    if(
TCount == 2) {
        
SendClientMessage(playerid0xFFFFFF"[Anti-Spam]: Warning you are one message away from being kicked!");
    }
    else if(
TCount == 3) {
        
GetPlayerName(playeridKMessagesizeof(KMessage));
        
format(KMessagesizeof(KMessage), "[Anti-Spam]: %s has been kicked for chat spamming."KMessage);
        
SendClientMessageToAll(0xFFFFFFKMessage);
        print(
KMessage);
        
Kick(playerid);
    }
    
SetTimerEx("ResetCount"SpamLimitfalse"i"playerid);
    
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
TCountKMessage[128];
    
    
TCount GetPVarInt(playerid"CommandSpamCount");
    
    
TCount++;
    
    
SetPVarInt(playerid"CommandSpamCount"TCount);
    
    if(
TCount == 2) {
        
SendClientMessage(playerid0xFFFFFF"[Anti-Spam]: Warning you are one command away from being kicked!");
    }
    else if(
TCount == 3) {
        
GetPlayerName(playeridKMessagesizeof(KMessage));
        
format(KMessagesizeof(KMessage), "[Anti-Spam]: %s has been kicked for command spamming."KMessage);
        
SendClientMessageToAll(0xFFFFFFKMessage);
        print(
KMessage);
        
Kick(playerid);
    }
    
SetTimerEx("ResetCommandCount"SpamLimitfalse"i"playerid);
}
public 
ResetCount(playerid)
{
    
SetPVarInt(playerid"TextSpamCount"0);
}
public 
ResetCommandCount(playerid)
{
    
SetPVarInt(playerid"CommandSpamCount"0);

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)