Raised This Month: $51 Target: $400
 12% 

"est_GetViewCoord" in sourcemod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raydan
Senior Member
Join Date: Aug 2006
Old 12-15-2007 , 06:02   "est_GetViewCoord" in sourcemod
Reply With Quote #1

how to do find out the value same as "est_GetViewCoord"?

http://www.eventscripts.com/pages/Est_GetViewCoord
"Returns the coordinates of the point the player is looking at "

i try using these code but not work (idea from vhelpers.cpp)
Code:
GetClientEyeAngles(param1,eye_xyz);
    GetClientEyePosition(param1,e_xyz);
    GetClientAbsOrigin(param1,p_xyz);
    GetAngleVectors(eye_xyz,c_xyz,NULL_VECTOR,NULL_VECTOR);
    NormalizeVector(c_xyz,c_xyz);
    ScaleVector(c_xyz,100.0);
    AddVectors(e_xyz,c_xyz,w_xyz);
PrintToServer("%f %f %f",w_xyz[0],w_xyz[1],w_xyz[2]);
 
//Create a entity at w_xyz

Last edited by raydan; 12-15-2007 at 06:09.
raydan is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 12-15-2007 , 06:20   Re: "est_GetViewCoord" in sourcemod
Reply With Quote #2

This sounds like a traceline after from the eye position (if it is possible to retreive that as a plugin) in the direction of the eye vector.
__________________
hello, i am pm
PM is offline
KMFrog
Senior Member
Join Date: Oct 2007
Old 12-15-2007 , 15:56   Re: "est_GetViewCoord" in sourcemod
Reply With Quote #3

Code:
 native bool:GetClientEyeAngles(client, Float:ang[3]);
client Player's index.
ang Destination vector to store the client's eye angles.
Code:
native GetClientEyePosition(client, Float:pos[3]);
client Player's index.
pos Destination vector to store the client's eye position.
__________________
Was I helpful or not? Rate Me!
KMFrog is offline
raydan
Senior Member
Join Date: Aug 2006
Old 12-16-2007 , 00:20   Re: "est_GetViewCoord" in sourcemod
Reply With Quote #4

Quote:
Originally Posted by KMFrog View Post
Code:
 native bool:GetClientEyeAngles(client, Float:ang[3]);
client Player's index.
ang Destination vector to store the client's eye angles.
Code:
native GetClientEyePosition(client, Float:pos[3]);
client Player's index.
pos Destination vector to store the client's eye position.
did you try these before?

the result same as "est_GetViewCoord"?

i am not kid, i tried all all GetClientEye* function
raydan is offline
raydan
Senior Member
Join Date: Aug 2006
Old 12-16-2007 , 02:00   Re: "est_GetViewCoord" in sourcemod
Reply With Quote #5

deleted

Last edited by raydan; 02-14-2008 at 06:34.
raydan is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 12-16-2007 , 04:55   Re: "est_GetViewCoord" in sourcemod
Reply With Quote #6

Hm that code looks good.
If you can look on the floor somewhere far away but not immediately under you, I could imagine that when you look down the tracing ray hits your player's hitbox. You might want to try using the filtered TR_TraceRayFilterEx and take out the player's own entity in the filter function.

I may be wrong though =)
__________________
hello, i am pm
PM 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 19:16.


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