SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/09/2015, 05:51 PM   #261
n0minal
High-roller
 
n0minal's Avatar
 
Join Date: Mar 2013
Location: Rio de Janeiro
Posts: 4,154
Reputation: 723
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Gigi-The-Beast View Post
Bug report, latest version 1.8.5:

Code:
[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?
__________________
n0minal is offline   Reply With Quote
Old 25/09/2015, 11:49 AM   #262
Gigi-The-Beast
Huge Clucker
 
Join Date: Jan 2010
Posts: 286
Reputation: 25
Default Re: Nex-AC - Anticheat system

@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:

Code:
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
Gigi-The-Beast is offline   Reply With Quote
Old 25/09/2015, 04:56 PM   #263
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,426
Reputation: 1238
Default Re: Nex-AC - Anticheat system

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

Code:
#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;
}
Pottus is offline   Reply With Quote
Old 25/09/2015, 05:56 PM   #264
JessyChaos
Big Clucker
 
Join Date: Nov 2014
Posts: 120
Reputation: 4
Default Respuesta: Nex-AC - Anticheat system

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
__________________
EvertZone Roleplay:
192.223.28.142:7777




EvertZone Roleplay:
192.223.28.142:7777
JessyChaos is offline   Reply With Quote
Old 25/09/2015, 09:19 PM   #265
Rageparadise
Banned
 
Join Date: Jun 2015
Location: play.bestsampserver.com:7777
Posts: 28
Reputation: 1
Default Re: Nex-AC - Anticheat system

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.
Rageparadise is offline   Reply With Quote
Old 25/09/2015, 09:27 PM   #266
Freshncool
High-roller
 
Freshncool's Avatar
 
Join Date: Aug 2014
Location: Kingdom of Pakistan Reputation: 9999
Posts: 1,219
Reputation: 348
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Rageparadise View Post
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
__________________
🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔
Freshncool is offline   Reply With Quote
Old 25/09/2015, 09:47 PM   #267
Rageparadise
Banned
 
Join Date: Jun 2015
Location: play.bestsampserver.com:7777
Posts: 28
Reputation: 1
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Jamester View Post
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.
Rageparadise is offline   Reply With Quote
Old 25/09/2015, 11:10 PM   #268
Gigi-The-Beast
Huge Clucker
 
Join Date: Jan 2010
Posts: 286
Reputation: 25
Default Re: Nex-AC - Anticheat system

Quote:
Originally Posted by Jamester View Post
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.
Gigi-The-Beast is offline   Reply With Quote
Old 25/09/2015, 11:57 PM   #269
Rageparadise
Banned
 
Join Date: Jun 2015
Location: play.bestsampserver.com:7777
Posts: 28
Reputation: 1
Default Re: Nex-AC - Anticheat system

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:

Code:
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?

Last edited by Rageparadise; 26/09/2015 at 10:24 AM.
Rageparadise is offline   Reply With Quote
Old 26/09/2015, 07:22 PM   #270
WoasryXxL
Little Clucker
 
Join Date: Jul 2015
Posts: 6
Reputation: 1
Default Re: Nex-AC - Anticheat system

Hello , please help me .. :
Code:
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?
WoasryXxL 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:33 AM.


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