SA-MP Forums Archive
Anti 2-2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti 2-2 (/showthread.php?tid=605200)



Anti 2-2 - Ilai14 - 15.04.2016

How to anti 2-2 ??


Re: Anti 2-2 - ProRakNet - 15.04.2016

https://sampforum.blast.hk/showthread.php?tid=373875


Re: Anti 2-2 - Ilai14 - 15.04.2016

Quote:
Originally Posted by ProRakNet
Посмотреть сообщение
I dont understand from this


Re: Anti 2-2 - Darkwood17 - 15.04.2016

The topic he gave you is about sawn-off glitch.

In the same topic you can find this code:
Код:
public OnPlayerUpdate(playerid) 
{
	static wepState ;
	wepState = GetPlayerWeaponState (playerid);
	if( WEAPONSTATE_LAST_BULLET  == wepState || wepState   == WEAPONSTATE_MORE_BULLETS || WEAPONSTATE_RELOADING  ==   wepState) {
		return true;
	}
	static wepId ;
	wepId = GetPlayerWeapon(playerid);
	if ( wepId  != SAWN_ OFFID ) {
		SetPVarInt( playerid, "lastWeapon", wepId );
		SetPVarInt( playerid, "lastTimewep", gettime() );
		return true;
	}
	else {
		if ( gettime() - GetPVarInt(playerid,"sawnoffPega") < 10 && gettime () - GetPVarInt( playerid, "lastTimewep") < 2 && GetPVarInt( playerid, "lastWeapon" ) !=  SAWN_ OFFID ) {
			SetPVarInt( playerid, "lastWeapon", SAWN_ OFFID);
			SetPVarInt( playerid, "lastTimewep", 0);
			return true;
		}
		SetPVarInt( playerid, "sawnoffPega", gettime());
	}
	return true ;
}