This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Gravity setting bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 02-04-2015 , 05:32   Gravity setting bug
Reply With Quote #1

Hello! I have encountered a bug with gravity setting. It gets set to 750, but I can't jump. Also, falling the smallest distance (fy_snow grenade spot) gets me killed immediately, like the gravity would be a huge value, when it's actually supposed to be smaller than default, 750 instead of 800.

Firstly, it was
Code:
set_user_gravity(id, 750.0)
and that got me the bug. I changed it to
Code:
set_user_gravity(id, (Float:750))
hoping that that will somehow do something to get it fixed. But that's the only idea I've got. Besides of that, I'm clueless. What's causing the bug and how could I fix it? Thank you, guys!

EDIT: Actually, I shouldn't say that I can't jump, considering the huge falling damage, suggesting the gravity acts like it's huge. Let's say I'm jumping like the gravity is huge, meaning that I don't even seem to move upwards.
__________________
~ Swiftly and with style ~

Last edited by EpicKiller; 02-04-2015 at 05:38.
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-04-2015 , 05:39   Re: Gravity setting bug
Reply With Quote #2

Do the calculation like: set_gravity/default_gravity
Default gravity for most servers is 800, so 750.0/800.
PHP Code:
set_user_gravity(id750.0/800
__________________

Last edited by HamletEagle; 02-04-2015 at 05:39.
HamletEagle is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 02-04-2015 , 05:45   Re: Gravity setting bug
Reply With Quote #3

The "/" is division? Thank you! But could you please explain why, so I would understand what's causing the issue, to know for future ideas?
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-04-2015 , 06:00   Re: Gravity setting bug
Reply With Quote #4

Yes, / is for division. Well, default gravity is 1.0(800) you need to do conversion as described above to obtain a good result.
__________________

Last edited by HamletEagle; 02-04-2015 at 06:03.
HamletEagle is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 02-04-2015 , 06:05   Re: Gravity setting bug
Reply With Quote #5

Alright, got it. Thank you so much for the quick fix and explanation!
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
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 15:37.


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