AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting a user's aim (https://forums.alliedmods.net/showthread.php?t=77229)

allenwr 09-07-2008 22:39

Getting a user's aim
 
There have been tons of threads in scripting about user aim but from what i have seen they return a point on the map. I am trying to get the user's direction of where he is aiming so i can send an object in that direction. I just do not know if I need a velocity (which seems wrong to me) or how it should be done.

Basically I guess I am just trying to get instead of a start and end point, I am trying to get a start point and a direction.

Exolent[jNr] 09-07-2008 22:45

Re: Getting a user's aim
 
Code:
#include <fakemeta_util> #include <chr_engine> // ... // client = you // ent = entity being moved in direction new Float:client_origin[3], end_origin[3]; pev(client, pev_origin, client_origin); fm_get_aim_origin(client, end_origin); // change for speed of entity being moved in that direction new Float:speed = 1200.0; new Float:velocity[3]; get_speed_vector(client_origin, end_origin, speed, velocity); set_pev(ent, pev_velocity, velocity);

#include <chr_engine>

allenwr 09-07-2008 22:56

Re: Getting a user's aim
 
thank you, just need a small part of that for the get user aiming.


All times are GMT -4. The time now is 03:18.

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