SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Thread Tools Display Modes
Old 23/08/2016, 12:27 AM   #61
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,412
Reputation: 442
Default Re: Southclaw's & Pottus's Anti-cheat patches

The Lag Troll (don't quote me on this) CLEO still works on 0.3.7, the protection for it should still be valid.
Abagail is online now   Reply With Quote
Old 14/01/2017, 08:48 PM   #62
PT's Avatar
Join Date: Nov 2012
Location: Portugal
Posts: 7,216
Reputation: 780
Default Re: Southclaw's & Pottus's Anti-cheat patches

Originally Posted by Pottus View Post
If I see this happening on my server I will surely make a patch but it has not yet so there isn't much I want to do yet until I can confirm it myself.

@Edit 5 minute patch, make sure this is included before anything else is included in your gamemode that way this patch is first in the chain of hooks and will prevent OnPlayerConnect() from actually being processed!

pawn Code:
#include <YSI\y_iterate>

static Iterator:ConnectIter<MAX_PLAYERS>;
static LoginNames[MAX_PLAYERS][MAX_PLAYER_NAME+1];
static bool:ProcessDisconnect[MAX_PLAYERS] = { true, ...};

public OnPlayerConnect(playerid)
    if(Iter_Contains(ConnectIter, playerid))
        // Player was already connected! (Kick, ban, etc)
        return 1;
        Iter_Add(ConnectIter, playerid);
        GetPlayerName(playerid, LoginNames[playerid], MAX_PLAYER_NAME+1);
        foreach(new i : ConnectIter)
            if(i == playerid) continue;
            if(!strcmp(LoginNames[playerid], LoginNames[i]))
                // Player name was already connected! (Kick, ban, etc)
                // No need to do any disconnect code since no connection code was done
                ProcessDisconnect[playerid] = false;
                return 1;
    if (funcidx("AntiDL_OnPlayerConnect") != -1) return CallLocalFunction("AntiDL_OnPlayerConnect", "i", playerid);
    return 1;

#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
    #define _ALS_OnPlayerConnect
#define OnPlayerConnect AntiDL_OnPlayerConnect

forward AntiDL_OnPlayerConnect(playerid);

// Remove any iterators
public OnPlayerDisconnect(playerid, reason)
    Iter_Remove(ConnectIter, playerid);
    if (funcidx("AntiDL_OnPlayerDisconnect") != -1 && ProcessDisconnect[playerid] == true) return CallLocalFunction("AntiDL_OnPlayerDisconnect", "ii", playerid, reason);
    ProcessDisconnect[playerid] = true;
    return 1;

#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
    #define _ALS_OnPlayerDisconnect
#define OnPlayerDisconnect AntiDL_OnPlayerDisconnect

forward AntiDL_OnPlayerDisconnect(playerid, reason);

For the guys are using Foreach
"Quem caiu e se levantou honrado era e honrado ficou..."

CVU vai voltar e.e
PT is offline   Reply With Quote
Old 27/12/2017, 05:51 PM   #63
[HLF]Southclaw's Avatar
Join Date: Apr 2009
Location: England
Posts: 5,017
Reputation: 1581
Default Re: Southclaw's & Pottus's Anti-cheat patches

Note: these patches have been moved to a GitHub organisation:

If anyone wants to continue maintaining the code and adding more patches, please let me know and I can add you as a contributor.



[HLF]Southclaw is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [K.A.S] Knight's Anti Cheat (Anti: Armas, Spam, DB, MaxPing, Palavrões, Money Hack) The Knight Lançamentos/Releases 5 05/05/2011 04:41 AM

All times are GMT. The time now is 02:31 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.