Advertisement
YourMain12

Basic Anticheat (PROLOG)

Jan 7th, 2023
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.37 KB | None | 0 0
  1. :- dynamic player_pos/1, player_vel/1.
  2.  
  3. vector_length(vector(X, Y, Z), L) :- L is sqrt(X * X + Y * Y + Z * Z).
  4.  
  5. update_anticheat :-
  6.   player_pos(Pos), player_vel(Vel),
  7.   vector_length(Vel, VelLen), VelLen > 10.0,
  8.   retractall(player_vel(_)),
  9.   assertz(player_vel(vector(0, 0, 0))),
  10.   send_message("Cheat detected! Your velocity has been reset.").
  11. update_anticheat.
  12.  
Tags: Prolog
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement