What's wrong here?
#1

Код:
	if(hittedplaya[issuerid] >= 4)
	{
		if(PoliceDuty[playerid] == 1)
		{
			if(PI[issuerid][pWanted] < 1)
			{	
				PI[issuerid][pWanted] += 4;		
				DidACrime(issuerid, 255, "Attack on federal agents");
				lz_SetPlayerWantedLevel(issuerid, PI[issuerid][pWanted]);
				SaveAccount(issuerid);
			}	
		}
		else
		{	
			if(PI[issuerid][pWanted] < 1)
			{	
				PI[issuerid][pWanted] += 4;		
				DidACrime(issuerid, 255, "Attacking People");
				lz_SetPlayerWantedLevel(issuerid, PI[issuerid][pWanted]);
				SaveAccount(issuerid);
			}	
		}				
	}
and i get this error
Код:
[02:57:10] [debug] Run time error 4: "Array index out of bounds"
[02:57:10] [debug]  Accessing element at index 65535 past array upper bound 499
[02:57:10] [debug] AMX backtrace:
[02:57:10] [debug] #0 00790c88 in ?? (0, 65535, 1084122727, 54, 3) from RPG.amx
[02:57:10] [debug] #1 0000dc94 in public OnPlayerTakeDamage (0, 65535, 1084122727, 54, 3) from RPG.amx
Reply
#2

Means you aren't checking if the INVALID_PLAYER_ID is the issuer, and making code to cope with that out of bounds error.
Reply
#3

Check if issuerid is not INVALID_PLAYER_ID before processing it

Edit: sew_sumi was faster
Reply
#4

thanks both of you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)