Author Topic: AntiCheat  (Read 9572 times)

Offline Faro0s

  • VIP
  • Hero Member
  • **
  • Posts: 1113
  • Rank: Road Dawg
  • Score: 22227
  • Sniper aimbotter. -PluG
AntiCheat
« on: October 26, 2016, 09:01:05 pm »
I don't know if this is the right place or not but I think there is something wrong in the AntiCheat system.

Today, there was a person spawned a minigun, he killed too many people with it, system did not ban him. Referring the report section, there is a report about someone using minigun.
So my question is, is there a problem with the anticheat or it is another script ?
If this is the case, I would like to suggest this, improve the anticheat.


Quote
<PBBot1>:[Terrorist ID: 21] dizzy: who coded anticheat?? idiot?
« Last Edit: October 28, 2016, 09:12:10 am by Faro0s »

Since 2010.
• Reason for the report (Go into more detail about what they did):I killed ahmed and he tried to accuse me for killing him

Offline Rage

  • VIP
  • Hero Member
  • **
  • Posts: 1082
  • Rank: Jacker
  • Score: 46484
  • ◢ ◤
Re: AntiCheat
« Reply #1 on: October 26, 2016, 09:03:54 pm »
Yes. Work or fix anticheat please

Offline TreePuncher

  • VIP
  • Full Member
  • **
  • Posts: 118
  • Rank: Unknown
  • Score: Unknown
Re: AntiCheat
« Reply #2 on: October 27, 2016, 08:08:21 pm »
Should work well, and if it doesn't, a few tweaks would get it working
(I've made this real quick AND I might have gotten the weapon slots wrong)
Code: [Select]
#define FILTERSCRIPT
#include <a_samp>
forward WeaponChecker();
enum Sections
{
PRESIDENT,
VICEPRESIDENT,
SECURITY,
SWAT,
COPS,
TERRORISTS,
CIVILIANS
};
new WPTimer;
new ValidWeapons[Sections][13] =
{
{0, 2, 24, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1}, //PRESIDENT: Golf Club, Flowers, Deagle
    {0, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, //VICEPRESIDENT: Silenced Pistol
    {0, -1, -1, 26, 29, 31, -1, -1, -1, -1, -1, -1, -1}, //SECURITY: Sawn-offs, MP5, M4
    {0, -1, 24, 25, 32, -1, -1, -1, -1, -1, -1, -1, -1}, //SWAT: Deagle, Shotgun, Tec-9
    {0, -1, 24, -1, 28, 31, -1, -1, -1, -1, -1, -1, -1}, //POLICE: Deagle, UZI, M4
    {0, -1, -1, 27, 32, 30, -1, -1, -1, -1, -1, -1, -1}, //TERRORIST: Spas, AK-47, Tec-9
    {0, -1, 24, 25, -1, -1, -1, -1, -1, -1, 10, -1, -1} //CIVILIAN: Purple Dildo, Desert Eagle, Shotgun
};
public OnFilterScriptInit()
{
WPTimer = SetTimer("WeaponChecker", 2000, true);
return 1;
}

public OnFilterScriptExit()
{
KillTimer(WPTimer);
return 1;
}
public WeaponChecker()
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
new PInvalidWeapons[13] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
for(new w = 0; w < 13; w++)
{
    new PWep, PAmmo;
GetPlayerWeaponData(i, w, PWep, PAmmo);
//Assign invalid shit to an array
if(PWep != ValidWeapons[PLAYERCLASS] && PWep != 0)
{
PInvalidWeapons[w] = PWep;
}
}
//Replace valid weapons with EMPTY = -1
if(IsPlayerVIP(i))
{
    if(PInvalidWeapons[1] == 8 || PInvalidWeapons[1] == 9) PInvalidWeapons[1] = -1;
if(PInvalidWeapons[6] != -1) PInvalidWeapons[6] = -1;
}
if(PInvalidWeapons[8] == 16 || PInvalidWeapons[8] == 18) PInvalidWeapons[8] = -1;
if(PInvalidWeapons[11] == 46) PInvalidWeapons[11] = -1;
if(PInvalidWeapons[9] == 41) PInvalidWeapons[9] = -1;
for(new w = 0; w < 13; w++)
{
    //If this happens, then that weapon was not cleared before, so its PROBABLY a hacked weapon
    //Further additions should be made incase admins CAN actually give weapons to player
    //or themselves
    if(PInvalidWeapons[w] != -1)
    {
        //BAN THIS HACKER
        //also break the loop
break;
    }
}
}
}
Since I don't have time to built a similar to PTP class selection system, I can't test it, if Jonne likes it, he can test it himself.

