JC-MP

Scripting => Releases => Topic started by: MrQWERTYU on July 10, 2019, 08:54:36 pm

Title: [Release] Basic Anti-Cheat
Post by: MrQWERTYU on July 10, 2019, 08:54:36 pm
* At the moment, it protects only from invulnerable players.
Basic Anti-Cheat
Basic Anti-Cheat for your server.

WARNING: Anti-cheat will trigger on events ply.invulnerable and ply.makeinvulnerable, please read the information for server developers from below. Do not use this plugin if you don't know what to do.

Download:
- GitHub (https://github.com/Hallkezz/BasicAntiCheat)

For server developers:
Use this event to enable/disable Anti-Cheat:
Code: Lua
  1. Events:Fire( "AntiCheat", {acActive = true/false} )

Use this event to enable/disable Anti-Cheat Bullet hit check:
Code: Lua
  1. Events:Fire( "AntiCheat", {acBulletCheck = true/false} )

Use this event to enable/disable Anti-Cheat Explosion hit check:
Code: Lua
  1. Events:Fire( "AntiCheat", {acExplosionCheck = true/false} )


Example:
For example ProperPassive (https://www.jc-mp.com/forums/index.php/topic,5254.0.html) plugin...
Code: Lua
  1. function Passive:NetworkObjectValueChange(args)
  2.   if args.key == "Passive" and args.object.__type == "LocalPlayer" then
  3.     if args.value then
  4.       Game:FireEvent("ply.invulnerable")
  5.       Events:Fire( "AntiCheat", {acActive = false} )
  6.     else
  7.       Game:FireEvent("ply.vulnerable")
  8.       Events:Fire( "AntiCheat", {acActive = true} )
  9.     end
  10.   end
  11. end