[Include] Nex-AC - Anticheat system

Quote:
Originally Posted by AlexandreAymanito
Посмотреть сообщение
Need help on this
PHP код:
C:\Users\Equalizer\Desktop\AxSERVER\pawno\include\nex-ac.inc(3978) : error 025: function heading differs from prototype
C
:\Users\Equalizer\Desktop\AxSERVER\pawno\include\nex-ac.inc(3978) : error 029invalid expressionassumed zero
C
:\Users\Equalizer\Desktop\AxSERVER\pawno\include\nex-ac.inc(3978 -- 3980) : error 029invalid expressionassumed zero
C
:\Users\Equalizer\Desktop\AxSERVER\pawno\include\nex-ac.inc(3978 -- 3980) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors
.
[
Finished in 12.7s
Try changing the lines you include the include
Reply

Quote:
Originally Posted by Gigi-The-Beast
Посмотреть сообщение
Bug report, latest version 1.8.5:

Код:
[13:57:12] [debug] Run time error 4: "Array index out of bounds"
[13:57:12] [debug]  Accessing element at index 91 past array upper bound 46
[13:57:12] [debug] AMX backtrace:
[13:57:12] [debug] #0 0002c4c8 in public OnPlayerWeaponShot (playerid=1, weaponid=91, hittype=0, hitid=0, Float:fX=0.00000, Float:fY=0.00000, Float:fZ=0.00000) at C:\xxxx\xxxxx\****** Drive\Samp Projects\Pawno\include\nex-ac.inc:4383
[13:57:14] [debug] Run time error 4: "Array index out of bounds"
[13:57:14] [debug]  Accessing element at index 157 past array upper bound 46
[13:57:14] [debug] AMX backtrace:
[13:57:14] [debug] #0 0002c4c8 in public OnPlayerWeaponShot (playerid=1, weaponid=157, hittype=0, hitid=0, Float:fX=0.00000, Float:fY=0.00000, Float:fZ=0.00000) at C:\xxxx\xxxxxx\****** Drive\Samp Projects\Pawno\include\nex-ac.inc:4383
Line 4383: AntiCheatInfo[playerid][acAmmo][ac_WeaponSlots[weaponid]]--;


Also antidialog hack is non-working, as soon as any dialog is shown, when the player clicks a button it kicks the player with the code #039; dialog anticheat can't be disabled when adding false in static ac_ACAllow.
weaponid 91 and 157? LOL, seems like it needs a sanity check, how did you get those weapon ids?
Reply

@ipsLeon really I don't know, today I checked the server_log and more debug messages showed, same as above. The only command for player to spawn weapons server-side is an admin command , I checked admin logs and nobody tried to spawn those weapons ( I thought that maybe some admin missed the weapon ID).

Also there is an epic bug with unusable player id-s after a player crashes.
To reproduce this bug, use blank mode, add these commands:

Код:
CMD:crash(playerid,params[])
{
	new giveplayerid;
	if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, -1, "usage: /crash [ID/Nick]");
	else
	{
		GameTextForPlayer(giveplayerid, "~k~~INVALID_KEY~", 100, 5);
	}
	return 1;
}
CMD:check(playerid,params[])
{
	new giveplayerid;
	if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, -1, "usage: /check [ID/Nick]");
	else
	{
	    if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "Player offline!");
	    else SendClientMessage(playerid, -1, "Player online!");
	}
	return 1;
}
1. Connect two players on the server, player A id:0 , player B id:1
2. Check both players to see if they are "online", both will be
3. Crash player B (id:1) then disconnect player A (id:0)
4. Reconnect player B to get id: 0
5. Reconnect player A to get id: 1 (basically we swapped their ingame ID-s)
6. Check both players with command /check, you will see that ID 1 is bugged, ie. it will show that player is OFFLINE

This occurs only when the player crashes!


EDIT: this problem does not occur when Nex-AC is first under #include <a_samp>,
the problem happens when #include <nex-ac> is after #include <sscanf2> so that causes the problem, sorry that I didn't first check that
Reply

The stock sscanf "u" specifier bugs sometimes so I had to do this.

Код:
#include <YSI\y_hooks>

static PlayerNames[MAX_PLAYERS][MAX_PLAYER_NAME];

// Store players name
hook OnPlayerConnect(playerid)
{
	#if defined USE_RNPC
		if(IsPlayerNPC(playerid)) return 1;
	#endif
	
	GetPlayerName(playerid, PlayerNames[playerid], MAX_PLAYER_NAME);
	return 1;
}

// Search for players name
SSCANF:u(name[])
{
	// No name specified
	if(isnull(name)) return INVALID_PLAYER_ID;

	new id;

	// Was a part of name provided?
	if(sscanf(name, "i", id))
	{
        new matches;
        
		// Find a player return the id
		foreach(new i : Player)
		{
			// Search for part of the players name
		    if(strfind(PlayerNames[i], name, true) != -1)
			{
				matches++;
				id = i;
				if(matches > 1) return INVALID_PLAYER_ID;
			}
		}
		// Found a match
		if(matches) return id;

		// No player found return invalid player id
		return INVALID_PLAYER_ID;
	}

	// Player supplied a id

	// Make sure the id is greater than 0
	if(id < 0) return INVALID_PLAYER_ID;

	// Make sure the id is connected
	if(!IsPlayerConnected(id)) return INVALID_PLAYER_ID;

	// Return the id
	return id;
}
Reply

