SA-MP Forums Archive
[Include] Troll Detection - Extremely accurate - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Troll Detection - Extremely accurate (/showthread.php?tid=620645)



Troll Detection - Extremely accurate - Jelly23 - 01.11.2016

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


Re: Troll Detection - Extremely accurate - TopShooter - 01.11.2016

Good job.


Re: Troll Detection - Extremely accurate - xDaemon - 01.11.2016

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


Re: Troll Detection - Extremely accurate - Jelly23 - 01.11.2016

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




Re: Troll Detection - Extremely accurate - xDaemon - 01.11.2016

Yep, well nice job then


Re: Troll Detection - Extremely accurate - vannesenn - 01.11.2016

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;
}



Re: Troll Detection - Extremely accurate - Jelly23 - 01.11.2016

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.


Re: Troll Detection - Extremely accurate - MikeB - 01.11.2016

Tried it, working great.


Re: Troll Detection - Extremely accurate - JustMe.77 - 12.11.2016

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


Re: Troll Detection - Extremely accurate - Jelly23 - 12.11.2016

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.