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 = AnglesToForward( self getPlayerAngles() ); self setOrigin(self.origin+(0,0,5)); self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[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 = AnglesToForward( self getPlayerAngles() ); self setOrigin(self.origin+(0,0,5)); self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[2]*1000)); wait 0.01; self setVelocity((forward[0]*1000, forward[1]*1000, forward[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
it would be much easier(i thin) with that code u posted above:

Code:
doJump() { self endon("disconnect"); for( ; ; ) { if(self AttackButtonPressed() && Distance2D(self.origin,self getAim()) <= 1000) //could be each other button too... { self setOrigin(self getAim()); wait 1; } wait 0.01; } } getAim() { forward = self getTagOrigin("tag_eye"); end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return (Crosshair[0], Crosshair[1], self.origin[2]); } vector_scal(vec, scale) { vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale); return vec; }
[Image: ctoc.jpg]
Reply

#7
(09-21-2011, 13:04)Tomsen1410 Wrote: it would be much easier(i thin) with that code u posted above:

Code:
doJump() { self endon("disconnect"); for( ; ; ) { if(self AttackButtonPressed() && Distance2D(self.origin,self getAim()) <= 1000) //could be each other button too... { self setOrigin(self getAim()); wait 1; } wait 0.01; } } getAim() { forward = self getTagOrigin("tag_eye"); end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return (Crosshair[0], Crosshair[1], self.origin[2]); } vector_scal(vec, scale) { vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale); return vec; }
But with this code, I think the player gets teleported to the location and not pushed?
Azu code works fine with a small edit(remove the z push). The only drawback is that you get odd recoil while being pushed if you are still walking at the time you get pushed.
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 8,251 11-07-2013, 13:41
Last Post: Nekochan
  Help Code color crosshairs koren30 3 5,265 10-02-2013, 19:26
Last Post: koren30
  Player can write Fl0w_.JACKDAN 2 5,136 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  Help need help?how to make plugins code hXnarutoXone 12 11,729 09-01-2013, 18:30
Last Post: Bandarigoda123
  Help Need Help with C# code tubwux 2 4,331 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 5,821 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 12,772 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 7,657 07-28-2013, 01:52
Last Post: First_Semyon
  [CoD 4] Trying to set a player -- DidUknowiPwn 7 8,291 07-03-2013, 21:58
Last Post: Pozzuh
  [Release] Black Ops Single Player/Zombie Trainer V3.6 Craig87 52 101,661 07-01-2013, 15:12
Last Post: explosivebanana55

Forum Jump:


Users browsing this thread:
1 Guest(s)

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