Array index out of bonus
#1

Hello guys, i have a war system on my server and when i am not in a turf and i use /attack (to attack even i'm not in a turf) i get SERVER: Unknown command and in server_log this error:
Код:
[15:11:29] [debug] Run time error 4: "Array index out of bounds"
[15:11:29] [debug] AMX backtrace:
[15:11:29] [debug] #0 0016b1b8 in public IsPlayerInTurf (playerid=0, turfid=37) at D:\gamemode\gamemodes\exgaming.pwn:22304
[15:11:29] [debug] #1 001af6f4 in public cmd_attack (playerid=0, params[]=@01560ffc "") at D:\gamemode\gamemodes\exgaming.pwn:26674
[15:11:29] [debug] #2 native CallLocalFunction () from samp03svr
[15:11:29] [debug] #3 0003c25c in public OnPlayerCommandText (playerid=0, cmdtext[]=@01560fdc "/attack") at D:\gamemode\pawno\include\zcmd.inc:102
On my database I have a table with all the turfs starting from 1 to 36 (inclusive 36).

Variables:
Код:
new TurfInfo[37][zInfo],
	Turfs[37];
Line problem:

Код:
public IsPlayerInTurf(playerid, turfid)
{
	if(IsPlayerConnected(playerid))
	{
		if(turfid == -1)
		{
			return 0;
		}
		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid,x,y,z);
		if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY]) //line 26674
		{
	 		return 1;
		}
	}
	return 0;
}
Reply


Messages In This Thread
Array index out of bonus - by None1337 - 11.12.2017, 12:17
Re: Array index out of bonus - by Kane - 11.12.2017, 12:22
Re: Array index out of bonus - by None1337 - 11.12.2017, 12:29
Re: Array index out of bonus - by Kane - 11.12.2017, 12:31
Re: Array index out of bonus - by None1337 - 11.12.2017, 12:40
Re: Array index out of bonus - by DRIFT_HUNTER - 11.12.2017, 12:40
Re: Array index out of bonus - by None1337 - 11.12.2017, 12:47

Forum Jump:


Users browsing this thread: 1 Guest(s)