Raised This Month: $ Target: $400
 0% 

Let an entity move to the Left/Right


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 10-09-2006 , 09:16   Let an entity move to the Left/Right
Reply With Quote #1

How to let an entity move to the left/right according to it angles.

velocity_by_aim can only be used for forward and backwards.

Thanks,
Ramon.
__________________
Um, hi.
Ramono is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-09-2006 , 09:18   Re: Let an entity move to the Left/Right
Reply With Quote #2

here is something i use. not sure if it's the best way to do it.
Code:
						new Float:velocity[3]
						VelocityByAim(id, 20, velocity)
						beams = 2
						f_sorigin[0][0] = origin[id][0] + velocity[0]
						f_sorigin[0][1] = origin[id][1] - velocity[1]
						f_sorigin[0][2] = origin[id][2] + 12.0
						f_sorigin[1][0] = origin[id][0] + velocity[1]
						f_sorigin[1][1] = origin[id][1] - velocity[0]
						f_sorigin[1][2] = origin[id][2] + 12.0
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 10-09-2006, 10:23
Ramono
This message has been deleted by Ramono.
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 10-10-2006 , 06:22   Re: Let an entity move to the Left/Right
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
here is something i use. not sure if it's the best way to do it.
Code:
						new Float:velocity[3]
						VelocityByAim(id, 20, velocity)
						beams = 2
						f_sorigin[0][0] = origin[id][0] + velocity[0]
						f_sorigin[0][1] = origin[id][1] - velocity[1]
						f_sorigin[0][2] = origin[id][2] + 12.0
						f_sorigin[1][0] = origin[id][0] + velocity[1]
						f_sorigin[1][1] = origin[id][1] - velocity[0]
						f_sorigin[1][2] = origin[id][2] + 12.0
That code is not complete ?

Any one else?
__________________
Um, hi.
Ramono is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-10-2006 , 21:29   Re: Let an entity move to the Left/Right
Reply With Quote #4

ok... i took the time to make you two functions...
Code:
VelocityToLeft(id, speed, Float:velocity[3])
{
	new Float:aim_velocity[3]
	VelocityByAim(id, speed, aim_velocity)
	velocity[0] = aim_velocity[1]
	velocity[1] = aim_velocity[0]*-1
	velocity[2] = aim_velocity[2]
	return velocity
}
VelocityToRight(id, speed, Float:velocity[3])
{
	new Float:aim_velocity[3]
	VelocityByAim(id, speed, aim_velocity)
	velocity[0] = aim_velocity[1]*-1
	velocity[1] = aim_velocity[0]
	velocity[2] = aim_velocity[2]
	return velocity
}
edit: after revising it, here are my final results

Last edited by Emp`; 10-10-2006 at 22:23.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 10-11-2006, 02:05
Ramono
This message has been deleted by Ramono.
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 10-11-2006 , 10:25   Re: Let an entity move to the Left/Right
Reply With Quote #5

Thanks,

Edit: when u look up it goes very weird, it just goes up and not sidewards..
__________________
Um, hi.
Ramono is offline
Reply



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 04:53.


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