Anti-Cheat banning random players when connection (sometimes)
#1

A friend made anti-cheat a while ago. I removed it because it was banning random players at connecting. Now I re-created it by myself with help (looking at other anti-cheat systems). And again the same problem, banning some players at connection. Yes, it is working > banning hackers with minigun/heat seaker.

pawn Код:
//********************************************Urban Fighters Anti-Cheat********************************************
public weaponCheck(playerid)
{
    new wep = GetPlayerWeapon(playerid);
    new reason[64], output[128];
   
    if(wep == 36 || wep == 38)
    {
        switch(wep)
        {
            case 36: format(reason, sizeof(reason), "Heat Seaker");
            case 38: format(reason, sizeof(reason), "Minigun");
        }
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
       
        format(output, sizeof(output), "[UFA-C] %s was caught using forbidden weapon [%s] and was banned.", pName, reason);
        SendClientMessageToAll(COLOR_UFAC, output);
       
        format(output, sizeof(output), "[UFA-C] You were caught using forbidden weapon [%s] and you have been banned.", reason);
        SendClientMessage(playerid, COLOR_UFAC, output);

        TogglePlayerControllable(playerid, false);
        Ban(playerid);

    }
    return 1;
}
Can someone tell me what's wrong?
Reply
#2

Activate the anticheat for player 10 seconds after he connects
Reply
#3

Then these 'random people' are hacking.
Reply
#4

Quote:
Originally Posted by dice7
Посмотреть сообщение
Activate the anticheat for player 10 seconds after he connects
Why would that work? :\ Btw, how?

Quote:
Originally Posted by WackoX
Посмотреть сообщение
Then these 'random people' are hacking.
No... It's like:

''[UF]DarkPhoenix has joined the server."
''[UFA-C] [UF]DarkPhoenix was caught using forbidden weapon [MINIGUN] and was banned."
''[UF]DarkPhoenix has left the server. (Leaving)''
Reply
#5

Since you claim that they get banned on connection, then they wont since 10 seconds would have passed since they connected. And use a timer

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#6

Quote:
Originally Posted by dice7
Посмотреть сообщение
Since you claim that they get banned on connection, then they wont since 10 seconds would have passed since they connected. And use a timer

https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
Check this out;
pawn Код:
public OnPlayerConnect(playerid)
{
    checkpointTimer[playerid] = SetTimerEx("rangeCheck", 1000, 1, "i", playerid);
    SetPlayerColor(playerid, COLOR_LIGHTGREY);
   
    weaponTimer[playerid] = SetTimerEx("weaponCheck", 1000, 1, "i", playerid);
I bet same is going to happen when I move it to OnPlayerSpawn or something...
Reply
#7

Well first of all, There's a bug with SA-MP an sometimes it believes somebody has a minigun or such while on player class or specing, My best bet would be if you got a player class to not allow to run until the player is out of the class, Or if you got a login system wait till after they login and have spawned, Pretty much wait till they spawn.
Reply
#8

Quote:
Originally Posted by Andy_McKinley
Посмотреть сообщение
pawn Код:
weaponTimer[playerid] = SetTimerEx("weaponCheck", 1000, 1, "i", playerid);
Wouldn't that create a new timer each time a player enters the server though?
Reply
#9

Quote:
Originally Posted by Burridge
Посмотреть сообщение
Wouldn't that create a new timer each time a player enters the server though?
Yep.

I'd suggest doing a PVar when he spawns.
Reply
#10

What's the best option?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)