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

pawn Код:
check_remote_jacking(PlayerID) {
   
    new currstate;
    currstate = GetPlayerVehicleID(PlayerID);
   
    if (!IsPlayerInAnyVehicle(PlayerID)) // always remember last onfoot coords.
        GetPlayerPos(PlayerID, acstruct[PlayerID][LastOnFootPosition][0], acstruct[PlayerID][LastOnFootPosition][1], acstruct[PlayerID][LastOnFootPosition][2]);
   
    if ((currstate != acstruct[PlayerID][lastantijackstate]) && (currstate != 0) && (GetPlayerState(PlayerID) == PLAYER_STATE_DRIVER)) {
       
        new Float:Tmppos[3];
       
        GetVehiclePos(GetPlayerVehicleID(PlayerID), Tmppos[0], Tmppos[1], Tmppos[2]);
       
        new Float:distancejack = 0.0;
        distancejack = Distance(Tmppos, acstruct[PlayerID][LastOnFootPosition]);
       
        new thiscaride;
        thiscaride = GetVehicleModel(GetPlayerVehicleID(PlayerID));
       
        new Float:distanceth = 10.0; // some sane random value
       
        if ((thiscaride == 577) || (thiscaride == 592)) //ignore AT-400 and andromada (false positives spam)
            distanceth = 25.0;
       
        if (distancejack > distanceth) {
            new sTemp[255];
            format(sTemp, sizeof(sTemp), "Possibly remote-jacked a car type %d (%s) distance to car: %0.2f.", thiscaride, VehicleNames[GetVehicleModel(GetPlayerVehicleID(PlayerID)) - 400], distancejack);
            pos_ReportPlayerToAdmins(ANTICHEAT_ID, ANTICHEAT_NAME, PlayerID, sTemp);
           
            if (notadmin) {
               
                new issin = 0;
                if (IsVehicleStreamedIn(GetPlayerVehicleID(PlayerID), PlayerID))
                    issin = 1;
               
                new sTemp2[1000];
                format(sTemp2, sizeof(sTemp2), "[checkremotejack] %s %d vid: %d IDE: %d distance: %0.1f (%0.2f, %0.2f, %0.2f -> %0.2f, %0.2f, %0.2f ) LDC: %d streamed: %d", pNickname[PlayerID], PlayerID, currstate, thiscaride, distancejack, Tmppos[0], Tmppos[1], Tmppos[2], acstruct[PlayerID][LastOnFootPosition][0], acstruct[PlayerID][LastOnFootPosition][1], acstruct[PlayerID][LastOnFootPosition][2], TickCount() - pLastDrunkChange[PlayerID], issin);
                AddEchoMessageEx(sTemp2);
            }
           
        }
       
        // This is now assumed last position, so we can see if player teleported from one car to another.
        GetPlayerPos(PlayerID, acstruct[PlayerID][LastOnFootPosition][0], acstruct[PlayerID][LastOnFootPosition][1], acstruct[PlayerID][LastOnFootPosition][2]);
       
        acstruct[PlayerID][lastantijackstate] = currstate;
    }
   
}
- Written by me based on Kalcor's instructions on how to handle this issue.
- Put it into onplayerupdate call, change the calls to pos_ReportPlayerToAdmins and AddEchoMessageEx to whatever your player report & irc report routines are.
- When the vehicle is NOT streamed in and this happens, the player is in desynced state (you may consider forcing them to reconnect or kick them to solve that side issue) or your script used PutPlayerInVehicle call.
- It shouldnt be hard for you to figure out the acstruct enum but if you need help let me know
- Also don't forget to init lastantijackstate to 0 on every spawning, connecting etc..

