[Include] OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P)
#1

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).
Reply
#2

cool thanks
Reply
#3

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

IMHO this is very... VERY inefficient implementation.
Reply
#5

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.
Reply
#6

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

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)