AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make player fly? (https://forums.alliedmods.net/showthread.php?t=168664)

mix97mix 10-02-2011 10:31

Make player fly?
 
if(PlayerClassCT[id] == 2)
{
set_user_health(id, 1500)
give_item(id, "weapon_knife")
cs_set_user_model(id, "av_dragon")
set_user_gravity(id, 0.80)
set_user_rendering(id)
}

what should i add soo player can fly ?
video *LINK* : http://img837.**************/img837/4755/lwt.mp4

Evaldas.Grigas 10-02-2011 11:22

Re: Make player fly?
 
Try this:
PHP Code:

set_user_gravity(id0.00


Erox902 10-02-2011 11:51

Re: Make player fly?
 
set_user_gravity() doesn't really make him fly just jump higher or lower.
You'll have to set his movetype to FL_FLY in post or prethink, I think...
And that will probably cause some really high cpu usage :/

Stereo 10-02-2011 11:51

Re: Make player fly?
 
PHP Code:

#include <amxmodx> 
#include <engine> 

#define PLUGIN "Fly" 
#define VERSION "1.0" 
#define AUTHOR "Stereo" 

public plugin_init() 
    
register_plugin(PLUGINVERSIONAUTHOR

public 
client_PreThink(id)  

    if( 
is_user_alive(id) ) 
    { 
        new 
Float:fAim[3]
        
VelocityByAim(id 250 fAim)
        
        if( !(
get_user_button(id) & IN_JUMP) ) 
            
set_user_velocity(idfAim)
    } 
    return 
PLUGIN_CONTINUE



nikhilgupta345 10-02-2011 11:54

Re: Make player fly?
 
Quote:

Originally Posted by Stereo (Post 1567128)
PHP Code:

#include <amxmodx>
#include <engine>


#define PLUGIN "Fly"
#define VERSION "1.0"
#define AUTHOR "Stereo"


public plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR)

public 
client_PreThink(id
{
    if( 
is_user_alive(id) )
    {
        new 
Float:fAim[3] , Float:fVelocity[3];
        
VelocityByAim(id 250 fAim);
        
        if(!(
get_user_button(id) & IN_JUMP))
        {
            
fVelocity[0] = fAim[0];
            
fVelocity[1] = fAim[1];
            
fVelocity[2] = fAim[2];
            
            
set_user_velocity(id fVelocity);
        }
    }
    return 
PLUGIN_CONTINUE;



Why do you create another variable fVelocity, if you are just copying fAim into it later? You don't need it.

Also, the float should be declared as static instead of new.

Erox902 10-02-2011 12:07

Re: Make player fly?
 
Just thought of another thing...
Since this is for an experience mod you'd probably want to make this a comand only avaivable for that class.
Cuz' you can't shoot straight when you're in the air and with this method you can accually never stop moving completly,
and no matter what weapon you'll always have 250 as maxspeed.

Evaldas.Grigas 10-02-2011 15:20

Re: Make player fly?
 
Mhm search amxx parachute plugin and make it landing gravity 0. Tested and works great. You can fly.

Doc-Holiday 10-02-2011 19:26

Re: Make player fly?
 
give the play noclip lol....

Erox902 10-03-2011 02:32

Re: Make player fly?
 
Quote:

Originally Posted by Doc-Holiday (Post 1567375)
give the play noclip lol....

Noclip and flying is not the same :?


All times are GMT -4. The time now is 19:41.

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