As far as i remember you are doing it the right way. entites[i] is a var array and the entites are saved with handle(ENTITY*) there, right?

when warn_level is set > 1, a warning is issued, but you can ignore it. only solution is to set warn_level to 1.