anticheat.inc
Pre Alpha
v1.0 | Updated: 27 Dec, 2017
Pre Alpha
v1.0 | Updated: 27 Dec, 2017
What this includes?
- Anti health hack (100%)
- Anti armour hack (100%)
- Anti money hack (100%)
- Anti weapon spawn hack (100%)
- Anti weapon ammo hack (only works accurately for bullet weapons, rest just have ammo increment check, not working for static ammo hack)
- Anti weapon range hack (100%)
- Anti weapon damage hack (100%)
The include handle weapons/explosions server side, so damage is processed faster than it use to in OnPlayerTakeDamage. So more precise melee hits and bullet registration because everything is done under OnPlayerGiveDamage, with validity checks!
Side Note: I removed lagcomp.inc because this is a better idea, it has anticheat as well as lagcomp fix both!
What are the new callbacks?
Note: You won't be able to use "OnPlayerGiveDamage" and "OnPlayerTakeDamage" after including this library. "OnPlayerDamage" handles both in one callback.
PHP Code:
/******************************************************************************/
// Function: OnPlayerDamage
// Purpose: Called when a player takes/gives damage; either self inflicted or player to player.
// Parameters: <playerid> - player who took damage
// <issuerid> - player who gave damage (it can be INVALID_PLAYER_ID if damage was self inflicted)
// <weaponid> - weapon used to give damage
// <amount> - how much damage was inflicted
// <bodypart> - what bodypart of "playerid" was hit
// <death> - "true" if player will die after the damage is processed through callback
// Return: "0" - don't process damage and player won't take damage (can be used for RP purpose)
/******************************************************************************/
public OnPlayerDamage(playerid, issuerid, weaponid, Float:amount, bodypart, bool:death) {
return 1;
}
/******************************************************************************/
// Function: OnPlayerCheat
// Purpose: Called when a player tries to hack/cheat.
// Parameters: <playerid> - player who's using the hacks
// <type> - what type of hacks were detected (look at list of definitions for type ids)
// Return: "0" - include won't reset stats and you can do your stuff there, like kick or ban
// (for example: if player is detected for weapon hack, and you return "1": include will reset player weapons to original and legit weapons)
/******************************************************************************/
public OnPlayerCheat(playerid, type) {
return 1;
}
Macro name | Value |
CHEAT_TYPE_HEALTH | 0 |
CHEAT_TYPE_ARMOUR | 1 |
CHEAT_TYPE_MONEY | 3 |
CHEAT_TYPE_WEAPON | 4 |
CHEAT_TYPE_WEAPON_AMMO | 4 |
CHEAT_TYPE_WEAPON_RANGE | 5 |
CHEAT_TYPE_WEAPON_DAMAGE | 6 |
What are the new functions?
PHP Code:
/******************************************************************************/
// Function: SetPlayerWeaponDamage
// Purpose: Set a player's weapon damage value (only applicable to "Player" damage "Player")
// Parameters: <playerid> - playerid whose weapon data is to modify
// <weaponid> - weaponid whose damage value is to modify
// <damage> - damage value
// Return: "0" - unsuccessful
// "1" - successfully damage has been modified
/******************************************************************************/
SetPlayerWeaponDamage(playerid, weaponid, Float:damage);
/******************************************************************************/
// Function: GetPlayerWeaponDamage
// Purpose: Get a player's weapon damage value (only applicable to "Player" damage "Player")
// Parameters: <playerid> - playerid whose weapon data is to retrieve
// <weaponid> - weaponid whose damage value is to retrieve
// Return: "0.0" - unsucessful or damage value is 0.0 which is invalid
// "<floating value>" - successfully return damage value greater than 0.0
/******************************************************************************/
Float:GetPlayerWeaponDamage(playerid, weaponid);
/******************************************************************************/
// Function: PlayerDeath
// Purpose: Kill a player with your own death reason and killer
// Parameters: <playerid> - playerid to kill
// <killerid> - killerid who killed playerid virtually!
// <reason> - weaponid/reason of which "playerid" died
// Return: "0" - unsucessful
// "1" - successful
/******************************************************************************/
PlayerDeath(playerid, killerid, reason);
https://github.com/Agneese-Saini/SA-.../anticheat.inc
vending.inc - You require this little library to compile this include: (its server sided vending machines)
https://github.com/Agneese-Saini/SA-...de/vending.inc
* You have to include this library in ever script you are using (filterscripts and gamemode).