public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for (new i=1; i < MAX_HOUSES; i++) if (pickupid == Houses[i][house_pickup])
{
Players[playerid][last_house_entrance] = i;
if (IsHouseOwnedByPlayer(playerid, i)) GameTextForPlayer(playerid, "~y~Press ~r~~k~~VEHICLE_ENTER_EXIT~ ~y~to enter your house", 3000, 3);
break;
}
for(new i; i<= MAX_VEHICLE_DEALERS; i++)
{
print("1");
if(pickupid == DealershipPickup[i])
{
print("22");
new String[1000], String2[30];
for(new n; n<= 500; n++)
{
print("333");
if(BCarInfo[n][BCDealer] == i)
{
print("4444");
format(String2,sizeof(String2),"%s - $%d\n",BCarInfo[n][BCName],BCarInfo[n][BCPrice]);
strcat(String,String2);
}
}
new DialogID = 500+i;
printf("%i",playerid);
printf("%i",DialogID);
printf("%f",DealerInfo[i][VDName]);
printf("%f",String);
ShowPlayerDialog(playerid,DialogID,DIALOG_STYLE_LIST,DealerInfo[i][VDName],String,"Buy","Cancel");
print("55555");
return 1;
}
}
return 1;
}
new DialogID = 500+i;
printf("%i",playerid);
printf("%i",DialogID);
printf("%f",DealerInfo[i][VDName]);
printf("%f",String);
ShowPlayerDialog(playerid,DialogID,DIALOG_STYLE_LIST,DealerInfo[i][VDName],String,"Buy","Cancel");
print("55555");
return 1;
n<= 500
n < 500
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for (new i=1; i < MAX_HOUSES; i++) if (pickupid == Houses[i][house_pickup])
{
Players[playerid][last_house_entrance] = i;
if (IsHouseOwnedByPlayer(playerid, i)) GameTextForPlayer(playerid, "~y~Press ~r~~k~~VEHICLE_ENTER_EXIT~ ~y~to enter your house", 3000, 3);
break;
}
for(new i; i< MAX_VEHICLE_DEALERS; i++)
{
print("1");
if(pickupid == DealershipPickup[i])
{
print("22");
new String[1000], String2[30];
for(new n; n< 500; n++)
{
print("333");
if(BCarInfo[n][BCDealer] == i)
{
print("4444");
format(String2,sizeof(String2),"%s - $%d\n",BCarInfo[n][BCName],BCarInfo[n][BCPrice]);
strcat(String,String2);
}
}
new DialogID = 500+i;
printf("%i",playerid);
printf("%i",DialogID);
printf("%f",DealerInfo[i][VDName]);
printf("%f",String);
ShowPlayerDialog(playerid,DialogID,DIALOG_STYLE_LIST,DealerInfo[i][VDName],String,"Buy","Cancel");
print("55555");
return 1;
}
}
return 1;
}
[21:31:11] [debug] Run time error 4: "Array index out of bounds" [21:31:11] [debug] Accessing element at index 132 past array upper bound 131 [21:31:11] [debug] AMX backtrace: [21:31:11] [debug] #0 0000e0b8 in public OnPlayerPickUpDynamicPickup (0x00000000, 0x00000023) from MissionScript.amx [21:31:11] [debug] #1 native Streamer_CallbackHook () [73defae0] from streamer.DLL [21:31:11] [debug] #2 00000348 in public OnPlayerPickUpPickup (0x00000000, 0x00000000) from MissionScript.amx
Inside one of your loops you're trying to access an array with the index 132 but the limit is 131. Maybe MAX_PLAYERS is 131 but you're trying to loop 500 players or maybe MAX_HOUSES is 131 but the array is smaller. Maybe it's the dealerships.
|