for(new i = object; i < last_created_object+1; i++) if(GetObjectModel(i) == 7497) // if model is 7497 SetObjectMaterial(i, 0, 18202, "w_towncs_t", "hatwall256hi", 0xFFFFFFFF);