Raised This Month: $ Target: $400
 0% 

How to get the coordinate of gunpoint


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akn
Junior Member
Join Date: Aug 2009
Old 08-19-2009 , 07:10   How to get the coordinate of gunpoint
Reply With Quote #1

need the coordinate of gunpoint in first person view, as the picture
i know TE_BEAMENTPOINT is able to draw a line from that coordinate, but how to get the coordinate float value?
Attached Thumbnails
Click image for larger version

Name:	0000.jpg
Views:	1195
Size:	75.2 KB
ID:	47821  
akn is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 08-19-2009 , 09:09   Re: How to get the coordinate of gunpoint
Reply With Quote #2

Aww, I got all excited but then noticed this was for cs1.6
__________________
plop
p3tsin is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-19-2009 , 12:25   Re: How to get the coordinate of gunpoint
Reply With Quote #3

Moved to the AMXX forums.
bl4nk is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-19-2009 , 13:52   Re: How to get the coordinate of gunpoint
Reply With Quote #4

If you need the origin of an attachment, try EngFunc_GetAttachment.

new Float:Origin[3], Float:Angles[3];
engfunc( EngFunc_GetAttachment, Id, Attachment, Origin, Angles );
__________________

Last edited by Arkshine; 08-19-2009 at 13:54.
Arkshine is offline
akn
Junior Member
Join Date: Aug 2009
Old 08-19-2009 , 22:45   Re: How to get the coordinate of gunpoint
Reply With Quote #5

thanks a lot,
i will try it tonight
akn is offline
akn
Junior Member
Join Date: Aug 2009
Old 08-20-2009 , 08:03   Re: How to get the coordinate of gunpoint
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
If you need the origin of an attachment, try EngFunc_GetAttachment.

new Float:Origin[3], Float:Angles[3];
engfunc( EngFunc_GetAttachment, Id, Attachment, Origin, Angles );

I tried with below code, and cs crashed, did I use error attachmentID or anything else I did wrong?

//amxx 1.8.1 all needed inc included

new wid=fm_get_user_weapon_entity(playerID)
//playerID is 1, i am the only one in server
//wid is returned, such as 240, 241, etc

new Float:Origin[3], Float:Angles[3];

engfunc( EngFunc_GetAttachment, wid, attachmentID, Origin, Angles);
//crash at this line
//I try attachmentID with 0, 1, 2, all same result
akn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2009 , 08:40   Re: How to get the coordinate of gunpoint
Reply With Quote #7

Id should be the player's index and not the weapon index. ( I believe )
__________________

Last edited by Arkshine; 08-20-2009 at 09:04.
Arkshine is offline
akn
Junior Member
Join Date: Aug 2009
Old 08-20-2009 , 09:15   Re: How to get the coordinate of gunpoint
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
Id should be the player's index and not the weapon index. ( I believe )
thanks.
I try with playerID, value =1, it is works, but that is not the coordinate of gunpoint, as the picture below, left one is player's attachment point, right one is first person view weapon's attachment point
Attached Thumbnails
Click image for larger version

Name:	0001.JPG
Views:	726
Size:	45.7 KB
ID:	47935  
akn is offline
Old 08-20-2009, 23:07
Bad_Bud
This message has been deleted by Bad_Bud. Reason: Ooops.
akn
Junior Member
Join Date: Aug 2009
Old 08-21-2009 , 04:40   Re: How to get the coordinate of gunpoint
Reply With Quote #9

I'll be appreciate if anyone could help
akn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 04:53   Re: How to get the coordinate of gunpoint
Reply With Quote #10

It seems it's only for player/monster. When you look at the HLSDK ( single player ) it uses mainly for monster.

By the way, what do you want to do exactly ? If you want to to trace a line from the weapon attachment, you have to use for example, if attachment is 1 : id | 0x1000


EDIT : Example, I remember creating the Shock Rifle weapon ( like in OP4 ) and to show lightning between each part to the center ( see the model below ), I'm using ( it uses TE_BEAMENTS ):

Code:
FX_BeamEnt( id | 0x2000, id | 0x1000, gBeam, 1, 8, 50, 200, 6, 0, 10, { 200, 200, 255 } ); FX_BeamEnt( id | 0x3000, id | 0x1000, gBeam, 1, 8, 50, 200, 6, 0, 10, { 200, 200, 255 } ); FX_BeamEnt( id | 0x4000, id | 0x1000, gBeam, 1, 8, 50, 200, 6, 0, 10, { 200, 200, 255 } );

[IMG]http://img504.**************/img504/4727/shockj.jpg[/IMG]
__________________

Last edited by Arkshine; 08-21-2009 at 05:00.
Arkshine 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 01:35.


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