AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   disable gravity for player (make him hover fly/float) (https://forums.alliedmods.net/showthread.php?t=88432)

SonicSonedit 03-24-2009 15:50

disable gravity for player (make him hover fly/float)
 
how can I disable gravity for a certain player? Like sv_gravity 0?
set_pev(id, pev_gravity, 0.0) does nothing.

DarkGod 03-24-2009 15:52

Re: disable graviry for player
 
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?

SonicSonedit 03-24-2009 15:54

Re: disable graviry for player
 
float in air, not be able to jump.
i'll use set_pev(id, pev_velocity, velocity) to move player around.

ot_207 03-24-2009 16:01

Re: disable graviry for player
 
PHP Code:

set_pev(id,pev_movetype,MOVETYPE_FLY


SonicSonedit 03-24-2009 16:11

Re: disable gravity for player (make him float)
 
PHP Code:

set_pev(id,pev_movetype,MOVETYPE_FLY


no effect.

Exolent[jNr] 03-24-2009 16:14

Re: disable gravity for player (make him float)
 
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);

SonicSonedit 03-24-2009 16:23

Re: disable gravity for player (make him float)
 
1 Attachment(s)
1st post:
Quote:

set_pev(id, pev_gravity, 0.0) does nothing.
here is my rest plugin

Exolent[jNr] 03-24-2009 16:41

Re: disable gravity for player (make him float)
 
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);     } }

SonicSonedit 03-24-2009 16:56

Re: disable gravity for player (make him float)
 
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?

Exolent[jNr] 03-24-2009 17:09

Re: disable gravity for player (make him float)
 
Quote:

Originally Posted by SonicSonedit (Post 788277)
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 (Post 788277)
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.


All times are GMT -4. The time now is 09:02.

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