Raised This Month: $ Target: $400
 0% 

disable gravity for player (make him hover fly/float)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 03-24-2009 , 15:50   disable gravity for player (make him hover fly/float)
Reply With Quote #1

how can I disable gravity for a certain player? Like sv_gravity 0?
set_pev(id, pev_gravity, 0.0) does nothing.
__________________


Last edited by SonicSonedit; 03-27-2009 at 16:22.
SonicSonedit is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-24-2009 , 15:52   Re: disable graviry for player
Reply With Quote #2

Disable gravity? Do you mean that he should be able to float in air, not be able to jump at all or have default gravity?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 03-24-2009 , 15:54   Re: disable graviry for player
Reply With Quote #3

float in air, not be able to jump.
i'll use set_pev(id, pev_velocity, velocity) to move player around.
__________________

SonicSonedit is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-24-2009 , 16:01   Re: disable graviry for player
Reply With Quote #4

PHP Code:
set_pev(id,pev_movetype,MOVETYPE_FLY
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 03-24-2009 , 16:11   Re: disable gravity for player (make him float)
Reply With Quote #5

PHP Code:
set_pev(id,pev_movetype,MOVETYPE_FLY

no effect.
__________________

SonicSonedit is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-24-2009 , 16:14   Re: disable gravity for player (make him float)
Reply With Quote #6

Code:
set_pev(client, pev_gravity, 0.0); // 1.0 is default // For custom gravity, use X / 800.0 (X being your gravity value) // Example // I want 200 gravity. 200 / 800 = 0.25 set_pev(client, pev_gravity, 0.25);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 03-24-2009 , 16:23   Re: disable gravity for player (make him float)
Reply With Quote #7

1st post:
Quote:
set_pev(id, pev_gravity, 0.0) does nothing.
here is my rest plugin
Attached Files
File Type: sma Get Plugin or Get Source (zp_magician.sma - 623 views - 1.5 KB)
__________________


Last edited by SonicSonedit; 03-24-2009 at 16:39.
SonicSonedit is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-24-2009 , 16:41   Re: disable gravity for player (make him float)
Reply With Quote #8

Try this:
Code:
public plugin_init() {     register_forward(FM_AddToFullPack, "FwdAddToFullPack", 1); } public FwdAddToFullPack(es, e, ent, host, hostflags, player, pSet) {     if( !player ) return;         static Float:current_origin[3];     pev(ent, pev_origin, current_origin);         engfunc(EngFunc_DropToFloor, ent);         static Float:new_origin[3];     pev(ent, pev_origin, new_origin);         new_origin[2] += 30.0; // height above ground         set_pev(ent, pev_origin, current_origin);         if( new_origin[2] > current_origin[2] )     {         set_es(es, ES_Origin, new_origin);     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 03-25-2009 at 16:20.
Exolent[jNr] is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 03-24-2009 , 16:56   Re: disable gravity for player (make him float)
Reply With Quote #9

am i doing it right?
Quote:
FwdAddToFullPack(0,0,0,0,0,id,0)
btw, isn't it simply makes entity walk/ride higher? like func_vehicle?
__________________

SonicSonedit is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-24-2009 , 17:09   Re: disable gravity for player (make him float)
Reply With Quote #10

Quote:
Originally Posted by SonicSonedit View Post
am i doing it right?
No.

"ent" is the player that you wan't to make float.
"host" is the player that is having "ent" modified in his/her game.
"player" is a check to show that "ent" and "host" are both players. It's like doing fm_is_ent_classname(ent, "player") && fm_is_ent_classname(host, "player").

Quote:
Originally Posted by SonicSonedit View Post
btw, isn't it simply makes entity walk/ride higher? like func_vehicle?
All that code does is make the player appear to be floating.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 09:02.


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