Anticheat is spamming
#1

Hello, i have this weapons anticheat, it works good but there is a problem..is spamming 10-15 messages every minute.

This is the full code:

pawn Код:
new AcMessageTimer[MAX_PLAYERS], AcMsg[150];
forward AcMessage(playerid);

public AcMessage(playerid)
{
    new weap2=GetPlayerWeapon(playerid);
    new WeaponName2[65];
    GetWeaponName(weap2,WeaponName2,64);
    format(AcMsg,sizeof(AcMsg),"ACMsg: System has detected possible weapon hack of %s at %s(%d).",WeaponName2,PlayerName(playerid),playerid);
    SendClientMessageToAdmin(1,-1,RED,AcMsg);
    format(AcMsg,sizeof(AcMsg), "8,1%s",AcMsg);
    IRC_GroupSay(gGroupID, IRC_ADMIN_CHANNEL,AcMsg);
    IRC_GroupSay(gGroupID, IRC_MANAGEMENT_CHANNEL,AcMsg);
    return 1;
}

        //this is included in the AC public
    if(!AllowedWeapon[playerid][GetPlayerWeapon(playerid)] && IsValidWeapon(weap2) && GetPlayerWeapon(playerid) != 46 && (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && Info[playerid][AdminLevel] == 0))
    {
            AcMessageTimer[playerid] = SetTimerEx("AcMessage",1000,false,"d",playerid);

    }
And this is what i mean for spam:

Quote:

[21:21] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:21] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of at MrSnowony(7).
[21:22] <&MG4> ACMsg: System has detected possible weapon hack of Chainsaw at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of Chainsaw at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG3> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG1> ACMsg: System has detected possible weapon hack of Desert Eagle at MrSnowony(7).
[21:22] <&MG2> ACMsg: System has detected possible weapon hack of at MrSnowony(7).

Reply
#2

I hope you have
pawn Код:
KillTimer(AcMessageTimer[playerid]);
under OnPlayerDisconnect

EDIT: and it would be better if you would do:

pawn Код:
public AntiCheat(playerid)
{
        if(!AllowedWeapon[playerid][GetPlayerWeapon(playerid)] && IsValidWeapon(weap2) && GetPlayerWeapon(playerid) != 46 && (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && Info[playerid][AdminLevel] == 0))
        {
                new weap2=GetPlayerWeapon(playerid);
                new WeaponName2[65];
                GetWeaponName(weap2,WeaponName2,64);
                format(AcMsg,sizeof(AcMsg),"ACMsg: System has detected possible weapon hack of %s at %s(%d).",WeaponName2,PlayerName(playerid),playerid);
                SendClientMessageToAdmin(1,-1,RED,AcMsg);
                format(AcMsg,sizeof(AcMsg), "8,1%s",AcMsg);
                IRC_GroupSay(gGroupID, IRC_ADMIN_CHANNEL,AcMsg);
                IRC_GroupSay(gGroupID, IRC_MANAGEMENT_CHANNEL,AcMsg);
        }
        return 1;
}
Reply
#3

Show us your SendClientMessageToAdmin stock or public, your loop might be the problem
Reply
#4

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
I hope you have
pawn Код:
KillTimer(AcMessageTimer[playerid]);
under OnPlayerDisconnect
That timer is for delaying the ac message (for some reason)

You probably create a repeating timer somewhere (I guess OnPlayerSpawn) but never kill it in OnPlayerDeath (or maybe just in OnPlayerDisconnect)
(just a guess, we can't see this)

edit: "10-15 messages every minute" what delay does the ac timer have?
Reply
#5

Quote:
Originally Posted by yugecin
Посмотреть сообщение
That timer is for delaying the ac message (for some reason)

You probably create a repeating timer somewhere (I guess OnPlayerSpawn) but never kill it in OnPlayerDeath (or maybe just in OnPlayerDisconnect)
(just a guess, we can't see this)
There are no different timers in the callbacks you said.

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Show us your SendClientMessageToAdmin stock or public, your loop might be the problem
pawn Код:
SendClientMessageToAdmin(adminlvl, exception, colour, message[])
    {
            foreach(new i : Player)
        {
            if(Info[i][AdminLevel] >= adminlvl && i != exception && Info[i][Security])
            {
                SendClientMessage(i, colour, message);
            }
            }
    }
Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
I hope you have
pawn Код:
KillTimer(AcMessageTimer[playerid]);
under OnPlayerDisconnect
There is no need to kill the timer since is just repeated one time.
Reply
#6

pawn Код:
SendClientMessageToAdmin(adminlvl, exception, colour, message[])
{
    foreach(Player, i)
    {
        if(Info[i][AdminLevel] >= adminlvl && i != exception && Info[i][Security]) SendClientMessage(i, colour, message);
    }
}
I don't get what's the exception for but oh-well, try the code I gave, also make sure you're using the latest version of foreach
Reply
#7

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
pawn Код:
SendClientMessageToAdmin(adminlvl, exception, colour, message[])
{
    foreach(Player, i)
    {
        if(Info[i][AdminLevel] >= adminlvl && i != exception && Info[i][Security]) SendClientMessage(i, colour, message);
    }
}
I don't get what's the exception for but oh-well, try the code I gave, also make sure you're using the latest version of foreach
We have a double admin login called security, thats what is used for.
Reply
#8

We fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)