Nex-AC Errori u Logu


Započeo .варнинг, Jun 01, 2020, 14:47:57 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Nex-AC mi bac neke errore u logu
Dio skripte: Linija 10707
format(ChatText[i], 128, ChatText[i+1]);
ceo taj stock
stock SendALTC(msgstr[], color[]="white")
{
	new string[ 164 ];
	format( string, sizeof( string ), "%s", msgstr );
	new f=0;
	if(PogresnaBojaALTC(color) == 0) return print("Unesena neispravna boja altchat proveri sring.");
	for(new i=0; i<MAX_LINES; i++)
	{
		if(!strlen(ChatText[i]) || ChatText[i][0] == ' ')
		{
			format(ChatText[i], 128, "%s%s", BrojeALTC(color), msgstr);
			TextDrawSetString(ChatLine[i], ChatText[i]);
			f=1;
			return 1;
		}
	}
	if(!f)
	{
		for(new i=0; i<MAX_LINES; i++)
		{
			if(i == 9) {format(ChatText[i], 128, "%s%s", BrojeALTC(color), msgstr); TextDrawSetString(ChatLine[i], ChatText[i]); return 1;}
			if(strlen(ChatText[i]) && ChatText[i][0] != ' ')
			{
				format(ChatText[i], 128, ChatText[i+1]);
				TextDrawSetString(ChatLine[i], ChatText[i]);
			}

		}
	}
	return 0;
}

Linija 18334 (oznacio sam komentarom // dole)
forward OnCheatDetected( playerid, ip_address[], type, code );
public OnCheatDetected( playerid, ip_address[], type, code ) {
	format( globalstring, sizeof(globalstring), "~r~(AC) ~w~Igrac %s - %s", ImeIgraca( playerid ), type );
	SendALTC( globalstring ); // OVO JE TA LINIJA
	return 1;
}

Nex-AC Linija 9093 (oznacio sam komentarom // dole)
static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
{
	if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0)) return 0;
	#if AC_USE_STATISTICS
		ac_sInfo[5]++;
		switch(code)
		{
			case 0..35, 37, 39, 51: ac_sInfo[0]++;
			case 36, 38, 40, 41, 50: ac_sInfo[4]++;
			case 42: ac_sInfo[1]++;
			case 47..49: ac_sInfo[3]++;
			case 43..46: ac_sInfo[2]++;
		}
	#endif
	#undef AC_USE_STATISTICS
	#if defined NO_SUSPICION_LOGS
		#pragma unused code2
	#else
		new ac_strtmp[6];
		if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
		if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
		else printf(SUSPICION_1, playerid, code, ac_strtmp);
	#endif
	#if defined OnCheatDetected
		OnCheatDetected(playerid, ip_address, type, code);
	#else
		ac_OnCheatDetected(playerid, ip_address, type, code);
	#endif
	return 0; // TO JE OVA LINIJA
}

Nex-AC Linija 6074 (oznacio sam komentarom // dole)
if(ACInfo[playerid][acACAllow][6])
		{
			#if defined VectorSize
				new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
				Float:ac_dist_set = VectorSize(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], (ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ]);
			#else
				new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
				Float:ac_dist_set = floatsqroot(floatpower(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], 2.0) + floatpower(ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], 2.0) + floatpower((ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ], 2.0));
			#endif
			if(ac_dist > 15.0 && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set > 15.0))
			{
				#if defined DEBUG
					printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[7]: %d, playerid: %d",
					pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], playerid);
				#endif
				#if defined OnCheatDetected
					ac_KickWithCode(playerid, "", 0, 6, 1);
				#endif
				return 0; // TO JE OVA LINIJA
			}
		}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
[11:49:38] [Nex-AC debug] Pickupid: 19, dist: 2327.254150, dist set: 2327.126953, acSet[7]: -1, playerid: 0
[11:49:38] [Nex-AC] Sumnjiv Igrac ID 0. Razlog: 006 (1)
[11:49:38] [debug] Run time error 4: "Array index out of bounds"
[11:49:38] [debug]  Accessing element at index 9 past array upper bound 8
[11:49:38] [debug] AMX backtrace:
[11:49:38] [debug] #0 005094fc in SendALTC (msgstr[]=@02f79304 "~r~(AC) ~w~Igrac Warning - ", color[]=@0364e5c4 "white") at F:\Users\Nikola\Desktop\LG-OGC\gamemodes\LGOGC.pwn:10707
[11:49:38] [debug] #1 005ae4b0 in public OnCheatDetected (playerid=0, ip_address[]=@001a8c7c "", type=0, code=6) at F:\Users\Nikola\Desktop\LG-OGC\gamemodes\LGOGC.pwn:18334
[11:49:38] [debug] #2 0004aa14 in ac_KickWithCode (playerid=0, ip_address[]=@001a8c7c "", type=0, code=6, code2=1) at F:\Users\Nikola\Desktop\LG-OGC\pawno\include\nex-ac.inc:9093
[11:49:38] [debug] #3 0002bc7c in public OnPlayerPickUpPickup (playerid=0, pickupid=19) at F:\Users\Nikola\Desktop\LG-OGC\pawno\include\nex-ac.inc:6074

Slika/video ingame problema(obavezno ako je ingame problem): link slike
                                                                                 
Legacy Gaming Since 2017 ©

Scripter and Founder
Scripting 3+ Years
https://www.facebook.com/LegacyGamingOGC/ (FB Stranica)
https://www.facebook.com/nikolaa.jovicic (FB Nalog)

                                                                                 

type je integer a ne string iirc ;D



Rust, Python, TypeScript, Kotlin, WebAssembly, Swift, Clojure, Elixir, Go, SQL