23.02.2009, 06:33
Well you do
So CurrentCam[playerid]'s greater value is 3.
So the SetCam's camid, from your code, range from 0 to 3, and that is 4 cameras (0, 1, 2, 3).. and your cameras array size is only 3.
I think something like this is just better than your whole if/else if:
pawn Код:
else if(CurrentCam[playerid] < 3)
SetCam(playerid,CurrentCam[playerid]+1);
So the SetCam's camid, from your code, range from 0 to 3, and that is 4 cameras (0, 1, 2, 3).. and your cameras array size is only 3.
I think something like this is just better than your whole if/else if:
pawn Код:
SetCam(playerid, (CurrentCam[playerid] + 1) & (sizeof cameras - 1));