Raised This Month: $ Target: $400
 0% 

Set entity gravity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 15:00   Set entity gravity?
Reply With Quote #1

[SOLVED]

Is it possible to set gravity on a specific entity?
I need the c4 to drop to the ground very fast so players wont get stuck on it.

How would I do this?

Thanks

Last edited by suhdude; 11-11-2017 at 17:08.
suhdude is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-11-2017 , 15:14   Re: Set entity gravity?
Reply With Quote #2

fakemeta - set_pev(entity, pev_gravity, amount)
engine - entity_set_float(entity, EV_FL_gravity, amount)
__________________

Last edited by OciXCrom; 11-11-2017 at 16:47.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 16:44   Re: Set entity gravity?
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
fakemeta - pev(entity, pev_gravity, amount)
engine - entity_set_float(entity, EV_FL_gravity, amount)
Like this?

Code:
        new iBombah = create_entity( "weapon_c4" );         entity_set_float(iBombah, EV_FL_gravity, 50000)

Also tried:

Code:
        new Bombah = create_entity( "weapon_c4" );         pev(Bombah, pev_gravity, 50000)

I see no difference, must have done something wrong.

Last edited by suhdude; 11-11-2017 at 16:49.
suhdude is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-11-2017 , 16:48   Re: Set entity gravity?
Reply With Quote #4

set_pev*

The number should be a float. 50000 is way too much. Try 10.0. If you don't see a difference, the problem is elsewhere in your code.
__________________

Last edited by OciXCrom; 11-11-2017 at 16:49.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 16:57   Re: Set entity gravity?
Reply With Quote #5

Edit: Problem solved, thank you!

Last edited by suhdude; 11-11-2017 at 17:07.
suhdude is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:08.


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