Hi all ;).
I have this code to move the player to which this aim.
PHP Code:
public f_user_jump(id) {
if (is_user_alive(id)) {
new old_or[3], new_or[3]
get_user_origin(id, old_or)
get_user_origin(id, new_or, 3)
new_or[0] += (( new_or[0] - old_or[0] > 0) ? -50 : 50)
new_or[1] += (( new_or[1] - old_or[1] > 0) ? -50 : 50)
new_or[2] += 20
set_user_origin(id, new_or)
if(user_jump_stuck(id)) {
set_user_origin(id, old_or)
}
}
return PLUGIN_HANDLED
}
stock user_jump_stuck(id) {
new Float:origin[3]
pev(id, pev_origin, origin)
engfunc(EngFunc_TraceHull, origin, origin, IGNORE_MONSTERS, pev(id, pev_flags ) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN, id, 0)
return get_tr2(0, TR_StartSolid)
}
When the player moves, it goes straight to where it was pointing, but it moves to the side or slightly above. As I can make it go where it points without being pinched on the wall?
And finally, are there a better way to do this?.
Thanks and sorry for my English. Bye ^^.