ItsMods

Full Version: Code that pushes the player in the direction he is aiming.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone make a code that pushes the player in the direction he is aiming?
The player should not get pushed in the air but only the x and y axis.

This stuff might help:
setvelocity(x velocity, y velocity , z velocity)
getvelocity()

Code from 4funplaying:
Code:
getAim()
{
    forward = self getTagOrigin("tag_eye");
    end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
    Crosshair = BulletTrace( forward, end, true, self )[ "position" ];
    return Crosshair;
}
vector_scal(vec, scale)
{
    vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    return vec;
}
You'd probably also have to do some vector math and such but that's the part of math I am the worst at so I know nothing about that.

Good luck to anyone who's going to try! Smile
04:35 ?


(09-18-2011, 22:01)AZUMIKKEL Wrote: [ -> ]04:35 ?
Yea like that, but without the height. Smile

PHP Code:
        case 28:    // NINJA
            // self thread Weapon("creek_knife_sp");
            // self thread Instruct("^2[^7[{+attack}]^2] ^7to jump!");
            
self setperk("specialty_bulletpenetration");
            
self setperk("specialty_bulletflinch");
            
self setperk("specialty_bulletdamage");
            
self setperk("specialty_bulletaccuracy");
            
self setperk("specialty_fastads");
            
self setperk("specialty_fallheight");
            for(;;)
            {
                while(!
self attackButtonPressed())
                    
wait 0.05;
                
forward AnglesToForwardself getPlayerAngles() );
                
self setOrigin(self.origin+(0,0,5));
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                while(!
self isOnGround())
                {
                    
wait 0.1;
                }
            } 

VOTE 4 AZU
(09-18-2011, 22:24)AZUMIKKEL Wrote: [ -> ]
PHP Code:
        case 28:    // NINJA
            // self thread Weapon("creek_knife_sp");
            // self thread Instruct("^2[^7[{+attack}]^2] ^7to jump!");
            
self setperk("specialty_bulletpenetration");
            
self setperk("specialty_bulletflinch");
            
self setperk("specialty_bulletdamage");
            
self setperk("specialty_bulletaccuracy");
            
self setperk("specialty_fastads");
            
self setperk("specialty_fallheight");
            for(;;)
            {
                while(!
self attackButtonPressed())
                    
wait 0.05;
                
forward AnglesToForwardself getPlayerAngles() );
                
self setOrigin(self.origin+(0,0,5));
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                
wait 0.01;
                
self setVelocity((forward[0]*1000forward[1]*1000forward[2]*1000));
                while(!
self isOnGround())
                {
                    
wait 0.1;
                }
            } 

VOTE 4 AZU
Thanks!
You certainly got my vote now! Smile
Nope, u get pushed, cause of 3arc exactly like for AZU : )