Here. hook what the clcmd to the said_stick function and add some extra parameters here in there to round it out.
Code:
new offset[3][33]
new stuckto[33]
public client_PreThink(id)
{
new origin[3]
get_user_origin(stuckto[id],origin)
origin[0] += offset[0][id]
origin[1] += offset[1][id]
origin[2] += offset[2][id]
set_user_origin(stuckto[id],origin)
}
public said_stick(id)
{
new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
new ent = find_ent_in_spere(id,origin,34.0)
if(!ent)
{
client_print no ent
return PLUGIN_HANDLED
}
stuckto[ent]=id
new origin2[3]
get_user_origin(ent,origin2)
offset[0][ent] = origin2[0] - floatround(origin[0])
offset[1][ent] = origin2[1] - floatround(origin[1])
offset[2][ent] = origin2[2] - floatround(origin[2])
return PLUGIN_HANDLED
}