[Include] Anti CLEO CARWARP/CARSWING/CARSPAM - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: Phoenixxx_Czar, Getbackthere, [CM]OlegEhtler  
[Include] Anti CLEO CARWARP/CARSWING/CARSPAM
Herro[CM] Дата: Четверг, 10.09.2015, 15:07 | Сообщение # 1
Бывалый
Сообщений: 425
Статус: Offline
Данный Include запретит некоторые читы связанные с машинами.


include:
Код

/* ** Stop Duplicating Code! ** */
#if defined _fcleo_included
  #endinput
#endif
#define _fcleo_included

/* ** Includes ** */
#include        < a_samp >

/* ** Configuration ** */
#define FILE_VERSION    "0.3.0"

#define CLEO_FAKEKILL    ( 1 )  
#define CLEO_CARWARP    ( 2 )  
#define CLEO_PLAYERBUGGER   ( 3 ) // This number will never be called from OnPlayerCleoDetected  
#define CLEO_CARSWING    ( 4 )
#define CLEO_CAR_PARTICLE_SPAM  ( 5 )

/* ** Variables ** */
enum E_CLEO_DATA
{
  E_FK_LASTDEATH,     E_FK_DEATHSPAM,  
  E_CW_TIME,      E_CW_VEHID,
  Float: E_PB_X,     Float: E_PB_Y,    Float: E_PB_Z,
  E_CPS_SPAMCOUNT,    E_CPS_TICK
};

static stock
  g_cleoData      [ MAX_PLAYERS ] [ E_CLEO_DATA ],
   
  bool: FC_OPU,
  bool: FC_OPD,
  bool: FC_OPSC,
  bool: FC_OVDSU,
  bool: FC_OPDC
;

/* ** Forwards ** */
forward OnPlayerCleoDetected  ( playerid, cleoid );