errores:
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(1562) : warning 219: local variable "info" shadows a variable at a preceding level
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3931) : error 025: function heading differs from prototype
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3931) : error 017: undefined symbol "checkpointid"
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3933) : error 055: start of function body without function header
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3934) : error 010: invalid function or declaration
Reply

Hey dude, first off all great work, well done, best anti cheat system out there for sure.

I found one bug, or atleast it seems to be like a bug, when I do GivePlayerMoney(playerid, 1000); inside of OnPlayerSpawn, it kicks for money hack.
Reply

Quote:
Originally Posted by Rageparadise
Посмотреть сообщение
Hey dude, first off all great work, well done, best anti cheat system out there for sure.

I found one bug, or atleast it seems to be like a bug, when I do GivePlayerMoney(playerid, 1000); inside of OnPlayerSpawn, it kicks for money hack.
Isn't a bug, you're using the standard SA-MP function.
acc_GivePlayerMoney
Reply

Quote:
Originally Posted by Jamester
Посмотреть сообщение
Isn't a bug, you're using the standard SA-MP function.
acc_GivePlayerMoney
So all I gotta do is use acc_GivePlayerMoney(playerid, amount); instead?

EDT: Just did that, didn't work, please tell me what function I need to use instead.
Reply

Quote:
Originally Posted by Jamester
Посмотреть сообщение
Isn't a bug, you're using the standard SA-MP function.
acc_GivePlayerMoney
That is not correct, all functions and callbacks are hooked, so you can use normal functions. Check the code.
Reply

Another bug that I found is that if you use GivePlayerWeapon inside onplayerspawn and if you spawn too quick you'll get kicked for weapon hack.

So what I do is.. I wait like, 10 to 20 seconds in the player selection skin thingy and then I press spawn button and I don't get kicked, it's quite a weird bug.

EDT: Why when I do this:

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	printf("%d", vehicleid);
	printf("%d", Veh[playerid]);
	if(vehicleid != Veh[playerid] && ispassenger == 0)
	{
        new Float:x, Float:y, Float:z;
		PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
		GetPlayerPos(playerid,x,y,z);
		SetPlayerPos(playerid,x,y,z+4);
	}
	return 1;
}
as soon as I try to carjack someone it kicks me for teleport hack (onfoot)

Why can't I use setplayerpos?
Reply

Hello , please help me .. :
Код:
E:\pawno\include\nex-ac.inc(157 : warning 219: local variable "info" shadows a variable at a preceding level
E:\pawno\include\nex-ac.inc(2287) : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(2301) : error 025: function heading differs from prototype
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(5351) : error 025: function heading differs from prototype
E:\pawno\include\mSelection.inc(590) : warning 201: redefinition of constant/macro (symbol "OnPlayerClickPlayerTextDraw")
E:\pawno\include\YSI\y_hooks/impl.inc(1752) : warning 201: redefinition of constant/macro (symbol "OnVehicleDamageStatusUpdate")
E:\pawno\include\YSI\y_hooks/impl.inc(3213) : warning 201: redefinition of constant/macro (symbol "OnPlayerSelectDynamicObject")
How to resolve it?
Reply

Quote:
Originally Posted by Gigi-The-Beast
Посмотреть сообщение
Also antidialog hack is non-working, as soon as any dialog is shown, when the player clicks a button it kicks the player with the code #039; dialog anticheat can't be disabled when adding false in static ac_ACAllow.
I am using easydialogs include, maybe that is causing the problem.
Maybe it's because you included easydialogs with nex-ac, but.. I recommend to disable or enable detections via EnableAntiCheatForPlayer or via config-file

Quote:
Originally Posted by JessyChaos
Посмотреть сообщение
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3931) : error 025: function heading differs from prototype
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3931) : error 017: undefined symbol "checkpointid"
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3933) : error 055: start of function body without function header
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(3934) : error 010: invalid function or declaration
Use latest version of nex-ac (1.8.5 for now)

Quote:
Originally Posted by Rageparadise
Посмотреть сообщение
I found one bug, or atleast it seems to be like a bug, when I do GivePlayerMoney(playerid, 1000); inside of OnPlayerSpawn, it kicks for money hack.
Quote:
Originally Posted by Rageparadise
Посмотреть сообщение
Another bug that I found is that if you use GivePlayerWeapon inside onplayerspawn and if you spawn too quick you'll get kicked for weapon hack.
It seems there are some problems with the hooked functions.
I'm not entirely sure because of what it could be, but I can advise (if somewhere else there is hook for these functions) to make them like in Hook Method 7

