[Include] Anti-Cheat system v0.1 - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Anti-Cheat system v0.1 (
/showthread.php?tid=514743)
Anti-Cheat system v0.1 -
Swedky - 23.05.2014
Introduction:
- Hey guys. I decided to create this include for detect those common hacks that appear in SA-MP.
I normally did not want to liberate it for personal reasons, but here it is!
Callbacks:
- This include handles an single callback:
pawn Код:
public OnPlayerHackDetected(playerid, hacktype, oldvalue, newvalue)
/* - hacktype
CHEAT_WEAPON 0
CHEAT_MONEY 1
CHEAT_VEHMOD 2
CHEAT_****** 3 // s0b3it.
*/
Functions:
- It did not have thought to add functions, but well. Maybe this could help a bit with the information of the player:
pawn Код:
native SetPlayerReliable(playerid, bool:reliable); // We can establish that a player is reliable (As a NPC or an admin).
native SetSuspectToPlayer(playerid, bool:suspect); // Or no... (PS: the same include will add values to these functions).
native IsPlayerReliable(playerid);
native IsPlayerSuspect(playerid);
native GetPlayerWarnings(playerid); // This will return the quantity of warnings of "possible cheat" that the have player.
Example:
- Here a few explanations of the include:
pawn Код:
#include <Anti_Cheat>
#include <YSI\y_iterate>
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) SetPlayerReliable(playerid, true);
else SetPlayerReliable(playerid, false);
return 1;
}
public OnPlayerCheatDetected(playerid, cheattype, oldvalue, newvalue)
{
if(GetPlayerWarnings(playerid) == 5) return SendClientMessage(playerid, -1, "* Good-bye."), Ban(playerid);
switch(cheattype)
{
case CHEAT_WEAPON:
{
SendClientMessage(playerid, 0xFF0000AA, "* Hey, here not!");
GivePlayerWeapon(playerid, oldvalue, 10); // Give original weapon.
}
case CHEAT_MONEY:
{
new string[128];
new Nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nick, sizeof(Nick));
format(string, sizeof(string), "* %s[%d] Possible Money-Hack - [$%i -> $%i = +$%i].", Nick, playerid, oldvalue, newvalue, (newvalue-oldvalue));
foreach(new i: Player)
{
if(IsPlayerAdmin(i)) SendClientMessage(i, -1, string);
}
}
}
return 1;
}
Notes:
- You will have to mark to these players as "suspects" (except if it treats of HACK_VEHMOD) before of to prohibit or to expel them, їwhy?
- Money: A player can gain money doing the unique acrobatics.
Weapons: A player can buy weapon in a shop.
And others stuff...
Future versions:
- - Anti Aim-Bot and GodMode.
- - Fix at %100 'HACK_WEAPON'.
Download:
Credits:
- EnzoMetlc - Idea and code.
pds2k12/Patrick_ - Some chats entertaining on Skype.
If you have ideas or suggestions, don't hesitate in say me!
- Regards.
Re: Anti-Cheat system v0.1 -
Team_PRO - 23.05.2014
im waiting for anti-bot and godmode and add anti bunny hop
Respuesta: Anti-Cheat system v0.1 -
Swedky - 23.05.2014
Oh thank you, I'll bear it in mind
Re: Anti-Cheat system v0.1 -
VenomMancer - 24.05.2014
works ?