[Include] Troll Detection - Extremely accurate
#1

Troll Detection


Some troll modifications simply can't be detected through OnPlayerStateChange, because the state remains the same except for the vehicle id.

Troll mods work this way:

On-Foot:

If the cheater is on foot, it puts them in the victim's passenger seat and then in the driver seat, since you are already in the vehicle, the driver won't be ejected, this way the mod teleports the vehicle somewhere or either does something else such as setting the speed to abusive values, and then it takes the cheater out of the vehicle, the server believes the cheater was the original driver, and due to that it's position will be updated.

There's also warpers, some of them will keep your state as ''Driver'', but your vehicle id will change. So it's simple, we compare the current vehicle id with the previous vehicle entered.

In any vehicle (except the victim's):

It works the same way, but your character won't be put in the passenger seat of the victim, instead it will instantly get into the driver seat, and since the cheater is already in a vehicle, the driver won't be ejected, and the same thing will happen once the cheater is taken out of the vehicle, it's position, speed or whatever was messed with will be updated.

About this include:

I made this include long ago and i used it in my server for a long time, even tho it's simple, it's extremely accurate, no modification used to troll vehicles will work in your server with this one, i can guarante it. This include will also detect troll mods which change your state, even if there's nothing under OnPlayerStateChange for that, it still gets caught by it when both vehicle ids are compared.

Callbacks:
PHP Code:
forward OnPlayerTroll(playerid); 
Download (updated - v1.2):
Pastebin
Solidfiles
Reply
#2

Good job.
Reply
#3

From where are you calling OnPlayerTroll, because i can't see public OnPlayerTroll..?
Reply
#4

Quote:
Originally Posted by xDaemon
View Post
From where are you calling OnPlayerTroll, because i can't see public OnPlayerTroll..?
It's being called inside the include, you gotta add that callback in your gamemode.

PHP Code:
public OnPlayerTroll(playerid)
{
     
//your stuff

Reply
#5

Yep, well nice job then
Reply
#6

Why you don't use foreach?

Also

Code:
stock A_PutPlayerInVehicle(playerid, vehicleid, seatid)
{
* * new func = PutPlayerInVehicle(playerid, vehicleid, seatid);
* * if(func)
* * {
* * * * VehID[playerid] = vehicleid;
* * }
* * return func;
}
->

Code:
stock A_PutPlayerInVehicle(playerid, vehicleid, seatid)
{
* * if(PutPlayerInVehicle(playerid, vehicleid, seatid))
* * {
* * * * VehID[playerid] = vehicleid;
        return 1;
* * }
* * return 0;
}
Reply
#7

Quote:
Originally Posted by vannesenn
View Post
Why you don't use foreach?

Also

Code:
stock A_PutPlayerInVehicle(playerid, vehicleid, seatid)
{
* * new func = PutPlayerInVehicle(playerid, vehicleid, seatid);
* * if(func)
* * {
* * * * VehID[playerid] = vehicleid;
* * }
* * return func;
}
->

Code:
stock A_PutPlayerInVehicle(playerid, vehicleid, seatid)
{
* * if(PutPlayerInVehicle(playerid, vehicleid, seatid))
* * {
* * * * VehID[playerid] = vehicleid;
        return 1;
* * }
* * return 0;
}
Fixed.
Reply
#8

Tried it, working great.
Reply
#9

Hi, I've spotted a bug:

If you're a sidecar-passenger and spawn a vehicle (with PutPlayerInVehicle), then you'll get banned.

(I was using it as FS, is that a problem ?)
Reply
#10

Quote:
Originally Posted by JustMe.77
View Post
Hi, I've spotted a bug:

If you're a sidecar-passenger and spawn a vehicle (with PutPlayerInVehicle), then you'll get banned.

(I was using it as FS, is that a problem ?)
Actually you shouldn't even be putting people in vehicles if they are inside a vehicle as passengers already, you should remove them first, but yeah, re-download it, just did a small change regarding that.

Also, If by any chance you are using the include in your gamemode, but PutPlayerInVehicle in a FS, consider moving it to the gamemode to avoid problems.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)