I don't know what you want to do, but for applying a material, use the entity material parameter. Despite the "mtl" in the function name, ent_mtlset sets a skin material only, and won't affect the material of your entity.

http://manual.conitec.net/aent_mtlset.htm