[Help] "Array index out of bounds"
#1

Hello, i have problems on Car Ownership...

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!ispassenger)
{
	if(VrstaVozilaInfo[vehicle[vehicleid]][Type] == 2)
	{
		if(haveveh[playerid] == 1 && TypeVehicleInfo[vehicleid][ID] == idvehicle[playerid]) { }
		else
		{
			if(VehicleInfo[idvehicle[playerid]][Locked] == 1)
			{
			new string[128];
			new Float:x, Float:y, Float:z;
			GetPlayerPos(playerid,x,y,z);
			SetPlayerPos(playerid, x, y, z+0.2);
			format(string,sizeof(string)," (Vehicle Locked!) {B5B5B5}Owner: %s", VozilaInfo[idvozila[playerid]][Vlasnik]);
			SCM(playerid, TCrvena, string);
			return 1;
			}
		}
	}
}
return 1;
}
Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at index 253 past array upper bound 199
[debug] AMX backtrace:
[debug] #0 0004a9d0 in ?? (0x00000000, 0x000000fd, 0x00000000) from -/-.amx
[debug] #1 00006080 in public OnPlayerEnterVehicle (0x00000000, 0x000000fd, 0x00000000)
I cant fix it...
Reply
#2

Ever heard of indentation? ,_,
Reply
#3

Fixed!
Reply
#4

English, please! Many of us (and that includes me) can't be bothered to translate whatever "VrstaVozilaInfo" is.
Reply
#5

sry i forgot, i translated all didnt saw that XD

VrstaVozilaInfo means TpyeVehiclesInfo
Reply
#6

BUMP anyone?
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=64144

Read the 7th bullet point.
Reply
#8

Quote:
Originally Posted by David (Sabljak)
Посмотреть сообщение
Fixed!
Quote:
Originally Posted by David (Sabljak)
Посмотреть сообщение
BUMP anyone?
wat.
Reply
#9

Quote:
Originally Posted by MP2
Посмотреть сообщение
wat.
"Ever heard of indentation? ,_, "

I fix that XD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)