Basically what this does is get the weapon ID from each slot and compare it against the class weapon slot set, if anything different is found, it is added to an array and compared against possible valid weapons (VIP weapons or things like grenade or parachute), if those weapons were added to the invalid array, they are removed. Any remaining invalid weapon in the  array would mean that the dude is carrying something he is not supposed to, therefore, he/she can be banned.
« Last Edit: October 27, 2016, 08:26:42 pm by TreePuncher »

Another normal day at Hueland.

Offline Faro0s

  • VIP
  • Hero Member
  • **
  • Posts: 1113
  • Rank: Road Dawg
  • Score: 22227
  • Sniper aimbotter. -PluG
Re: AntiCheat
« Reply #3 on: October 27, 2016, 08:30:10 pm »
Should work well, and if it doesn't, a few tweaks would get it working
(I've made this real quick AND I might have gotten the weapon slots wrong)
Code: [Select]
#define FILTERSCRIPT
#include <a_samp>
forward WeaponChecker();
enum Sections
{
PRESIDENT,
VICEPRESIDENT,
SECURITY,
SWAT,
COPS,
TERRORISTS,
CIVILIANS
};
new WPTimer;
new ValidWeapons[Sections][13] =
{
{0, 2, 24, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1}, //PRESIDENT: Golf Club, Flowers, Deagle
    {0, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, //VICEPRESIDENT: Silenced Pistol
    {0, -1, -1, 26, 29, 31, -1, -1, -1, -1, -1, -1, -1}, //SECURITY: Sawn-offs, MP5, M4
    {0, -1, 24, 25, 32, -1, -1, -1, -1, -1, -1, -1, -1}, //SWAT: Deagle, Shotgun, Tec-9
    {0, -1, 24, -1, 28, 31, -1, -1, -1, -1, -1, -1, -1}, //POLICE: Deagle, UZI, M4
    {0, -1, -1, 27, 32, 30, -1, -1, -1, -1, -1, -1, -1}, //TERRORIST: Spas, AK-47, Tec-9
    {0, -1, 24, 25, -1, -1, -1, -1, -1, -1, 10, -1, -1} //CIVILIAN: Purple Dildo, Desert Eagle, Shotgun
};
public OnFilterScriptInit()
{
WPTimer = SetTimer("WeaponChecker", 2000, true);
return 1;
}

public OnFilterScriptExit()
{
KillTimer(WPTimer);
return 1;
}
public WeaponChecker()
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
new PInvalidWeapons[13] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
for(new w = 0; w < 13; w++)
{
    new PWep, PAmmo;
GetPlayerWeaponData(i, w, PWep, PAmmo);
//Assign invalid shit to an array
if(PWep != ValidWeapons[PLAYERCLASS] && PWep != 0)
{
PInvalidWeapons[w] = PWep;
}
}
//Replace valid weapons with EMPTY = -1
if(IsPlayerVIP(i))
{
    if(PInvalidWeapons[1] == 8 || PInvalidWeapons[1] == 9) PInvalidWeapons[1] = -1;
if(PInvalidWeapons[6] != -1) PInvalidWeapons[6] = -1;
}
if(PInvalidWeapons[8] == 16 || PInvalidWeapons[8] == 18) PInvalidWeapons[8] = -1;
if(PInvalidWeapons[11] == 46) PInvalidWeapons[11] = -1;
if(PInvalidWeapons[9] == 41) PInvalidWeapons[9] = -1;
for(new w = 0; w < 13; w++)
{
    //If this happens, then that weapon was not cleared before, so its PROBABLY a hacked weapon
    //Further additions should be made incase admins CAN actually give weapons to player
    //or themselves
    if(PInvalidWeapons[w] != -1)
    {
        //BAN THIS HACKER
        //also break the loop
break;
    }
}
}
}
Since I don't have time to built a similar to PTP class selection system, I can't test it, if Jonne likes it, he can test it himself.

