SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/02/2020, 01:41 PM   #1
MarikAshtar
Little Clucker
 
Join Date: Mar 2015
Posts: 26
Reputation: 3
Default How many false positives could this give?

Hello,

I'm trying to figure out a simple yet accurate way to detect S*be**..
And the best way (that I found atm) was to freeze player on the first spawn after connection, and check if the z axis on GetPlayerCameraFrontVector is < -0.1;

Since you can't move the camera once frozen but that mod keeps panning it down.

This is what I got so far.

Global Variable ConnectSpawn.

Under OnPlayerConnect:
pawn Code:
ConnectSpawn[playerid] = true;

Under OnPlayerSpawn:
pawn Code:
if(ConnectSpawn[playerid])
    {
        SetTimerEx("******Check", 2000, false, "i", playerid);
        TogglePlayerControllable(playerid, false);
    }
    ConnectSpawn[playerid] = false;

And The Check:
pawn Code:
public ******Check(playerid)
{
    new Float: vectorPosX, Float: vectorPosY, Float: vectorPosZ;
    GetPlayerCameraFrontVector(playerid, vectorPosX, vectorPosY, vectorPosZ);
    if(vectorPosZ < -0.1)
    {
        SCM(playerid, -1, "{FFF000}Cheat detected");
    }
    else
    {
        SCM(playerid, -1, "Nothing");
    }
    TogglePlayerControllable(playerid, true);
    return 1;
}

It works, no problem that I have found yet. But that's just it, it's seems quite to easy of a method to actually work..
And since I am just me, 1 person, it's easier to miss stuff, areas, or other variables of the game which could affect this. So for you more experienced pawn coders out there, how many false positives do you think this would get?
MarikAshtar is offline   Reply With Quote
Old 16/02/2020, 03:47 PM   #2
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 827
Reputation: 79
Default Re: How many false positives could this give?

I actually am wondering this too. How accurate is this to combat ******?
You could maybe kick the player on detection even if there is a small chance it's false.
Have you tested it for yourself? Did it detect you any time? Did it falsely detect you a single time?
__________________
Coming soon (5-21-2020):

Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Official Live Beta Release Date: 21th of May, 2020
Discord
jasperschellekens is offline   Reply With Quote
Old 16/02/2020, 04:03 PM   #3
MarikAshtar
Little Clucker
 
Join Date: Mar 2015
Posts: 26
Reputation: 3
Default Re: How many false positives could this give?

Quote:
Originally Posted by jasperschellekens View Post
I actually am wondering this too. How accurate is this to combat ******?
You could maybe kick the player on detection even if there is a small chance it's false.
Have you tested it for yourself? Did it detect you any time? Did it falsely detect you a single time?
Yes ofcourse a kick will happen but for testing purpose I just wanted a message.

And yes it works actually flawlessly in my testing, each time was correct both with and without mod with no false positives but then again, only changed starting position slightly.


Sure the camera function doesnt return the player coords but you know..
All it really needs is to spawn maybe too close to a wall in the wrong axis and it could possibly give a false positive.

I haven't actually tested that now when I think of it... Don't even know how the camera is affected when you spawn too close to an object.
Will do some testing about that specific "possibility".

But this is what I mean, there are probably countless "possibilities" like this!?
But yea, as long as it does not affect the camera it's good to go but all it takes is for ONE of them to change the z axis just a little and it would be problems.

Happy to see I interested another with this aswell!
MarikAshtar is offline   Reply With Quote
Old 16/02/2020, 04:25 PM   #4
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 843
Reputation: 68
Default Re: How many false positives could this give?

AFAIK, the sob*** has the anti freeze too. Means even if you freeze the player, he's allowed to move freely. Have you tried it?
__________________


"A server owner shouldn't be embarrassed or have fear to request help, because we're humans and we never stop learning."
Symon is online now   Reply With Quote
Old 16/02/2020, 05:14 PM   #5
MarikAshtar
Little Clucker
 
Join Date: Mar 2015
Posts: 26
Reputation: 3
Default Re: How many false positives could this give?

Quote:
Originally Posted by Symon View Post
AFAIK, the sob*** has the anti freeze too. Means even if you freeze the player, he's allowed to move freely. Have you tried it?
The one I tested did nothing when I tried the antifreeze, still frozen. But will look more into that!
MarikAshtar is offline   Reply With Quote
Old 16/02/2020, 05:35 PM   #6
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 843
Reputation: 68
Default Re: How many false positives could this give?

You have to activate anti freeze, anti setplayerpos and airbreak, try.
__________________


"A server owner shouldn't be embarrassed or have fear to request help, because we're humans and we never stop learning."
Symon is online now   Reply With Quote
Old 16/02/2020, 05:58 PM   #7
MarikAshtar
Little Clucker
 
Join Date: Mar 2015
Posts: 26
Reputation: 3
Default Re: How many false positives could this give?

Quote:
Originally Posted by Symon View Post
You have to activate anti freeze, anti setplayerpos and airbreak, try.
Activated anti freeze and airbreak both right when I connect and also tried with activating right before and when I spawn and still was detected.
There is no quick key for anti setplayerpos so you can't activate that before time runs out and you get detected.

I don't know how fool proof this is but I can atleast say that with 10/10 accuracy (SO FAR!) it will atleast detect the ones who just download the mod and play.
MarikAshtar is offline   Reply With Quote
Old 16/02/2020, 06:19 PM   #8
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 843
Reputation: 68
Default Re: How many false positives could this give?

As i remember, there is a hotkey for SetPlayerPos, check .ini file inside the folder. Or probably i'm wrong, the last time i used sob was years ago.
__________________


"A server owner shouldn't be embarrassed or have fear to request help, because we're humans and we never stop learning."
Symon is online now   Reply With Quote
Old 16/02/2020, 06:22 PM   #9
MarikAshtar
Little Clucker
 
Join Date: Mar 2015
Posts: 26
Reputation: 3
Default Re: How many false positives could this give?

Quote:
Originally Posted by Symon View Post
As i remember, there is a hotkey for SetPlayerPos, check .ini file inside the folder. Or probably i'm wrong, the last time i used sob was years ago.
Checked, no key
MarikAshtar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
while(FALSE); FALSE doesn't exist? Kwarde Help Archive 6 12/08/2011 12:28 PM
Return false to F4 The_Moddler Help Archive 3 21/09/2010 07:16 PM
How can i do a false of this command? 0ne Help Archive 4 17/04/2010 03:39 PM
What's false?!? Demolition14 Client Support 7 08/04/2009 11:56 AM


All times are GMT. The time now is 08:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.