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

Quote:
Originally Posted by linuxthefish
View Post
It shouldn't need to be explained.
Then it's not really a tutorial is it... Then it would be more like a snippet.
Reply
#22

Quote:
Originally Posted by linuxthefish
View Post
It shouldn't need to be explained.
Lol, a tutorial IS something you explain and how to do it ... so this is not a tut. Like alpha500delta says:

Quote:
Originally Posted by alpha500delta
View Post
Then it's not really a tutorial is it... Then it would be more like a snippet.
Reply
#23

If you notice this is not titled as a tutorial in any way, although i think the placement of this topic is to get as much attention as possible.

And if you can't figure out what this is, you don't need it.
Reply
#24

Quote:
Originally Posted by Basicz
View Post
Hmm... like when we cannot jack or enter a car from a far distance, ( Player 1 is driving on San Fierro HQ, then player 2 comes and pressed "G" then the car moves a bit far from player 2, magically player 2 gets in the car )
oh, nice work
Reply
#25

Quote:
Originally Posted by Basicz
View Post
Hmm... like when we cannot jack or enter a car from a far distance, ( Player 1 is driving on San Fierro HQ, then player 2 comes and pressed "G" then the car moves a bit far from player 2, magically player 2 gets in the car )
No, nothing like that.
Reply
#26

This! Found this with ****** search.

http://fooyoh.com/car_video/watch/cRCRC44InfE
Reply
#27

Quote:
Originally Posted by Basicz
View Post
This! Found this with ****** search.

http://fooyoh.com/car_video/watch/cRCRC44InfE
Aaaah finally !!!> Thank you so much Basicz
Reply
#28

Wait lol, I don't see no Enum created for this and supplied in this tutorial.

People should get errors if they use this code!

acstruct?
pawn Code:
enum E_ACSTRUCT
{
//DATA
}
new acstruct[MAX_PLAYERS][E_ACSTRUCT];
Or? Where the hell is this enum created?

Really nice snippet afterall.
Reply
#29

Quote:
Originally Posted by Lorenc_
View Post
Wait lol, I don't see no Enum created for this and supplied in this tutorial.

People should get errors if they use this code!

acstruct?
pawn Code:
enum E_ACSTRUCT
{
//DATA
}
new acstruct[MAX_PLAYERS][E_ACSTRUCT];
Or? Where the hell is this enum created?

Really nice snippet afterall.
I didn't post the enum, because there's a lot more info in it that i don't want it seen public, but it is very easy to recreate it from the sources that i did show.
Reply
#30

What is Distance(); ? Code plz.
Reply
#31

I don't understand, lastantijackstate and currstate is this really surpose to be vehicleid? Because you use GetPlayerVehicleID after and the name is straying a bit
Reply
#32

I've just discovered that code snippet, thanks to a thread that I posted about a hack, and that got deleted...
I'd like to say that it's FAR from being well optimized, and that I've modified everything to get something much simpler out of it.
Reply
#33

Quote:
Originally Posted by decondelite
View Post
I've just discovered that code snippet, thanks to a thread that I posted about a hack, and that got deleted...
I'd like to say that it's FAR from being well optimized, and that I've modified everything to get something much simpler out of it.
If you are going to bash my code here you are free to do so, but i expect you to post your "well optimized, simplier and modified everything" for everyone else, because otherwise you just look like a egocentric basher that's affraid of sharing and others criticizing his own code.

Like i wrote in first post:

Quote:

Feel free to post comments, optimizations, improvements.

Reply
#34

Good Work =]
Reply
#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
#36

Quote:
Originally Posted by Kwarde
View Post
Then I think you should test it before posting it (@Lorenc_). I think this is mentioned a couple of times before ('least in other topics) where you was in too (not sure) so you should know that :').
I tested it and was quite happy to announce that it worked :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)