Basically what this does is get the weapon ID from each slot and compare it against the class weapon slot set, if anything different is found, it is added to an array and compared against possible valid weapons (VIP weapons or things like grenade or parachute), if those weapons were added to the invalid array, they are removed. Any remaining invalid weapon in the  array would mean that the dude is carrying something he is not supposed to, therefore, he/she can be banned.


I don't know about scripting but thanks for the help.
I/ll inform Jonne about this.




EDIT: I discussed this matter with Jonne, i cleared my doubts thanks to jonne. This topic can be locked.
« Last Edit: October 28, 2016, 12:26:53 am by Faro0s »

Since 2010.
• Reason for the report (Go into more detail about what they did):I killed ahmed and he tried to accuse me for killing him

Offline Mark[KTP]

  • VIP
  • Jr. Member
  • **
  • Posts: 96
  • Rank: Unknown
  • Score: Unknown
  • PTP Player since 2008
Re: AntiCheat
« Reply #4 on: October 28, 2016, 12:29:33 am »
I don't know if this is the right place or not but I think there is something wrong in the AntiCheat system.

Today, there was a person spawned a minigun, he killed too many people with it, system did not ban him. Referring the report section, there is a report about someone using minigun.
So my question is, is there a problem with the anticheat or it is another script coded by Jonne?
If this is the case, I would like to suggest this, improve the anticheat.


Quote
<PBBot1>:[Terrorist ID: 21] dizzy: who coded anticheat?? idiot?
First of beginning to even think of write you should learn how to respect, and than maybe, use your nerdy fingers to write, thanks.

Offline TreePuncher

  • VIP
  • Full Member
  • **
  • Posts: 118
  • Rank: Unknown
  • Score: Unknown
Re: AntiCheat
« Reply #5 on: October 28, 2016, 12:31:46 am »
I don't know if this is the right place or not but I think there is something wrong in the AntiCheat system.

Today, there was a person spawned a minigun, he killed too many people with it, system did not ban him. Referring the report section, there is a report about someone using minigun.
So my question is, is there a problem with the anticheat or it is another script coded by Jonne?
If this is the case, I would like to suggest this, improve the anticheat.


Quote
<PBBot1>:[Terrorist ID: 21] dizzy: who coded anticheat?? idiot?
First of beginning to even think of write you should learn how to respect, and than maybe, use your nerdy fingers to write, thanks.
Maybe he meant to say that another script was interferring at the anticheat's functioning. (very unlikely, tho)

Another normal day at Hueland.

Offline Faro0s

  • VIP
  • Hero Member
  • **
  • Posts: 1113
  • Rank: Road Dawg
  • Score: 22227
  • Sniper aimbotter. -PluG
Re: AntiCheat
« Reply #6 on: October 28, 2016, 12:35:26 am »
I don't know if this is the right place or not but I think there is something wrong in the AntiCheat system.

Today, there was a person spawned a minigun, he killed too many people with it, system did not ban him. Referring the report section, there is a report about someone using minigun.
So my question is, is there a problem with the anticheat or it is another script coded by Jonne?
If this is the case, I would like to suggest this, improve the anticheat.


Quote
<PBBot1>:[Terrorist ID: 21] dizzy: who coded anticheat?? idiot?
First of beginning to even think of write you should learn how to respect, and than maybe, use your nerdy fingers to write, thanks.

MYbe you have to work on your English more.


Anyways lock this please, else those kids will spam here too by their bullshits.
« Last Edit: October 28, 2016, 09:25:41 am by Faro0s »

Since 2010.
• Reason for the report (Go into more detail about what they did):I killed ahmed and he tried to accuse me for killing him

Offline Altus_Demens

  • Admin
  • Hero Member
  • ****
  • Posts: 1119
  • Rank: Hoodsta
  • Score: 23951
Re: AntiCheat
« Reply #7 on: October 28, 2016, 10:27:17 am »
Nice work, Tree. Though it ain't optimized, but your idea is clear, and that's the main point. I don't really like infinite loops since there is the callback system, but why not? Good job.

