[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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)