AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Keeping player in air (https://forums.alliedmods.net/showthread.php?t=9759)

Ced 01-29-2005 17:45

Keeping player in air
 
How could I keep a player in the air without moving. Like the jedi_grab plugin but the player would stay in one place.

Peli 01-29-2005 20:28

You could set their gravity to 0 and then change there speed to 0. Like this :
Code:
set_user_gravity(id, 0) // Not sure about this set_user_maxspeed(id, 0.0)

Ced 01-29-2005 20:46

Ok, I will try that, ty

FeuerSturm 01-29-2005 20:48

a better way would be to change his origin :wink:

Ced 01-29-2005 20:52

yes, but if I set his gravity to 0 or some number close to it (0.000000001), will he stay at that origin in the air?

Ced 01-29-2005 22:07

ok, I have another question. Say I don't want somebody to move, I would set their maxspeed to something low (btw, 0.0 doesn't work) and set their gravity to something in the thousands so they cannot jump. But how do I set it back. Is there any other way then storing a variable with their speed and gravity before you changed it. Can anyone show me an example of storing their speed and gravity as well. I can't believe I forgot how!

Thanx

TotalNoobScripter 01-29-2005 22:18

get_user_gravity and get_user_maxspeed ? Then store them if those functions exist, then change them with set_user_whatever. When you want to change them back, just set them again to the varibles stored in wherever you stored the get_user_whatever stuff.

Ced 01-29-2005 22:23

I know that, but i forget how to store them really. I thought you could do
Code:
new speed = get_user_maxspeed(id)
but that gives me a tag mismatch when i do
Code:
set_user_maxspeed(id, speed)

XxAvalanchexX 01-29-2005 22:38

get_user_maxspeed returns a float value. Additionally, 0.0 will not work, you have to use 0.1.

Ced 01-29-2005 22:54

oh, ok, is gravity an integer or a float? [edit] nvm, I got it, thanx for everyone's help


All times are GMT -4. The time now is 19:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.