But I'd suggest the following. Use OnPlayerDeath callback. If a killer killed a person with a weapon that ain't used by any class, he can be instantly banned. If he killed someone with a weapon of other class, well, sometimes it happens due to a very rare bug. So I'd suggest putting his nickname to some list or database which is being reset every day (or week, whatever). If he kills someone with a weapon of other class again while his name is in this list, most likely he is cheater and he can be banned instantly. Yes, this method is heuristic, but I don't think we'd ever see it banning innocent player.

As for events and duels... If a player wants to duel, he must be reclassed by the system to some 'technical' class, which can't be picked manually. Same goes for the events: the admin should reclass the participans to this class before giving them any weapons or teleporting them as well. You can allow every weapon for this class, including minigun: maybe there'd be any minigun events? :D

Maybe what I've said is obsolete and/or trivial; sorry if so, I've just put here the thoughts that have come to my head.

P.S.
First of beginning to even think of write you should learn how to respect, and than maybe, use your nerdy fingers to write, thanks.
Mark, your constant aggressive flaming against GgT is confusing me and making me sad. Yes, it wasn't very smart from Fares to put that phrase and to quote dizzy (lol) in this context. But obviously he did this due to his discourtesy, but not any evil intention. In turn, you are perfectly understanding what are you doing. You and your clan are flaming against GgT whenever possible, with the reason and without the reason. As it has already been said on the old forum, you are worse than a dog to a mailman. Where did you get this anger and these cheap attempts of self-affirmation? Was it so when you started with Reaper and Observator? I know you're a nice person, I definitely know that. But it seems that your hatred blinds you. Just think about how do you make yourself and KTP look like after such actions. At least for now you look not better (or even worse) than GgT.
I wouldn't ever think that GgT would need any apologia, lol. Sorry for the offtopic.
A paltry man and poor of mind
At all things ever mocks;
For never he knows, what he ought to know,
That he is not free from faults.

Offline Mark[KTP]

  • VIP
  • Jr. Member
  • **
  • Posts: 96
  • Rank: Unknown
  • Score: Unknown
  • PTP Player since 2008
Re: AntiCheat
« Reply #8 on: October 28, 2016, 12:01:03 pm »
First of beginning to even think of write you should learn how to respect, and than maybe, use your nerdy fingers to write, thanks.
Mark, your constant aggressive flaming against GgT is confusing me and making me sad. Yes, it wasn't very smart from Fares to put that phrase and to quote dizzy (lol) in this context. But obviously he did this due to his discourtesy, but not any evil intention. In turn, you are perfectly understanding what are you doing. You and your clan are flaming against GgT whenever possible, with the reason and without the reason. As it has already been said on the old forum, you are worse than a dog to a mailman. Where did you get this anger and these cheap attempts of self-affirmation? Was it so when you started with Reaper and Observator? I know you're a nice person, I definitely know that. But it seems that your hatred blinds you. Just think about how do you make yourself and KTP look like after such actions. At least for now you look not better (or even worse) than GgT.
I wouldn't ever think that GgT would need any apologia, lol. Sorry for the offtopic.
If you don't use the same tone, some people have hard time to understand you. Altus, you should know that in this game there are a couple of players that love to flame. I am not that kind of guy. But sometimes is necessary to teach some respect with people that don't use it cause protected by a monitor screen.
About KTP the ratio of our flame vs GgT, NO or others are 1:10. As I lead the clan we have some principles that every new member of KTP have to match in order to join the clan.

Offline Aksel

  • VIP
  • Sr. Member
  • **
  • Posts: 270
  • Rank: Unknown
  • Score: Unknown
  • Greatest of all times
Re: AntiCheat
« Reply #9 on: October 28, 2016, 08:10:16 pm »
do you think that making a good anticheat is an easy task? but there are some flitrescripts and anticheat that u can download and get them into server!


just let them talk, i really love when those clowNs talk about skills and power when both dont have any.actually its all about numbers there is no skills!and i think that fimpen has sent a warning about going outopics and talking about silly fights!
« Last Edit: October 28, 2016, 08:11:48 pm by Aksel »

