SA-MP Forums Archive
Wierd AMX backtrace error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Wierd AMX backtrace error (/showthread.php?tid=521315)



Wierd AMX backtrace error - Zigonja - 22.06.2014

This is spamming in mine server_log each second, and it also causes lag.


The AMX backtrace

Код:
[19:13:10] [debug] AMX backtrace:
[19:13:10] [debug] #0 00170934 in ?? (0x00000015) from ZRP.amx
[19:13:10] [debug] #1 0016c7a4 in public NOPSetPlayerPos () from ZRP.amx
[19:13:11] [debug] Run time error 4: "Array index out of bounds"
[19:13:11] [debug]  Accessing element at index 9 past array upper bound 8
This is what I have under gamemode init
Код:
SetTimer("NOPSetPlayerPos", 1000, true);
The function
Код:
forward NOPSetPlayerPos();
public NOPSetPlayerPos()
{
    // NOP Vehicle Cheat
    foreach(new i : Player)
    {
	    if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
		{
		    if(IsLeoVehicle(GetPlayerVehicleID(i)) && PlayerInfo[i][pFac] != 1 || IsTruckerVehicle(GetPlayerVehicleID(i)) && PlayerInfo[i][pJob] != JOB_TRUCKER)
		    {
			    new string[128];
			    format(string, sizeof(string), "AdmWarn: %s is either desynced or using NOP hacks. (Driving Restricted Vehicle)", RPN(i));
			    SendAdminMessage(COLOR_DARKRED, 1, string);
			    RemovePlayerFromVehicle(i);
		    }
		}
	}
	return 1;
}



Re: Wierd AMX backtrace error - Excel™ - 22.06.2014

The stock functions may cause the lag or crash, try fixing them or post here.


Re: Wierd AMX backtrace error - Konstantinos - 22.06.2014

You should really compile with -d3: https://github.com/Zeex/samp-plugin-...ith-debug-info

It might caused from a function inside NOPSetPlayerPos and at the moment, the information crashdetect gave are not all. Post IsLeoVehicle and IsTruckerVehicle functions.