'==2' was just an value example and not position to delete, the code posted is similar to original that contains ents and i;m checking if those are valid before deletion. Hmm seems like the new array is remaped as it should but why it keeps giving me those errors
PHP Code:
public remove_ents() {
new size = ArraySize(arr_ents);
if(size<1)
return;
new entid,timer,classname[32];
for (new i = 0; i < size; i++) {
if (!is_valid_ent((entid = ArrayGetCell(arr_ents, i)))) {
ArrayDeleteItem(arr_ents, i);
ArrayDeleteItem(arr_ents_time, i);
break;
}
timer = ArrayGetCell(arr_ents_time, i);
if(timer == 0) {
pev(entid, pev_classname, classname, charsmax(classname));
if(equali(classname, "GENT"))
engfunc(EngFunc_RemoveEntity, entid);
ArrayDeleteItem(arr_ents, i);
ArrayDeleteItem(arr_ents_time, i);
}
else
ArraySetCell(arr_ents_time,i, timer - 1);
}
}