Offline TreePuncher

  • VIP
  • Full Member
  • **
  • Posts: 118
  • Rank: Unknown
  • Score: Unknown
Re: AntiCheat
« Reply #10 on: October 28, 2016, 09:01:29 pm »
Nice work, Tree. Though it ain't optimized, but your idea is clear, and that's the main point. I don't really like infinite loops since there is the callback system, but why not? Good job.
Thx lol. The main idea was having a piece of code constantly checking for the players weapons (In that case, I pretty much preferred slapping another function rather than using OnPlayerUpdate).
As for the optimization part, I made that during freetime at the University, so don't expect nothing Google-worthy there.

But I'd suggest the following. Use OnPlayerDeath callback. If a killer killed a person with a weapon that ain't used by any class, he can be instantly banned. If he killed someone with a weapon of other class, well, sometimes it happens due to a very rare bug. So I'd suggest putting his nickname to some list or database which is being reset every day (or week, whatever). If he kills someone with a weapon of other class again while his name is in this list, most likely he is cheater and he can be banned instantly. Yes, this method is heuristic, but I don't think we'd ever see it banning innocent player.
Yep, it's also a valid way to deal with stuff. However it scares me that a player could somehow fake a kill with a banable weapon and get a innocent dude banned

Another normal day at Hueland.

Offline Luca_Brasi

  • VIP
  • Newbie
  • **
  • Posts: 29
  • Rank: Unknown
  • Score: Unknown
  • Miss me yet?
Re: AntiCheat
« Reply #11 on: October 29, 2016, 04:30:23 am »
Yep, it's also a valid way to deal with stuff. However it scares me that a player could somehow fake a kill with a banable weapon and get a innocent dude banned

This is a very real possibility, n00biet has a function for that. Making an anticheat is NOT easy, it took me about half a year to develop mine. More active admins / a better AC system could be really useful at this point. We've all noticed that there's been a lot more cheaters this past week for some reason.

Tree has the right idea with his script though, I think. Unless there's some weird reason why miniguns or other "class-impossible" weapons should be allowed, nobody but Tenshi can say for sure because we don't know how the script works.

Also tree, don't forget /holiday eng
« Last Edit: October 29, 2016, 04:34:06 am by Luca_Brasi »

Offline TreePuncher

  • VIP
  • Full Member
  • **
  • Posts: 118
  • Rank: Unknown
  • Score: Unknown
Re: AntiCheat
« Reply #12 on: October 29, 2016, 05:48:22 am »
Also tree, don't forget /holiday eng
I think I've scripted that thing to allow spray cans and grenades, so it shouldn't do nothing against /holiday eng...

Another normal day at Hueland.

Offline Altus_Demens

  • Admin
  • Hero Member
  • ****
  • Posts: 1119
  • Rank: Hoodsta
  • Score: 23951
Re: AntiCheat
« Reply #13 on: October 29, 2016, 06:20:27 am »
This is a very real possibility, n00biet has a function for that. Making an anticheat is NOT easy, it took me about half a year to develop mine. More active admins / a better AC system could be really useful at this point. We've all noticed that there's been a lot more cheaters this past week for some reason.
That's interesting, I didn't know about that. Of course, it must be taken into account. It seems that Tree's idea isn't kinda excess as I used to think in the beginning.
A paltry man and poor of mind
At all things ever mocks;
For never he knows, what he ought to know,
That he is not free from faults.

Offline Ege

  • VIP
  • Hero Member
  • **
  • Posts: 856
  • Rank: Loc
  • Score: 39828
  • |m|
Re: AntiCheat
« Reply #14 on: October 29, 2016, 07:12:03 am »
More active admins
This ^
I know Jonne's putting hard work to improve A/C and I really appreciate that. But still A/C is not doing its job properly and there are time spans in the day where no admins are online and we have to play with hackers ruining the server for a long time 'til hacker leaves or A/C finally bans him/her. I'm not blaming anybody, I know people has stuff to deal with in their lives. But can't we just have some new admins considering the timezones. Because what i wrote above happens in a regular basis, there are literally times we have to play with hackers. It mostly ends up with player count going below 10 though.