SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 14/02/2017, 02:07 PM   #611
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 406
Reputation: 32
Default Re: Nex-AC - Anticheat system

PHP Code:
E:\V1-1.1.1\pawno\include\nex-ac.inc(5621) : warning 202number of arguments does not match definition
E
:\V1-1.1.1\pawno\include\nex-ac.inc(5635) : error 025: function heading differs from prototype 
PHP Code:
 #if defined _inc_y_hooks || defined _INC_y_hooks
    
hook OnVehicleDeath(vehicleidkillerid)
#else
    
public OnVehicleDeath(vehicleidkillerid)
#endif
{
    if(
killerid != 65535)
    {
        new 
ac_i GetTickCount();
        if(
ACInfo[killerid][acACAllow][49])
        {
            if(
ac_i ACInfo[killerid][acCall][15] + ac_Mtfc[15][0]) ac_FloodDetect(killerid15);
            else if(
ac_i ACInfo[killerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(killerid27);
            else 
ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
        }
        
ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_i;
    }
    new 
Float:ac_vhealth;
    
GetVehicleHealth(vehicleidac_vhealth);
    if(
ac_vhealth 250.0ACVehInfo[vehicleid][acSpawned] = false;
    
#if !defined _inc_y_hooks && !defined _INC_y_hooks\
        
&& defined ac_OnVehicleDeath
        
return ac_OnVehicleDeath(vehicleidkillerid); //Here
    #else
        
return 1;
    
#endif
}

#if !defined _inc_y_hooks && !defined _INC_y_hooks
    #if defined _ALS_OnVehicleDeath
        #undef OnVehicleDeath
    #else
        #define _ALS_OnVehicleDeath
    #endif
    #define OnVehicleDeath ac_OnVehicleDeath
    #if defined ac_OnVehicleDeath
        
forward ac_OnVehicleDeath(vehicleidkillerid); //Here
    #endif
#endif 
How to solve this?
Banditul18 is offline   Reply With Quote
Old 14/02/2017, 06:51 PM   #612
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 955
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Banditul18 View Post
How to solve this?
Find in your gamemode public "OnVehicleDeath" and add the "killerid" parameter (most likely you don't have it)


New Version v1.9.20

Changes:
* Minor improvements in code

Fixes:
* Fixed a bug in the anti-pickup hack with a kick for a teleport on the pickup position
* Fixed RemovePlayerFromVehicle function

Download: GitHub
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 15/02/2017, 02:51 AM   #613
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,698
Reputation: 1177
Default Re: Nex-AC - Anticheat system

I haven't viewed your code completely but the idea of having this to be included on every filterscripts is a bad idea. You could rather have a secondary include which contains remote calls to the master include for hooking functions and this secondary include can be used in filterscripts to save memory and avoid useless checks.

For instance, if you consider the callback OnPlayerSpawn - It has everything in common with gamemode and filterscript, so why would it be necessary to have your code work under OnPlayerSpawn for both gamemode and other filterscripts? If there's 16 filterscripts loaded using OnPlayerSpawn, a total of 17 checks are performed where only 1 is required.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 15/02/2017, 11:54 AM   #614
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 955
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Lordzy View Post
I haven't viewed your code completely but the idea of having this to be included on every filterscripts is a bad idea. You could rather have a secondary include which contains remote calls to the master include for hooking functions and this secondary include can be used in filterscripts to save memory and avoid useless checks.

For instance, if you consider the callback OnPlayerSpawn - It has everything in common with gamemode and filterscript, so why would it be necessary to have your code work under OnPlayerSpawn for both gamemode and other filterscripts? If there's 16 filterscripts loaded using OnPlayerSpawn, a total of 17 checks are performed where only 1 is required.
No, it is not so.

For a better understanding how include works, I will give a small example:
PHP Code:
//including a_samp, lang file, etc
#include <a_samp>

#if !defined FILTERSCRIPT //Check for filterscript
//Isn't fs?
//=> Code only for gamemode (defines, arrays, enums)
#define USE_IN_GAMEMODE

static const UseInGamemode;

enum UseInGM
{
}

//Public functions
public ac_GivePlayerMoney(playeridmoney)
{
    if(!
GivePlayerMoney(playeridmoney)) return 0;
    
//...
    
return 1;
}
//which will be called from hooked functions in fs throuth "CallRemoteFunction" (or if it's a gm, public will be called directly) below
#endif //End of code for gamemode

//So now there is a code for gm & fs
//For example, hooked functions which will call the same public funtion
acc_GivePlayerMoney(playeridmoney)
{
    
#if defined FILTERSCRIPT
        
CallRemoteFunction("ac_GivePlayerMoney""ii"playeridmoney); //Fs, need to be called from gm
    #else
        
ac_GivePlayerMoney(playeridmoney); //GM, so call directly
    #endif
}

//^ Hook method 7 for GivePlayerMoney ^

#if !defined FILTERSCRIPT //Check again
//It is gamemode
//So we have all anticheat checks with hooks of publics, own timers and more here

#if defined _inc_y_hooks || defined _INC_y_hooks
    
hook OnPlayerSpawn(playerid)
#else
    
public OnPlayerSpawn(playerid)
#endif
{
    
//...
}

//^ Hook for OnPlayerSpawn ^

#endif //At the end of file 
So we don't have unnecessary code for filterscript, also don't have excess include.

However user must declare in each filterscript appropriate macro ("#define FILTERSCRIPT" before including the anticheat), or all of these tricks will be useless
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 23/02/2017, 07:23 PM   #615
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 406
Reputation: 32
Default Re: Nex-AC - Anticheat system

When a car falls through ground(DynamicObject) player get kicked because of Teleport Hack(vehicle to player)
Debug print:
PHP Code:
[22:13:32] [Nex-AC debugDistance93.503700old pos diff1.035202pos z: -57.717510vehicleid157
[22:13:32] [Nex-ACSuspicion on the ID 0. Reason code005 


Edit:
Another bug , i have this cmd:
PHP Code:
CMD:givegun(playeridparams[])
{
    
LevelCheck(playerid,5);
    new 
targetweap[32], ammo;
    if(
sscanf(params"us[32]i"targetweapammo)) return SendClientMessage(playeridCOLOR_ORANGE"[*][*]Use: /givegun [playerid/name] [weaponid/name] [ammo]");
    if(
target == INVALID_PLAYER_ID && !IsPlayerConnected(target)) return SendClientMessage(playeridCOLOR_ORANGE"[*] Enter a valid player ID/name!");

    new 
WeapNames[48][32] = {
        {
"Unarmed (Fist)"},        {"Brass Knuckles"},        {"Golf Club"},        {"Night Stick"},
        {
"Knife"},        {"Baseball Bat"},        {"Shovel"},        {"Pool Cue"},
        {
"Katana"},        {"Chainsaw"},        {"Purple Dildo"},        {"Big White Vibrator"},
        {
"Medium White Vibrator"},        {"Small White Vibrator"},        {"Flowers"},        {"Cane"},
        {
"Grenade"},        {"Teargas"},        {"Molotov"},        {" "},        {" "},        {" "},
        {
"Colt 45"},        {"Colt 45(Silenced)"},        {"Deagle"},        {"Normal Shotgun"},        {"Sawnoff Shotgun"},
        {
"Combat Shotgun"},        {"Micro Uzi(Mac 10)"},        {"SMG(MP5)"},        {"AK47"},        {"M4"},
        {
"Tec9"},        {"Country Rifle"},        {"Sniper Rifle"},        {"Rocket Launcher"},
        {
"Heat-Seeking Rocket Launcher"},        {"Flamethrower"},        {"Minigun"},        {"Satchel Charge"},
        {
"Detonator"},        {"Spray Can"},        {"Fire Extinguisher"},        {"Camera"},        {"Night Vision Goggles"},
        {
"Infrared Vision Goggles"},        {"Parachute"},        {"Fake Pistol"}
    }, 
weapon = -1;
    for(new 
w48w++) if(strfind(WeapNames[w], weaptrue) != -1) { weapon w; break; }
    if(
weapon == -1weapon strval(weap);
    if(
weapon || weapon 47) return SendClientMessage(playeridCOLOR_ORANGE"[*] Enter a valid weapon ID!");
    
GivePlayerWeapon(targetweaponammo);
    new  
string[128];
    
//GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    
GetPlayerName(targetweapMAX_PLAYER_NAME);

    
format(stringsizeof (string), "Adminul %s ti-a dat un/o %s cu %i munitie!"pName(playerid), WeapNames[weapon], ammo);
    
SendClientMessage(targetCOLOR_ROYALBLUEstring);

    return 
1;

But when i give a gun , the player gets infinite ammo , if you shot no ammo go away , i give 7 bulles to deagle i shot 3 times , ammo still at 7 bullets and get kicked because of ammo hack

Debug:
PHP Code:
[11:14:57] [Nex-AC debugWeaponid24AC ammo4ammo7
[11:14:57] [Nex-ACSuspicion on the ID 0. Reason code017 (2

Last edited by Banditul18; 24/02/2017 at 08:22 AM.
Banditul18 is offline   Reply With Quote
Old 25/02/2017, 09:36 AM   #616
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 955
Reputation: 333
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Banditul18 View Post
When a car falls through ground(DynamicObject) player get kicked because of Teleport Hack(vehicle to player)
Debug print:
PHP Code:
[22:13:32] [Nex-AC debugDistance93.503700old pos diff1.035202pos z: -57.717510vehicleid157
[22:13:32] [Nex-ACSuspicion on the ID 0. Reason code005 
Do not kick a player for this code if you use OnCheatDetected in your script.

Quote:
Originally Posted by Banditul18 View Post
But when i give a gun , the player gets infinite ammo , if you shot no ammo go away , i give 7 bulles to deagle i shot 3 times , ammo still at 7 bullets and get kicked because of ammo hack
How is a player gets infinite ammo?
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 25/02/2017, 09:45 AM   #617
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,151
Reputation: 215
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by OstGot View Post
Do not kick a player for this code if you use OnCheatDetected in your script.


How is a player gets infinite ammo?
Infinite ammo is 9999+ ammo if im not mistaking. I think it can also be added with 0x7F800000 (from samp wiki for health)
DRIFT_HUNTER is offline   Reply With Quote
Old 25/02/2017, 11:18 AM   #618
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 406
Reputation: 32
Default Re: Nex-AC - Anticheat system

No not infinite ammo, but it never consume , i have 7 bullets i use 3 but still 7 bullets i have.....I mean, i give it to me a deagle with 7 bullets and shot 3 of them but show me that i have still 7 bullets and the anticheat think i have ammo hack because the bullets still there.....
Like the debug show, ac ammo is 4 , but ammo is 7....
I used 3 bullets but still 7 bullets i have....

I dont know how to explain this well

Edit: Aparently its not from the anticheat this bug , sorry

Last edited by Banditul18; 25/02/2017 at 03:15 PM.
Banditul18 is offline   Reply With Quote
Old 27/02/2017, 08:22 PM   #619
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montréal, Québec, Canada
Posts: 285
Reputation: 26
Default Re: Nex-AC - Anticheat system

Hello,
every time someone connects to my server they trigger the Anti-Invisible hack,
Also when they start the tutorial, I assume there is a bug with spectating, as both those step uses it.

Thank you,
rt-2
__________________
rt-2
-------------------------------------------------
rt-2 is online now   Reply With Quote
Old 02/03/2017, 02:13 PM   #620
Dutheil
Gangsta
 
Dutheil's Avatar
 
Join Date: Jul 2014
Location: France
Posts: 507
Reputation: 221
Default Re: Nex-AC - Anticheat system

FlyHack Vehicle is detected when any player is in a bicycle (per example) and he climbs a mountain with a steep slope.
__________________
#PrayForFrenchForum
GitHub

pawn Code:
print({1466458484, 543452960, 2037347616, 1952999790, 1797286260, 544694643, 543649646, 1851859053, 1634428192, 1056964608});
Dutheil 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
Working AntiCheat system mrxqware Scripting Help 4 02/05/2014 11:04 AM
[Include] System AntiCheat V1.1 Glad2BeHere Includes 13 04/03/2013 07:33 PM
-AntiCheat System geohareas Scripting Help 5 08/01/2013 06:38 PM
[FilterScript] [FS] ZAdmin v1.0 | ADMIN SYSTEM + REGISTER + ANTICHEAT + ANTIFLOOD + ANTISWEAR. [ZFM]Zuc Filterscripts 24 25/05/2011 09:19 AM


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


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