SA-MP Forums Archive
[Include] OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - 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] OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) (/showthread.php?tid=196249)



OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (V1.0) - MW2_OWN3D - 05.12.2010

OWN3D Anticheat
v1.0

This is my attempt at anticheat. It works when stuff changes that anticheat wasn't told about. Basically, it is server-side stored commands.

Features:
OWN3D Anticheat Checks:
-health
-armour
-money
-weapons
-ammo
-vehicle health


OWN3D Anticheat gives you the ability to kick, ban, message everyone about the detection, or just set their conflicts back to the server stored values.

How to Use:
Detection Options:
Open anticheat.inc. DETECTEDACTION defines what happens when a player gets detected. Check below it for options and how to change them.

Join Message:
Open anticheat.inc. JOINMESSAGE defines what message displays when a player connects. Check below it before changing it.

Checking Delay:
Open anticheat.inc. Number of seconds between checking for cheats. Check below it before changing it.

Add '#include <anticheat>' at the top of your script

Add/merge the following under public OnPlayerStateChange(playerid, newstate, oldstate):
Код:
	new Float:tmphealth;
	if(newstate == PLAYER_STATE_DRIVER) {
		acVehicleID[playerid] = GetPlayerVehicleID(playerid);
		GetVehicleHealth(GetPlayerVehicleID(playerid),tmphealth);
		if(tmphealth > 1000) {
			SetVehicleHealth(GetPlayerVehicleID(playerid),999);
			acVehicleHealth[GetPlayerVehicleID(playerid)] = 999;
			SetTimer("vehiclehealthnormal",CHECKDELAY*1000+1000,false);
		} else {
			GetVehicleHealth(GetPlayerVehicleID(playerid),acVehicleHealth[GetPlayerVehicleID(playerid)]);
		}
	}
Add/merge the following under public OnPlayerConnect(playerid):
Код:
	acPlayerMoney[playerid] = 0;
	acResetPlayerWeapons(playerid);
	detectenabled[playerid] = true;
	playerspawned[playerid] = false;
	if(strlen(JOINMESSAGE) > 0) SendClientMessage(playerid,COLOR_YELLOW,JOINMESSAGE);
Add/merge the following under public OnPlayerDeath(playerid, killerid, reason):
Код:
	playerspawned[playerid] = false;
Add/merge the following under public OnGameModeInit():
Код:
 	SetTimer("anticheat",CHECKDELAY*1000,1);
Add/merge the following under public OnPlayerSpawn(playerid):
Код:
	acPlayerHealth[playerid] = 100;
	acPlayerArmour[playerid] = 0;
	playerspawned[playerid] = true;
Add/merge the following under public OnPlayerCommandText(playerid, cmdtext[]):
Код:
	if(!strcmp("/oac", cmdtext, true)) {
		SendClientMessage(playerid,COLOR_YELLOW,"Server uses OWN3D Anticheat. Coded by MW2_OWN3D.");
		SendClientMessage(playerid,COLOR_YELLOW,"Email: mw2_own3d[at]live[dot]com");
		return 1;
	}
For debug/testing cmds, check the debug_add_to_gamemode text file.:

Replace the following lines with the OWN3D Anticheat versions:
Код:
GetVehicleHealth(vehicleid, health) - health = acGetVehicleHealth(vehicleid);
SetVehicleHealth(vehicleid, health) - acSetVehicleHealth(vehicleid, health);
GetPlayerHealth(playerid, health) - health = acGetPlayerHealth(playerid);
SetPlayerHealth(playerid, health) - acSetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour) - armour = acGetPlayerArmour(playerid);
SetPlayerArmour(playerid, armour) - acSetPlayerArmour(playerid, armour);
GetPlayerMoney(playerid) - acGetPlayerMoney(playerid);
GivePlayerMoney(playerid, amount) - acGivePlayerMoney(playerid, amount);
ResetPlayerMoney(playerid) - acResetPlayerMoney(playerid);
GivePlayerWeapon(playerid, weaponid, ammo) - acGivePlayerWeapon(playerid, weaponid, ammo);
ResetPlayerWeapons(playerid) - acResetPlayerWeapons(playerid);
NOTE: Replace all GivePlayerMoney(playerid,-amount) with:
Код:
acTakePlayerMoney(playerid, amount);
NOTE: Make a folder called 'own3danticheat' in scriptfiles, or your server will crash as soon as it detects a cheater.

New Functions:
acSetPlayerMoney(playerid, amount);
acGetPlayerWeapon(playerid, slot);
acGetPlayerAmmo(playerid, slot);

Enjoy!

If you download this script, you agree that you won't faggotsteal it and you will make the creator's name visible on your server (/oac command).



Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - Kopr1zz - 05.12.2010

cool thanks


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - [NoV]LaZ - 05.12.2010

GetPlayerHealth returns a float value, so you'll need floatstr to convert a string into a float.


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - xxmitsu - 05.12.2010

IMHO this is very... VERY inefficient implementation.


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - MW2_OWN3D - 05.12.2010

Quote:
Originally Posted by [NoV]LaZ
Посмотреть сообщение
GetPlayerHealth returns a float value, so you'll need floatstr to convert a string into a float.
floatstr doesn't work. i tried it, anyway, that isnt currently a problem. now the problem is in it detecting a weapon cheat when there isnt one.


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - MW2_OWN3D - 05.12.2010

sorry for double post
UPDATE: Fixed and working! I am converting it into a filterscript and adding a few more commands/features.


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - Ernests - 17.07.2011

yeah, this anti money cheat not cool because... car tuning, casino, ammunation, cluckin' bell...


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - you10 - 14.11.2011

If you give someone 50000 (Unlimited) Ammo it bans them


Re: OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) - wups - 14.11.2011

Quote:
Originally Posted by you10
Посмотреть сообщение
If you give someone 50000 (Unlimited) Ammo it bans them
Don't bump this.
There are better anti-cheats, I suggest locking this thread.