SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/08/2016, 11:27 PM   #61
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,524
Reputation: 437
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 offline   Reply With Quote
Old 14/01/2017, 07:48 PM   #62
PT
Godfather
 
PT's Avatar
 
Join Date: Nov 2012
Location: Portugal
Posts: 7,178
Reputation: 775
Default Re: Southclaw's & Pottus's Anti-cheat patches

Quote:
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!

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;
	}
	else
	{
		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
#else
	#define _ALS_OnPlayerConnect
#endif
#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
#else
	#define _ALS_OnPlayerDisconnect
#endif
#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..."


http://steamcommunity.com/id/pt_player/
PT is offline   Reply With Quote
Old 27/12/2017, 04:51 PM   #63
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,868
Reputation: 1443
Default Re: Southclaw's & Pottus's Anti-cheat patches

Note: these patches have been moved to a GitHub organisation: https://github.com/samp-anti-cheat

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

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Reply

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] [Anti-Cheat]HP,Money Cheat and Armour Cheat Meow22 Filterscripts 23 03/03/2014 02:38 PM
[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 03:41 AM


All times are GMT. The time now is 03:46 AM.


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