remote-jacking anticheat (also detects people controlling remote cars issue) -
JernejL - 05.06.2011
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.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
SkizzoTrick - 05.06.2011
Nice xD but it would be better if you would use [ pawn ][ /pawn ] because the details like the comments would be more clear.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Famalamalam - 05.06.2011
Good work, JernejL! This'll come in handy no doubt.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
MrDeath537 - 05.06.2011
Good bob JernejL, it may be useful for some people
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
linuxthefish - 05.06.2011
I've seen this in a 3rd party mod before, but good work!
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
BaubaS - 06.06.2011
I can't understand, what is remote-jacking?
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Kwarde - 06.06.2011
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
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Michael@Belgium - 06.06.2011
Looks good but ... i don't know what remote-jacking is xD
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Mean - 06.06.2011
Good work, this might be useful for me soon.
And yeah, as SkizzoTrick said, use [ pawn ][ /pawn ].
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Kwarde - 06.06.2011
@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
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Michael@Belgium - 08.06.2011
Quote:
Originally Posted by Kwarde
@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
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
JernejL - 09.06.2011
Quote:
Originally Posted by Michael@Belgium
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.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
HyperZ - 09.06.2011
Nice Job
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Mike Garber - 09.06.2011
new sTemp2[1000]; in OnPlayerUpdate = performance issues... (?)
I guess i could easily change that and not send all the coordinate infos and stuff.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Michael@Belgium - 09.06.2011
Quote:
Originally Posted by JernejL
If you don't know from main post then you shouldn't bother with it.
|
lOl ... just asking 0_o Damn ... :-/
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Kwarde - 09.06.2011
Quote:
Originally Posted by JernejL
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.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
alpha500delta - 09.06.2011
No wonder noone understands it... barely explained here imo :/
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
linuxthefish - 09.06.2011
Quote:
Originally Posted by alpha500delta
No wonder noone understands it... barely explained here imo :/
|
It shouldn't need to be explained.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) - [03]Garsino - 10.06.2011
"remote-jacking anticheat (also detects people controlling remote cars issue)" I think the title explains it.
Re: remote-jacking anticheat (also detects people controlling remote cars issue) -
Basicz - 10.06.2011
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 )