how to create ten chicken and ten classname
// create ten chicken
for( i=0; i<10; i++ )
{
Ent = create_entity("info_target")
...
.....
........
entity_set_string( Ent, EV_SZ_classname, CLASSNAME + i ); // CLASSNAME1 CLASSNAME2 ...... CLASSNAME10
........
......
....
}
// find ten chicken
while ( Ent = find_ent_by_class( Ent, CLASSNAME1 ) > 0 )
while ( Ent = find_ent_by_class( Ent, CLASSNAME2 ) > 0 )
....
......
.........
while Ent = find_ent_by_class( Ent, CLASSNAME10 ) > 0 )
thank you so mush
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "[engine.inc] set_rendering"
#define VERSION "1.0"
#define AUTHOR "Admin"
new Ent
new g_Model[] = {"models/chick.mdl"}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /chick","add_chicken")
}
public plugin_precache(){
precache_model(g_Model)
}
public add_chicken(id){
Ent = create_entity("info_target")
if(is_valid_ent(Ent)){
entity_set_model(Ent, g_Model)
entity_set_size(Ent,Float:{-6.0, -10.0, 0.0},Float:{6.0, 10.0, 18.0})
new Float:f_Origin[3]
entity_get_vector(id, EV_VEC_origin, f_Origin)
f_Origin[0] += 50.0
entity_set_origin(Ent, f_Origin)
entity_set_int(Ent,EV_INT_solid,SOLID_BBOX)
entity_set_string(Ent, EV_SZ_classname, CLASSNAME);
entity_set_float(Ent, EV_FL_takedamage, DAMAGE_YES)
new Float:angles[3]
angles[0] = 0.0
angles[1] = 0.0
angles[2] = 0.0
entity_set_vector(Ent,EV_VEC_angles,angles)
drop_to_floor(Ent)
}
}