Quote:
Originally Posted by WoasryXxL
Посмотреть сообщение
Код:
E:\pawno\include\nex-ac.inc(2287) : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(2301) : error 025: function heading differs from prototype
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(532 : warning 202: number of arguments does not match definition
E:\pawno\include\nex-ac.inc(5351) : error 025: function heading differs from prototype
E:\pawno\include\mSelection.inc(590) : warning 201: redefinition of constant/macro (symbol "OnPlayerClickPlayerTextDraw")
E:\pawno\include\YSI\y_hooks/impl.inc(1752) : warning 201: redefinition of constant/macro (symbol "OnVehicleDamageStatusUpdate")
E:\pawno\include\YSI\y_hooks/impl.inc(3213) : warning 201: redefinition of constant/macro (symbol "OnPlayerSelectDynamicObject")
How to resolve it?
1. Update your server to version R2-1 (including all files in pawno/include folder).
2. Try to include mSelection and YSI before nex-ac

Quote:
Originally Posted by WoasryXxL
Посмотреть сообщение
Код:
E:\pawno\include\nex-ac.inc(157 : warning 219: local variable "info" shadows a variable at a preceding level
Quote:
Originally Posted by JessyChaos
Посмотреть сообщение
errores:
D:\TODOJO~1\dz\dz\pawno\include\nex-ac.inc(1562) : warning 219: local variable "info" shadows a variable at a preceding level
Rename "info" in nex-ac (on lines 1578 and 1580) for example in "ac_info"
Reply

Quote:
Originally Posted by OstGot
Посмотреть сообщение
Maybe it's because you included easydialogs with nex-ac, but.. I recommend to disable or enable detections via EnableAntiCheatForPlayer or via config-file


Use latest version of nex-ac (1.8.5 for now)



It seems there are some problems with the hooked functions.
I'm not entirely sure because of what it could be, but I can advise (if somewhere else there is hook for these functions) to make them like in Hook Method 7


1. Update your server to version R2-1 (including all files in pawno/include folder).
2. Try to include mSelection and YSI before nex-ac



Rename "info" in nex-ac (on lines 1578 and 1580) for example in "ac_info"
Thanks , and still a problem .
Kick Info: [Nex-AC] Suspiciune de la ID 0. Motiv cod: 052 (1)
Code:
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(weaponid == 34) SetPlayerHealth(playerid,0);
    if(weaponid == 1) SetPlayerHealth(playerid,0);
    if(IsPlayerInRangeOfPoint(playerid, 50.0, 1802.9991,-1855.2661,13.4141) && (playerVariables[issuerid][pGroup] > 3 || playerVariables[issuerid][pGroup] == 0))
	{
	    new Float:health;
    	GetPlayerHealth(playerid,health);
    	SetPlayerHealth(playerid, health);
 		SetPlayerArmedWeapon(issuerid, 0);
		return 0;
	}
How resolve?
Reply

I'm not sure if any one posted this problem again, when you are in custom maps it does return false warnings for fly hack.
Reply

Really nice job. I have been looking for something like this. +REP
Reply

Quote:

C:\Users\xxx\Desktop\ppp\pawno\include\nex-ac.inc(228 : warning 202: number of arguments does not match definition
C:\Users\xxx\Desktop\ppp\pawno\include\nex-ac.inc(2302) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.
plz help for fix bug
Reply

Quote:
Originally Posted by br155
Посмотреть сообщение
plz help for fix bug
I just tried compiling the standard bare script with the latest nex-ac.inc and english language file, and it compiled fine for me. Can you verify that you're on the latest version, and that you haven't altered anything inside the include? If you still get this issue when compiling with the latest (and unaltered) version of the nex-ac include, please try and remember what the last thing was that you added, prior to this error popping up. You can post back with the results ;p

EDIT

Just checked the code inside the include, and it seems the issue is with the OnPlayerTakeDamage callback. Be sure that you have the latest SA-MP includes. You can get them by downloading the latest SA-MP server package right here.
Reply

I followed what you have posted about YSI but still warnings..
PHP код:
pawno\include\mSelection.inc(589) : warning 201redefinition of constant/macro (symbol "OnPlayerClickPlayerTextDraw")
pawno\include\YSI\y_hooks/impl.inc(1752) : warning 201redefinition of constant/macro (symbol "OnVehicleDamageStatusUpdate")
pawno\include\YSI\y_hooks/impl.inc(3221) : warning 201redefinition of constant/macro (symbol "OnPlayerSelectDynamicObject")
pawno\include\YSI\y_hooks/impl.inc(3268) : warning 201redefinition of constant/macro (symbol "OnPlayerPickUpDynamicPickup"
NOTE: FIXED! I just moved my Y_Commands above the anti cheat include
Reply

Help me
PHP код:
... pawno\include\nex-ac.inc(2302) : error 025: function heading differs from prototype
... pawno\include\nex-ac.inc(5362) : error 025: function heading differs from prototype 
Reply

Quote:
Originally Posted by Maathy
Посмотреть сообщение
Help me
PHP код:
... pawno\include\nex-ac.inc(2302) : error 025: function heading differs from prototype
... pawno\include\nex-ac.inc(5362) : error 025: function heading differs from prototype 
Try updating your samp's includes to 0.3.7 ones
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)