PDA

View Full Version : Entity Grounding


Styles
04-21-2008, 15:25
I have a problem, I have one plugin that is allowing users to set their velocity at certian times. But sometimes, I want to keep them grounded. But they velocity might keep them up in the air. How would I do this? If I set their velocity to 0.0, it just puts them where they are. I want them on the ground, I don't care if they move, just keep them on the ground. I have though of a few ways just now reading through other posts, but have yet to come up with a solution. It is not an option to go into the other plugin and callfunc or something.

I though mabye setting their pev_flags to FL_ONGROUND might shove them to the ground, I'm not sure though.

if(pev(id, pev_flags) != FL_ONGROUND)
set_pev(id, pev_flags, FL_ONGROUND)

Or mabye there is a velocity solution? But I don't know.

Any suggestions are welcome :)

Thank You

Exolent[jNr]
04-21-2008, 15:32
Did you try fm_drop_to_floor() ?

Styles
04-21-2008, 15:33
o.0 They have that haha, ill look for it now, thx X-olent.. Dam there are so many FM Solutions :)

Exolent[jNr]
04-21-2008, 15:49
If that doesn't work,
you can try a traceline down to the ground underneath the player,
retrieve the origin,
and then set the player's origin 36.0 units above
(18.0 units if player is ducking).

Styles
04-21-2008, 15:53
Okay thanks haha many good ideas :)

Styles
04-22-2008, 02:38
How would you traceline below them? I have no idea how, I know you can see if the floor is it.. I mean.. But they have to look at it.

Styles
04-22-2008, 03:18
haha got it nvm :)