PDA

Просмотр полной версии : [Вопрос] debug



codeo
31.05.2014, 13:58
Подскажите что не так


CMD:spawncar2(playerid, params[])
{

SendClientMessage(playerid, COLOR_GREEN, "Вы заспавнили всесь не занятый транспорт!");
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
DestroyVehicle(mInfo[cars][car]);
}
return 1;
}





14:53:56] [debug] Run time error 4: "Array index out of bounds"
[14:53:56] [debug] Accessing element at index 111 past array upper bound 110
[14:53:56] [debug] AMX backtrace:
[14:53:56] [debug] #0 001ff398 in public cmd_spawncar2 (playerid=0, params[]=@0x000aaaf8 "") at C:\Users\user\Desktop\new_drift\mod.pwn:6992
[14:53:56] [debug] #1 native DC_CMD () [10001310] from dc_cmd.DLL
[14:53:56] [debug] #2 00000008 in public OnPlayerCommandText () at C:\Users\user\Desktop\pawnoNEW\pawnoNEW\include\float.inc:108

Транспорт создается так:

mInfo[playerid][car] = AddStaticVehicleEx(mInfo[playerid][model],mInfo[playerid][pp][0],mInfo[playerid][pp][1],mInfo[playerid][pp][2],mInfo[playerid][pp][3], random(255), random(255),30000);

DeimoS
31.05.2014, 15:35
Выход за пределы массива

CMD:spawncar2(playerid, params[])
{
SendClientMessage(playerid, COLOR_GREEN, "Вы заспавнили всесь не занятый транспорт!");
for(new cars; cars < sizeof(mInfo); cars++)
{
DestroyVehicle(mInfo[cars][car]);
}
return 1;
}