03.07.2018, 09:50
Yes, that line causing it. cModel is 0 and subtracts 400 from it.
Currently, the script is faulty. pCarKey is > 0 so this means that vehicle exists but the model is none. Reasons:
1) You do not reset pCarKey if car is removed from player's vehicles.
2) You do not load model of car correctly.
Find the reason and fix it. Until then, a way to prevent it is to check model instead.
If model is 0, it will execute next iteration.
Oh and create variables outside (before) of loops, as well as show the dialog only once after the loop.
Currently, the script is faulty. pCarKey is > 0 so this means that vehicle exists but the model is none. Reasons:
1) You do not reset pCarKey if car is removed from player's vehicles.
2) You do not load model of car correctly.
Find the reason and fix it. Until then, a way to prevent it is to check model instead.
pawn Код:
new car = PlayerInfo[playerid][pCarKey][i];
if (CarInfo[car][cModel] == 0) continue;
Oh and create variables outside (before) of loops, as well as show the dialog only once after the loop.