All pastes #629419 Raw Edit

Simple Weapon Hack Protection

public cpp v1 · immutable
·published 2007-07-22 08:26 UTC
rendered paste body
#include <a_samp>forward CheckWeapons();new NotAllowedWeapons[] ={	24,	38};public OnFilterScriptInit(){	print("Weapon Hack Detection.");	SetTimer("CheckWeapons", 1000, true);	return 1;}public CheckWeapons(){	for(new i, j = GetMaxPlayers(); i < j; i++)	{		if(IsPlayerConnected(i))		{		    new weapon = GetPlayerWeapon(i);			for(new k; k < sizeof(NotAllowedWeapons); k++)			{			    if(weapon == NotAllowedWeapons[k])			    {			        // Do something here.			        // I shall choose to ban them :).			        BanEx(k, "Weapon Cheats.");			    }			}		}	}}