SA-MP Forums Archive
Which one is better for an anti weapon cheat? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Which one is better for an anti weapon cheat? (/showthread.php?tid=189235)



Which one is better for an anti weapon cheat? - OrlGiNS - 10.11.2010

Well I've been using an Anti cheat with GetPlayerWeaponData, and today I found a cheater in the server bypassing it..

Is GetPlayerWeapon better? :S

Btw, this the script being used with the GetPlayerWeaponData

SetTimer("AntiCheat", 100, true);//Ongamemodeinit


Code:
public Anti_Cheat()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
	{
            if(accInfo[i][adminPower] == 0) //Means that if the player isn't an admin he goes Ban_yo
            {
                new weapon;
                new ammo;
                new string[128];
                GetPlayerWeaponData(i, 7, weapon, ammo);
		if(weapon == 38 && ammo >= 1)
	        {
		    SendClientMessage(i, RED, "[CHEAT]:Banned user for Minigun!");
	            format(string, sizeof(string), "[CHEAT]: %s [ID:%d] got banned for using minigun.", GetName(i), i);
	            SendClientMessageToAll(0xB90000AA, string);
		    BanEx(i,"CHEAT - Minigun");
	        }
            }
         }
     }
     return 1;
}



Re: Which one is better for an anti weapon cheat? - rs.pect - 10.11.2010

Use GetPlayerWeaponData if you want to ban players that generally have disallowed weapon.
Use GetPlayerWeapon to ban players that currently have equiped disallowed weapon.


Re: Which one is better for an anti weapon cheat? - OrlGiNS - 10.11.2010

Uhhh I'm still a bit confused, since I use GetPlayerWeaponData I never had problems until today...
Minigun was not allowed and still a cheater was able to use it without getting ban.. He bypassed it, so I was wondering if GetPlayerWeapon would solve the problem.


Re: Which one is better for an anti weapon cheat? - Memoryz - 11.11.2010

GetPlayerWeapon will only work for the weapon the player has equipped.


Re: Which one is better for an anti weapon cheat? - (SF)Noobanatior - 11.11.2010

did you see him fire it or did he spoof kill someone with it?


Re: Which one is better for an anti weapon cheat? - cessil - 11.11.2010

I've seen a lot of cheaters with - ammo, just check that he's alive, onfoot, spawned and has the weapon, don't worry about the ammo amount.


Re: Which one is better for an anti weapon cheat? - OrlGiNS - 11.11.2010

Quote:
Originally Posted by (SF)Noobanatior
View Post
did you see him fire it or did he spoof kill someone with it?
He was just walking with the gun on its hands, and he shouldn't be able to do that.

Quote:
Originally Posted by cessil
View Post
I've seen a lot of cheaters with - ammo, just check that he's alive, onfoot, spawned and has the weapon, don't worry about the ammo amount.
That might result, I will try that thanks.