dann1s

Anti Fly Hack

Aug 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. new bool:PlayerFallSpeed[ MAX_PLAYERS ],
  2. Float:SpeedPos[ MAX_PLAYERS ][ 3 ];
  3.  
  4. // -------------------- [ ONPLAYERCONNECT I RESET VARIJABLI ] --------
  5. PlayerFallSpeed[ playerid ] = false;
  6.  
  7. // --------------------------- [ CALLBACKS ] --------------------
  8. forward OnPlayerFalla( playerid );
  9. public OnPlayerFalla( playerid ) {
  10. if( PlayerFallSpeed[ playerid ] ) return 1;
  11.  
  12. SetTimerEx( "Reactivate", 8000, false, "i", playerid );
  13. PlayerFallSpeed[ playerid ] = true;
  14.  
  15. return 1;
  16. }
  17.  
  18. forward FallingChecker( playerid );
  19. public FallingChecker( playerid ) {
  20. new Float:Pozisn[ 4 ];
  21.  
  22. if( IsPlayerConnected( playerid ) ) {
  23. GetPlayerPos( playerid, Pozisn[ 0 ], Pozisn[ 1 ], Pozisn[ 2 ] );
  24. Pozisn[ 3 ] = floatsqroot( ( Pozisn[ 0 ]-SpeedPos[ playerid ][ 0 ] * Pozisn[ 0 ]-SpeedPos[ playerid ][ 0 ] ) + ( Pozisn[ 1 ]-SpeedPos[ playerid ][ 1 ] * Pozisn[ 1 ]-SpeedPos[ playerid ][ 1 ] ) );
  25.  
  26. if( Pozisn[ 3 ] < 10 && ( SpeedPos[ playerid ][ 2 ] - Pozisn[ 2 ] ) > 5 ) {
  27.  
  28. OnPlayerFalla( playerid );
  29. }
  30. SpeedPos[ playerid ][ 0 ] = Pozisn[ 0 ];
  31. SpeedPos[ playerid ][ 1 ] = Pozisn[ 1 ];
  32. SpeedPos[ playerid ][ 2 ] = Pozisn[ 2 ];
  33. }
  34. return 1;
  35. }
  36.  
  37. forward Reactivate( playerid );
  38. public Reactivate( playerid ) {
  39.  
  40. PlayerFallSpeed[ playerid ] = false;
  41.  
  42. return 1;
  43. }
  44. // ---------------------- [ DODAT U TAJMER OD 500MS ILI 1SEC ] ---------------------
  45. new string[128];
  46. new Float:Pos_x,Float:Pos_y,Float:Pos_z;
  47. new anim = GetPlayerAnimationIndex(id);
  48. GetPlayerVelocity(id,Pos_x,Pos_y,Pos_z);
  49. FallingChecker(id);
  50. if(Pos_x <= -0.800000 || Pos_y <= -0.800000 || Pos_z <= -0.800000 && anim == 1008)
  51. {
  52. new tmpcar = GetPlayerVehicleID(id);
  53. if(!VoziloJeAvion(tmpcar) && GetPlayerSurfingVehicleID(id) == INVALID_VEHICLE_ID && !PlayerFallSpeed[ id ])
  54. {
  55. format(string, 256, "{D5A658}(AntiCheat) {D55858}%s (%d) koristi airbreak hack, provjeri ga!",GetPlayerNameEx(id), id);
  56. ABroadCast(SIVA,string,1); //stavi svoje, znaci da je detektovan
  57. }
  58. }
Add Comment
Please, Sign In to add comment