I made a plugin that should allow me to copy an ent (at least i think so)
Code:
public copyent (id,level,cid){
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new target,bodypart, arg [64]
get_user_aiming (id,target,bodypart)
entity_get_string(target,EV_SZ_model,arg,63)
if (equal(arg,"models/player.mdl"))
return PLUGIN_HANDLED
new entnum
new Float:arg2 [3]
entity_get_string(target,EV_SZ_classname,arg,63)
entnum=create_entity(arg)
entity_set_edict(entnum, EV_ENT_pContainingEntity, entity_get_edict(target, EV_ENT_pContainingEntity))
entity_get_vector(target,EV_VEC_absmin,arg2)
entity_set_vector(entnum, EV_VEC_absmin, arg2)
entity_get_vector(target,EV_VEC_absmax,arg2)
entity_set_vector(entnum, EV_VEC_absmax, arg2)
entity_get_vector(target,EV_VEC_mins,arg2)
entity_set_vector(entnum, EV_VEC_mins, arg2)
entity_get_vector(target,EV_VEC_maxs,arg2)
entity_set_vector(entnum, EV_VEC_maxs, arg2)
entity_get_vector(target,EV_VEC_size,arg2)
entity_set_vector(entnum, EV_VEC_size, arg2)
entity_set_int(entnum, EV_INT_movetype, entity_get_int(target, EV_INT_movetype))
entity_set_int(entnum, EV_INT_solid, entity_get_int(target, EV_INT_solid))
entity_set_int(entnum, EV_INT_modelindex, entity_get_int(target, EV_INT_modelindex))
entity_set_int(entnum, EV_INT_spawnflags, entity_get_int(target, EV_INT_spawnflags))
entity_set_int(entnum, EV_INT_flags, entity_get_int(target, EV_INT_flags))
entity_get_string(target,EV_SZ_model,arg,63)
entity_set_string(entnum, EV_SZ_model, arg);
return PLUGIN_HANDLED
}
the problem is it copies everything but the fact that the ent in the world (i can't move it around, also made, and u can walk through it). Anyone know the problem?