AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to check for... (https://forums.alliedmods.net/showthread.php?t=22243)

Willmaker 12-22-2005 04:24

How to check for...
 
I know how FL_ONGROUND checks to see if your on the ground, but I want to know how you would check if your on the ground or at the peak of a jump etc, so basically your not moving along the z-axis, if its possible.

Cheap_Suit 12-22-2005 05:10

Code:
new Float: velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) if(velocity[2] == 0.0) { /*Insert Code*/ }

Willmaker 12-22-2005 05:15

Thanks.

Willmaker 12-22-2005 06:50

While Im at it, how do you check for horizontal speed, like running and strafing etc? It looks like it would be completely different compared to the above. After searching over 100 plugins, there isnt any code I could use as an example.

v3x 12-22-2005 07:10

lawl

Willmaker 12-22-2005 07:18

Sorry, I should of been more specific in the first place. When checking the horizontal speed, I was thinking more like a specific speed, like if they were travelling slower than a certain amount etc. Thanks for trying.

Cheap_Suit 12-22-2005 07:49

Here is an simple example. It checks the velocity of X, Y, and Z and prints them.

Code:
    new Float: Velocity[3]     entity_get_vector(id, EV_VEC_velocity, Velocity)     set_hudmessage(255, 255, 255, 0.02, 0.15, 0, 0.0, 0.1)     show_hudmessage(id, "^nVelocity^nX: %i Y: %i Z: %i", Velocity[0], Velocity[1], Velocity[2]) }

Edit:

This one add the velocity of X, Y, and Z. Thought it might be helpful.
Code:
new Speed = get_speed(id)

XxAvalanchexX 12-22-2005 13:44

http://forums.alliedmods.net/showthread.php?t=21815

Willmaker 12-22-2005 20:18

Thanks everyone. +karma for you all :)


All times are GMT -4. The time now is 15:45.

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