SA-MP Forums Archive
Anticheat Problem - 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: Anticheat Problem (/showthread.php?tid=420103)



Anticheat Problem - Blackazur - 03.03.2013

Hello, i have a Problem with my Anticheat System it ban to Users which have VIP-Weapons, here the code:

Код:
			 if(pInfo[i][pVipLevel] >= 4)
			{
    		if(team[i] == TEAM_HUMAN)
			{
				SetPlayerArmour(i,95.0);
				GivePlayerWeapon(i,28,700);
				GivePlayerWeapon(i,26,100);
				GivePlayerWeapon(i,18,20);
				GivePlayerWeapon(i,34,500);
				GivePlayerWeapon(i,41,3000);
			}

		}
to give VIP Players Weapons.

Anticheat:

Код:
		if(PRESSED(KEY_FIRE))
	{
	    switch(GetPlayerWeapon(playerid))
	    {
	        case 2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,26,27,28,32,35,36,37,38,39,40,41,42,43,44,45,46:
	        {
	            new reason[128];
	            new Admin[24] = "Katie";
				format(reason,sizeof(reason),"Weapon hack %i",GetPlayerWeapon(playerid));
				BanPlayer(playerid,reason,Admin);
           SendClientMessage(playerid,-1,""chat"""«| You're banned from Zombie Escape [ZE]! |»");
            SendClientMessage(playerid,-1,""chat"""«| You Want To Get Unbanned? Post An Unban-Appeal On Our Website: www.Zombie-Opr.tk |»");
            SendClientMessage(playerid,-1,""chat"""«| Press F8 To Take An Picture! |»");
            new busted[18];
            format(busted, sizeof(busted), "~r~BUSTED!");
            GameTextForPlayer(playerid, busted, 10000000, 3);

			}
		}
	}



Re: Anticheat Problem - Jstylezzz - 03.03.2013

pawn Код:
if(PRESSED(KEY_FIRE))
    {
            if(pInfo[i][pVipLevel] >= 4) return 1; //add this so the script doesn't check the weapon of the player. It will stop the anticheat detecting weapons on VIPs
        switch(GetPlayerWeapon(playerid))
        {
            case 2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,26,27,28,32,35,36,37,38,39,40,41,42,43,44,45,46:
            {
                new reason[128];
                new Admin[24] = "Katie";
                format(reason,sizeof(reason),"Weapon hack %i",GetPlayerWeapon(playerid));
                BanPlayer(playerid,reason,Admin);
           SendClientMessage(playerid,-1,""chat"""«| You're banned from Zombie Escape [ZE]! |»");
            SendClientMessage(playerid,-1,""chat"""«| You Want To Get Unbanned? Post An Unban-Appeal On Our Website: http://www.Zombie-Opr.tk |»");
            SendClientMessage(playerid,-1,""chat"""«| Press F8 To Take An Picture! |»");
            new busted[18];
            format(busted, sizeof(busted), "~r~BUSTED!");
            GameTextForPlayer(playerid, busted, 10000000, 3);

            }
        }
    }
I added a comment to show what I added, and why


AW: Anticheat Problem - Blackazur - 03.03.2013

Thanks but now the Weapons switch automatic to the Spraycan
Код:
GivePlayerWeapon(i,41,3000);
when i try to use an other Weapon it switch automatic to it, can you help me?