AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   move player to side by aim (https://forums.alliedmods.net/showthread.php?t=58409)

kp_uparrow 07-25-2007 13:12

move player to side by aim
 
you know this:
VelocityByAim(id , 300 , fAim); //speed

with this i can set the player's velocity towards where their looking, but i what do i need to change/have so the players velocity is toward the left by aim instead of in front?

VEN 07-26-2007 12:13

Re: move player to side by aim
 
Try this:
Code:
stock fm_left_velocity(index, multiplier, Float:velocity[3]) {         new Float:vec[3]         pev(index, pev_v_angle, vec)         engfunc(EngFunc_MakeVectors, vec)         global_get(glb_v_right, vec)         velocity[0] = -vec[0] * multiplier         velocity[1] = -vec[1] * multiplier         velocity[2] = -vec[2] * multiplier         return 1 }

kp_uparrow 07-26-2007 14:10

Re: move player to side by aim
 
i dont under stand that and why does it return a 1?

can you give me an example? move the person at the speed of 300 to the left

X-Script 07-26-2007 14:46

Re: move player to side by aim
 
Thats what I was asking why do you have a return right there? theres no need for it.

There should be PLUGIN_HANDLED

VEN 07-27-2007 12:03

Re: move player to side by aim
 
Quote:

why does it return a 1?
Return and/or return result doesn't actually matter here. fm_left_velocity() is a modified fm_velocity_by_aim() which is a direct port of velocity_by_aim() which does have return 1.

Quote:

can you give me an example? move the person at the speed of 300 to the left
Code:
new Float:vec[3] fm_left_velocity(id, 300, vec) set_pev(id, pev_velocity, vec)

Quote:

There should be PLUGIN_HANDLED
No.

X-Script 07-27-2007 12:15

Re: move player to side by aim
 
Ah I see okay, when I saw that return in there I didn't know what the hell was going on.

kp_uparrow 07-27-2007 14:30

Re: move player to side by aim
 
is there a fm_right_velocity(id, 300, vec)?

ill try this

kp_uparrow 07-27-2007 14:31

Re: move player to side by aim
 
um.... this fm_left_velocity acctually move the player to the right instead of left!

kp_uparrow 07-27-2007 17:57

Re: move player to side by aim
 
ok i got it, put the speed to a negitive

VEN 07-29-2007 07:34

Re: move player to side by aim
 
Quote:

um.... this fm_left_velocity acctually move the player to the right instead of left!
Not really (tested it).


All times are GMT -4. The time now is 21:27.

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