This is VERY reliable but has its flaws (for start it doesn't handle PutPlayerInVehicle properly). but it'll be enough for you to detect when people are trying to remotely controll vehicles (it will register as one player quickly switching around large amout of cars) - example reports of this happening:

Quote:

'Elculiaopesao', '2011-06-01 18:12:50', 'Possible remote jacking vid: 853 IDE: 402 distance: 755.1 (-2000.48, 82.77, 27.44 -> -2652.53, -297.51, 7.07 ) LDC: 725'
'Elculiaopesao', '2011-06-01 18:12:54', 'Possible remote jacking vid: 1154 IDE: 407 distance: 21.2 (-2021.73, 81.74, 28.25 -> -2000.48, 82.77, 27.44 ) LDC: 314'
'Elculiaopesao', '2011-06-01 18:13:05', 'Possible remote jacking vid: 678 IDE: 566 distance: 124.2 (-1983.32, 199.95, 27.48 -> -2021.73, 81.74, 28.25 ) LDC: 246'
'Elculiaopesao', '2011-06-01 18:13:06', 'Possible remote jacking vid: 1154 IDE: 407 distance: 21.1 (-2002.53, 208.76, 27.77 -> -1983.32, 199.95, 27.48 ) LDC: 0'
'Elculiaopesao', '2011-06-01 18:13:06', 'Possible remote jacking vid: 678 IDE: 566 distance: 21.1 (-1983.30, 200.01, 27.45 -> -2002.53, 208.76, 27.77 ) LDC: 718'
'Elculiaopesao', '2011-06-01 18:13:08', 'Possible remote jacking vid: 1154 IDE: 407 distance: 48.4 (-2001.21, 244.98, 29.80 -> -1983.30, 200.01, 27.45 ) LDC: 595'
'Elculiaopesao', '2011-06-01 18:13:09', 'Possible remote jacking vid: 124 IDE: 422 distance: 49.1 (-2045.72, 264.94, 35.79 -> -2001.21, 244.98, 29.80 ) LDC: 303'
'Elculiaopesao', '2011-06-01 18:13:10', 'Possible remote jacking vid: 1222 IDE: 500 distance: 34.1 (-2079.77, 267.00, 35.48 -> -2045.72, 264.94, 35.79 ) LDC: 328'
'Elculiaopesao', '2011-06-01 18:13:11', 'Possible remote jacking vid: 124 IDE: 422 distance: 34.1 (-2045.70, 264.81, 35.80 -> -2079.77, 267.00, 35.48 ) LDC: 166'

It will also let you see when people try to actually remote jack vehicles from other players, etc..

Feel free to post comments, optimizations, improvements.
Reply
#2

Nice xD but it would be better if you would use [ pawn ][ /pawn ] because the details like the comments would be more clear.
Reply
#3

Good work, JernejL! This'll come in handy no doubt.
Reply
#4

Good bob JernejL, it may be useful for some people
Reply
#5

I've seen this in a 3rd party mod before, but good work!
Reply
#6

I can't understand, what is remote-jacking?
Reply
#7

Wrong board, this is the tutorials board. This script is not a tutorial but just a script.
And it's better readable if it's placed between [ pawn ][ /pawn ] tags. However it's nice, I might use it if I get annoying cheaters/hackers
Reply
#8

Looks good but ... i don't know what remote-jacking is xD
Reply
#9

Good work, this might be useful for me soon.
And yeah, as SkizzoTrick said, use [ pawn ][ /pawn ].
Reply
#10

@Michael: As far as I know, remote-jacking is that cheat where you can enter a car from anywhere. If someone is in it, he'll be removed out from it. Am I right? If not, I don't know what it is neither.

This forum requires that you wait 120 seconds between posts. Please try again in 32 seconds.
32 seconds later.
Second try
Reply
#11

Quote:
Originally Posted by Kwarde
View Post
@Michael: As far as I know, remote-jacking is that cheat where you can enter a car from anywhere. If someone is in it, he'll be removed out from it. Am I right? If not, I don't know what it is neither.

This forum requires that you wait 120 seconds between posts. Please try again in 32 seconds.
32 seconds later.
Second try
Ah ... so can anyone tell us what THIS is ? xD
Reply
#12

Quote:
Originally Posted by Michael@Belgium
View Post
Ah ... so can anyone tell us what THIS is ? xD
If you don't know from main post then you shouldn't bother with it.
Reply
#13

Nice Job
Reply
#14

new sTemp2[1000]; in On‌PlayerUpdate = performance issues... (?)
I guess i could easily change that and not send all the coordinate infos and stuff.
Reply
#15

Quote:
Originally Posted by JernejL
View Post
If you don't know from main post then you shouldn't bother with it.
lOl ... just asking 0_o Damn ... :-/
Reply
#16

Quote:
Originally Posted by JernejL
View Post
If you don't know from main post then you shouldn't bother with it.
On the other side, if no one tells him, he'll never get to know it.
Reply
#17

No wonder noone understands it... barely explained here imo :/
Reply
#18

Quote:
Originally Posted by alpha500delta
View Post
No wonder noone understands it... barely explained here imo :/
It shouldn't need to be explained.
Reply
#19

"remote-jacking anticheat (also detects people controlling remote cars issue)" I think the title explains it.
Reply
#20

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 )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)