[Tool/Web/Other] remote-jacking anticheat (also detects people controlling remote cars issue)
#35

pawn Code:
enum E_CARJACK_DATA
{
    Float: E_LAST_X,        Float: E_LAST_Y,        Float: E_LAST_Z,
    E_LAST_VEH
}

new
    g_carjackData[ MAX_PLAYERS ] [ E_CARJACK_DATA ]
;

stock CheckPlayerRemoteJacking( playerid )
{
    new iVehicle = GetPlayerVehicleID( playerid );
   
    if( !IsPlayerInAnyVehicle( playerid ) )
        GetPlayerPos( playerid, g_carjackData[ playerid ] [ E_LAST_X ], g_carjackData[ playerid ] [ E_LAST_Y ], g_carjackData[ playerid ] [ E_LAST_Z ] );

    if( ( iVehicle != g_carjackData[ playerid ] [ E_LAST_VEH ] ) && ( iVehicle != 0 ) && ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) )
    {
        new
            Float: fDistance = GetVehicleDistanceFromPoint( iVehicle, g_carjackData[ playerid ] [ E_LAST_X ], g_carjackData[ playerid ] [ E_LAST_Y ], g_carjackData[ playerid ] [ E_LAST_Z ] ),
            Float: fOffset = 10.0
        ;
       
        if( ( GetVehicleModel( iVehicle ) == 577 ) || ( GetVehicleModel( iVehicle ) == 592 )) fOffset = 25.0; // Andromanda | AT-400

        if( fDistance > fOffset) {
       
            /*
                INSERT WHAT YOU WANT TO DO TO A CAR JACKER HERE!
               
                WARNING: THIS IS NOT ACCURATE IMHO!
            */

            SendClientMessage( playerid, -1, "Y U TRY TO CAR JACK" );
        }
       
        GetPlayerPos( playerid, g_carjackData[ playerid ] [ E_LAST_X ], g_carjackData[ playerid ] [ E_LAST_Y ], g_carjackData[ playerid ] [ E_LAST_Z ] );
        g_carjackData[ playerid ] [ E_LAST_VEH ] = iVehicle;
    }
}
I optimized it a bit, but didn't test it.

Installation of my code:
  • Add the enum and variable declarations at the top underneath your includes.
  • Place the function wherever you want. (stock CheckPlayerRemoteJacking) Just not inside a function...
  • Go to OnPlayerUpdate and insert CheckPlayerRemoteJacking( playerid );
If my method doesn't work, please inform me by PM because I'm not sure if I'll be looking at this thread every day!
Reply


Messages In This Thread
remote-jacking anticheat (also detects people controlling remote cars issue) - by JernejL - 05.06.2011, 20:52
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by SkizzoTrick - 05.06.2011, 21:19
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Famalamalam - 05.06.2011, 21:27
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by MrDeath537 - 05.06.2011, 21:56
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by linuxthefish - 05.06.2011, 22:25
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by BaubaS - 06.06.2011, 09:48
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Kwarde - 06.06.2011, 16:49
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Michael@Belgium - 06.06.2011, 19:01
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Mean - 06.06.2011, 19:27
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Kwarde - 06.06.2011, 19:30
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Michael@Belgium - 08.06.2011, 14:56
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by JernejL - 09.06.2011, 11:23
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by HyperZ - 09.06.2011, 11:25
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Mike Garber - 09.06.2011, 11:28
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Michael@Belgium - 09.06.2011, 15:17
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Kwarde - 09.06.2011, 15:29
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by alpha500delta - 09.06.2011, 20:48
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by linuxthefish - 09.06.2011, 21:03
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by [03]Garsino - 10.06.2011, 09:10
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Basicz - 10.06.2011, 09:27
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by alpha500delta - 10.06.2011, 12:05
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Michael@Belgium - 10.06.2011, 16:30
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Mike Garber - 10.06.2011, 20:51
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by LZLo - 10.06.2011, 20:57
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Mike Garber - 10.06.2011, 20:59
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Basicz - 11.06.2011, 11:55
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Michael@Belgium - 11.06.2011, 14:38
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Lorenc_ - 12.06.2011, 06:47
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by JernejL - 13.09.2011, 07:33
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by RAEN - 19.10.2011, 06:48
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Kar - 02.05.2012, 01:48
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by decondelite - 06.05.2012, 21:04
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by JernejL - 27.06.2012, 07:53
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by doodem - 27.06.2012, 15:07
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Lorenc_ - 13.07.2012, 00:16
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - by Lorenc_ - 24.07.2012, 23:53

Forum Jump:


Users browsing this thread: 1 Guest(s)