Raised This Month: $105 Target: $400
 26% 

Controll Gravity


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff        Approver:   GHW_Chronic (70)
Silencer123
Veteran Member
Join Date: Jul 2006
Location: Germany (GMT+1)
Old 09-06-2006 , 18:01   Controll Gravity
Reply With Quote #1

Very Simple Plugin.
(Only for Servers using custom Gravity)
What it does is this:
While holding your Jump-Key your Gravity will change
to the Float-Value defined in CVar amx_congrav_on
and if you leave the Jump-Key it will go back to the
Float-Value defined in amx_congrav_off.
First: Set your Servers sv_gravity to 800.
The Commands:
amx_congrav_on 0.4
amx_congrav_off 1.0
You could also set amx_congrav_on to something like -0.8
to get the Effect of a JetPack. Have Fun!
Note: This will not work together with other Plugins
which change Users Gravity, like UWC3 Levitation.
Copy-Paste the Code and modify the specific
Plugins to avoid unwished Results.
Current Version: 3.0
Attached Files
File Type: sma Get Plugin or Get Source (congrav.sma - 1567 views - 2.4 KB)
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 09-15-2006 at 21:25.
Silencer123 is offline
ThomasNguyen
Senior Member
Join Date: May 2006
Old 09-06-2006 , 21:19   Re: Controll Gravity
Reply With Quote #2

So, like when you hold your jump button, your gravity will get lower and lower and raise you? and when i let go im guessing u fall at 800 gravity?
__________________
ThomasNguyen is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 09-06-2006 , 23:58   Re: Controll Gravity
Reply With Quote #3

do some simple math to change the cvars from floats on the 0-1 scale to the 0-800 HL scale.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 09-07-2006 , 00:59   Re: Controll Gravity
Reply With Quote #4

Also, is_user_connected isn't needed alongside is_user_alive, since is_user_alive already checks if they're ingame.
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 09-07-2006 , 01:26   Re: Controll Gravity
Reply With Quote #5

Code:
public client_PreThink(id) {     if(pev(id,pev_button)&IN_JUMP)     {         gravityon(id)     }     else     {         gravityoff(id)     } }
Inefficient^20

Code:
public client_PreThink(id) {     if( pev(id,pev_button) & IN_JUMP )     {         gravityon(id)     }     else if( pev(id,pev_oldbutton) & IN_JUMP )     {         gravityoff(id)     } }
Efficientererer
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 09-07-2006 , 01:42   Re: Controll Gravity
Reply With Quote #6

Quote:
Originally Posted by s p l i t View Post
Also, is_user_connected isn't needed alongside is_user_alive, since is_user_alive already checks if they're ingame.
no, i donnt think so.

is_user_alive(id) , if id not in game i got error in log
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 09-07-2006 , 01:44   Re: Controll Gravity
Reply With Quote #7

is_user_alive(id) does indeed check if they are connected as well.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Silencer123
Veteran Member
Join Date: Jul 2006
Location: Germany (GMT+1)
Old 09-07-2006 , 11:58   Re: Controll Gravity
Reply With Quote #8

Quote:
Originally Posted by GHW_Chronic View Post
do some simple math to change the cvars from floats on the 0-1 scale to the 0-800 HL scale.
I do not think that 0 to 800 is better than 0.0 to 1.0,
I mean, 0.0 to 1.0 is much easier to use.
and why should that other way be more efficient?
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-07-2006 , 12:07   Re: Controll Gravity
Reply With Quote #9

because a lot of people don't understand how set_user_gravity works. They don't know that 1.0 = 800 and so on.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 09-07-2006 , 15:14   Re: Controll Gravity
Reply With Quote #10

and the other way is more efficient because you are not setting a player's gravity every time they talk to the server.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Reply


Thread Tools
Display Modes

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:32.


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