And you must spawn it.
Made a few adjustments:
Code:
public set_mine(id) {
new Float:StartOrigin[3]
new PlayerOrigin[3]
get_user_origin(id, PlayerOrigin, 1)
StartOrigin[0] = PlayerOrigin[0] + 0.0
StartOrigin[1] = PlayerOrigin[1] + 0.0
StartOrigin[2] = PlayerOrigin[2] - 53.0
new MineEnt = create_entity("info_target")
entity_set_string(MineEnt, EV_SZ_classname, "landmine")
entity_set_model(MineEnt, "models/w_landmine_zlw.mdl")
entity_set_edict(MineEnt, EV_ENT_owner, id)
DispatchSpawn(MineEnt)
entity_set_origin(MineEnt, StartOrigin)
entity_set_size(MineEnt, Float:{-3.0, -3.0, -1.0}, Float:{3.0, 3.0, 1.0})
entity_set_int(MineEnt, EV_INT_solid, 2) /* for readability, use the HLSDK defines... SOLID_* and MOVETYPE_*. */
entity_set_int(MineEnt, EV_INT_movetype, 5)
new Float:Velocity[3]
VelocityByAim(id, 0, Velocity) /* what's the point of setting velocity 0 towards nothing ? */
entity_set_vector(MineEnt, EV_VEC_velocity, Velocity)
}
Btw, be careful when spawning the mine while player is ducking.
You could easily make one variable, use entity_get_vector(id, EV_VEC_origin, fOrigin) and use -32 or -16 if player is ducking.
__________________