SA-MP Forums Archive
Detecting weapon hack - 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: Detecting weapon hack (/showthread.php?tid=406320)



Detecting weapon hack - ajwar - 09.01.2013

Any suggestion on how to detect when players are hacking weapons inside a vehicle?


Re: Detecting weapon hack - Mr.Anonymous - 09.01.2013

OnPlayerUpdate > If get player weapon > ID > Forbidden? > BAN!


Re: Detecting weapon hack - GwENiko - 10.01.2013

pawn Код:
new gunid = GetPlayerWeapon(playerid); //  defining the weapon ID spawned by the hacker
new str[128], pname[MAX_PLAYER_NAME]; // creates an array to define the amount of letters in a the line, and defines the player name, so we can format and send the ban text.


if(gunid == 38) // Checks the type of the weapon ID
{
GetPlayerName(playerid, pname, sizeof(pname)); // Gets the player name

format(str,sizeof(str), "%s has been banned by the anti-cheat for weapon hacks.", pname); formats the size of the string and sends it in form a text


SendClientMessageToAll(0xFF0000AA, str); // Sends a public text
Ban(playerid); // bans the player spawning the weapon
}
return 1;
}