Raised This Month: $ Target: $400
 0% 

Make player fly?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-02-2011 , 11:54   Re: Make player fly?
Reply With Quote #4

Quote:
Originally Posted by Stereo View Post
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.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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 19:41.


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