public OnVehicleDamageStatusUpdate( vehicleid, playerid )
{
  if( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
  {
   new time = GetTickCount( );
   switch( time - g_cleoData[ playerid ] [ E_CPS_TICK ] )
   {
    case 0 .. 500:
    {
     g_cleoData[ playerid ] [ E_CPS_SPAMCOUNT ] ++;
     if( g_cleoData[ playerid ] [ E_CPS_SPAMCOUNT ] >= 10 )
     {
      CallLocalFunction( "OnPlayerCleoDetected", "dd", playerid, CLEO_CAR_PARTICLE_SPAM );
      return 1;
     }
    }
    default: g_cleoData[ playerid ] [ E_CPS_SPAMCOUNT ] = 0;
   }
   g_cleoData[ playerid ] [ E_CPS_TICK ] = time;
  }
  return ( FC_OVDSU ) ? CallLocalFunction( "FC_OnVehicleDamageStatusUpdate", "dd", vehicleid, playerid ) : 1;
}

#if defined HOK_OnVehicleDamageStatusUpdate
  #undef OnVehicleDamageStatusUpdate
#else
  #define HOK_OnVehicleDamageStatusUpdate
#endif
#define OnVehicleDamageStatusUpdate FC_OnVehicleDamageStatusUpdate
forward FC_OnVehicleDamageStatusUpdate( vehicleid, playerid );

public OnPlayerStateChange( playerid, newstate, oldstate )
{
     if( newstate == PLAYER_STATE_DRIVER )
     {
         if( GetPlayerVehicleID( playerid ) != g_cleoData[ playerid ] [ E_CW_VEHID ] )
         {
             if( g_cleoData[ playerid ] [ E_CW_TIME ] > gettime( ) )
             {
     CallLocalFunction( "OnPlayerCleoDetected", "dd", playerid, CLEO_CARWARP );
                 return 1;
             }
             g_cleoData[ playerid ] [ E_CW_TIME ] = gettime( ) + 1;
    g_cleoData[ playerid ] [ E_CW_VEHID ] = GetPlayerVehicleID( playerid );
         }
     }
  return ( FC_OPSC ) ? CallLocalFunction( "FC_OnPlayerStateChange", "ddd", playerid, newstate, oldstate ) : 1;
}

#if defined HOK_OnPlayerStateChange
  #undef OnPlayerStateChange
#else
  #define HOK_OnPlayerStateChange
#endif
#define OnPlayerStateChange FC_OnPlayerStateChange
forward FC_OnPlayerStateChange( playerid, newstate, oldstate );

public OnPlayerDeath( playerid, killerid, reason )
{
  new time = gettime( );
  switch( time - g_cleoData[ playerid ] [ E_FK_LASTDEATH ] )
  {
   case 0 .. 3:
   {
    g_cleoData[ playerid ] [ E_FK_DEATHSPAM ] ++;
    if( g_cleoData[ playerid ] [ E_FK_DEATHSPAM ] >= 3 )
    {
     CallLocalFunction( "OnPlayerCleoDetected", "dd", playerid, CLEO_FAKEKILL );
     return 1;
    }
   }
   default: g_cleoData[ playerid ] [ E_FK_DEATHSPAM ] = 0;
  }
  g_cleoData[ playerid ] [ E_FK_LASTDEATH ] = time;
  return ( FC_OPD ) ? CallLocalFunction( "FC_OnPlayerDeath", "ddd", playerid, killerid, reason ) : 1;
}

#if defined HOK_OnPlayerDeath
  #undef OnPlayerDeath
#else
  #define HOK_OnPlayerDeath
#endif
#define OnPlayerDeath FC_OnPlayerDeath
forward FC_OnPlayerDeath( playerid, killerid, reason );

public OnPlayerUpdate( playerid )
{
  static
   Float: X,  Float: Y,  Float: Z,
   Float: vX,    Float: vY,  Float: vZ
  ;
  GetPlayerPos( playerid, X, Y, Z );

  if( X >= 99999.0 || Y >= 99999.0 || Z >= 99999.0 || X <= -99999.0 || Y <= -99999.0 || Z <= -99999.0 ) {
     SendClientMessage( playerid, 0xa9c4e4ff, "Warning: Excessive X, Y, Z has been breached thus last location set." );
   SetPlayerPos( playerid, g_cleoData[ playerid ] [ E_PB_X ], g_cleoData[ playerid ] [ E_PB_Y ], g_cleoData[ playerid ] [ E_PB_Z ] );
  }
  else
  {
      g_cleoData[ playerid ] [ E_PB_X ] = X;
      g_cleoData[ playerid ] [ E_PB_Y ] = Y;
      g_cleoData[ playerid ] [ E_PB_Z ] = Z;
  }

  if( IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
  {
   GetPlayerPos( playerid, X, Y, Z );
     GetVehicleVelocity( GetPlayerVehicleID( playerid ), vX, vY, vZ );
   if( ( vX > 3.0 || vY > 3.0 || vZ > 3.0 || vX < -3.0 || vY < -3.0 || vZ < -3.0 ) && ( vX != X && vY != Y && vZ != Z ) )
   {
    CallLocalFunction( "OnPlayerCleoDetected", "dd", playerid, CLEO_CARSWING );
   }
  }
  return ( FC_OPU ) ? CallLocalFunction( "FC_OnPlayerUpdate", "d", playerid ) : 1;
}

#if defined HOK_OnPlayerUpdate
  #undef OnPlayerUpdate
#else
  #define HOK_OnPlayerUpdate
#endif
#define OnPlayerUpdate FC_OnPlayerUpdate
forward FC_OnPlayerUpdate( playerid );

public OnPlayerDisconnect(playerid, reason)
{
  // Pointless reseting, but just incase!
  g_cleoData[ playerid ] [ E_FK_LASTDEATH ] = 0;
  g_cleoData[ playerid ] [ E_FK_DEATHSPAM ] = 0;
  g_cleoData[ playerid ] [ E_CW_TIME ] = 0;
  g_cleoData[ playerid ] [ E_CW_VEHID ] = INVALID_VEHICLE_ID;
  g_cleoData[ playerid ] [ E_PB_X ] = -1;
  g_cleoData[ playerid ] [ E_PB_Y ] = -1;
  g_cleoData[ playerid ] [ E_PB_Z ] = -1;
  g_cleoData[ playerid ] [ E_CPS_SPAMCOUNT ] = 0;
  g_cleoData[ playerid ] [ E_CPS_TICK ] = 0;
  return ( FC_OPDC ) ? CallLocalFunction( "FC_OnPlayerDisconnect", "dd", playerid, reason ) : 1;
}

#if defined HOK_OnPlayerDisconnect
  #undef OnPlayerDisconnect
#else
  #define HOK_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect FC_OnPlayerDisconnect
forward FC_OnPlayerDisconnect( playerid, reason );

#if !defined FILTERSCRIPT
  public OnGameModeInit()
  {
   FC_OPU = ( funcidx( "FC_OnPlayerUpdate" ) != -1 );
   FC_OPD = ( funcidx( "FC_OnPlayerDeath" ) != -1 );
   FC_OPSC = ( funcidx( "FC_OnPlayerStateChange" ) != -1 );
   FC_OPDC = ( funcidx( "FC_OnPlayerDisconnect" ) != -1 );
   FC_OVDSU = ( funcidx( "FC_OnVehicleDamageStatusUpdate" ) != -1 );
   return ( funcidx( "FC_OnGameModeInit" ) != -1 ) ? CallLocalFunction( "FC_OnGameModeInit", "" ) : 1;
  }  
  #if defined HOK_OnGameModeInit
   #undef OnGameModeInit
  #else
   #define HOK_OnGameModeInit
  #endif
  #define OnGameModeInit FC_OnGameModeInit
  forward FC_OnGameModeInit();
#else
  public OnFilterScriptInit()
  {
   FC_OPU = ( funcidx( "FC_OnPlayerUpdate" ) != -1 );
   FC_OPD = ( funcidx( "FC_OnPlayerDeath" ) != -1 );
   FC_OPSC = ( funcidx( "FC_OnPlayerStateChange" ) != -1 );
   FC_OPDC = ( funcidx( "FC_OnPlayerDisconnect" ) != -1 );
   FC_OVDSU = ( funcidx( "FC_OnVehicleDamageStatusUpdate" ) != -1 );
   return ( funcidx( "FC_OnFilterScriptInit" ) != -1 ) ? CallLocalFunction( "FC_OnFilterScriptInit", "" ) : 1;
  }  
  #if defined HOK_OnFilterScriptInit
   #undef OnFilterScriptInit
  #else
   #define HOK_OnFilterScriptInit
  #endif
  #define OnFilterScriptInit FC_OnFilterScriptInit
  forward FC_OnFilterScriptInit();
#endif


Пример:

Код

public OnPlayerCleoDetected( playerid, cleoid )
{
     switch( cleoid )
     {
         case CLEO_FAKEKILL:
         {
             SendClientMessage( playerid, -1, "You are fake killing." );
             BanEx( playerid, "Fake kill" );
         }
         case CLEO_CARWARP:
         {
             SendClientMessage( playerid, -1, "You are car warping." );
             BanEx( playerid, "Car Warp" );
         }
         case CLEO_CARSWING:
         {
             SendClientMessage( playerid, -1, "You are car swinging" );
             BanEx( playerid, "Car Swing" );
         }
         case CLEO_CAR_PARTICLE_SPAM:
         {
             SendClientMessage( playerid, -1, "You are partical spamming" );
             BanEx( playerid, "Car Particle Spam" );
         }
     }
     return 1;
}


Автор: Lorenc_


Когда нет знания, есть мнение.
Surex Дата: Суббота, 02.07.2016, 14:04 | Сообщение # 2
Боец
Сообщений: 137
Статус: Offline
полезно

Tomat Дата: Воскресенье, 03.07.2016, 18:14 | Сообщение # 3
Любитель
Сообщений: 42
Статус: Offline
Полезно. Но вот где на аэродроме тачку возвращало обратно на свое место, меня эта ситуация настораживает. Не будет ли такой вещи что читер(Игрок) таким образом сшибать других игроков? Или же такая ситуация видна только читеру, а для других игроков он просто стоит???

Дипломат Tomat
Плисс Дата: Вторник, 19.07.2016, 20:36 | Сообщение # 4
Боец
Сообщений: 70
Статус: Offline
Кросс
  • Страница 1 из 1
  • 1
Поиск: