Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Code that pushes the player in the direction he is aiming.
#1
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
Would like to make a donation? Click here
Reply

#2
04:35 ?


YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

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

Would like to make a donation? Click here
Reply

#4
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
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#5
(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
Would like to make a donation? Click here
Reply

#6
[Image: ctoc.jpg]
Reply

#7
Would like to make a donation? Click here
Reply

#8
Nope, u get pushed, cause of 3arc exactly like for AZU : )
[Image: ctoc.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Sentry Gun kill = Player kill Snake 8 5,864 11-07-2013, 13:41
Last Post: Nekochan
  Help Code color crosshairs koren30 3 4,016 10-02-2013, 19:26
Last Post: koren30
  Player can write Fl0w_.JACKDAN 2 3,349 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  Help need help?how to make plugins code hXnarutoXone 12 8,549 09-01-2013, 18:30
Last Post: Bandarigoda123
  Help Need Help with C# code tubwux 2 3,313 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 4,133 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 9,683 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 5,639 07-28-2013, 01:52
Last Post: First_Semyon
  [CoD 4] Trying to set a player -- DidUknowiPwn 7 5,849 07-03-2013, 21:58
Last Post: Pozzuh
  [Release] Black Ops Single Player/Zombie Trainer V3.6 Craig87 52 88,583 07-01-2013, 15:12
Last Post: explosivebanana55

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.