Raised This Month: $ Target: $400
 0% 

How to get the coordinate of gunpoint


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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
akn
Junior Member
Join Date: Aug 2009
Old 08-21-2009 , 06:20   Re: How to get the coordinate of gunpoint
Reply With Quote #2

Quote:
Originally Posted by Arkshine View Post
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
thanks,

I was trying to create a trace a line from the weapon attachment point, I know that TE_BEAMENTS and TE_BEAMPOINTS is able to draw a line from the attachment point, but there is a problem that while the player is moving ( or using pistol ), the line is moving with the attachment point, so I want to draw a line from the the attachment point coordinate, using TE_USERTRACER.

now the question is how could i get the first-person-view weapon attachment point cooridinate?
and what is "id | 0x1000" means, the weapon entity id, or the attachment point id?
akn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 06:23   Re: How to get the coordinate of gunpoint
Reply With Quote #3

Id is the player's index who is holding the weapon.
__________________
Arkshine is offline
akn
Junior Member
Join Date: Aug 2009
Old 08-21-2009 , 07:49   Re: How to get the coordinate of gunpoint
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Id is the player's index who is holding the weapon.
the question is what "id | 0x1000" means, i know id is the players id
thx
akn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 08:08   Re: How to get the coordinate of gunpoint
Reply With Quote #5

I means that the point will be attached on the attachment 1.
In my example, id | 0x2000, id | 0x1000, means that there will be a beam between the weapon attachment 2 to attachment 1.
__________________
Arkshine is offline
akn
Junior Member
Join Date: Aug 2009
Old 08-21-2009 , 08:30   Re: How to get the coordinate of gunpoint
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
I means that the point will be attached on the attachment 1.
In my example, id | 0x2000, id | 0x1000, means that there will be a beam between the weapon attachment 2 to attachment 1.
i know that, the format "id | 0x2000" is work for TE_BEAMENTS and TE_BEAMENTPOINT, how format work for EngFunc_GetAttachment? I failed
akn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 08:36   Re: How to get the coordinate of gunpoint
Reply With Quote #7

Again, EngFunc_GetAttachment seems to work only for player/monster.

To do what you want, you need to get the gun position ( pev_origin + pev_view_ofs ), and adjusting if necessary, I think.
__________________

Last edited by Arkshine; 08-21-2009 at 08:40.
Arkshine is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 08-21-2009 , 10:04   Re: How to get the coordinate of gunpoint
Reply With Quote #8

Try a tracemodel from a point in front of the weapon back to the weapon.
__________________
joaquimandrade is offline
akn
Junior Member
Join Date: Aug 2009
Old 08-22-2009 , 03:08   Re: How to get the coordinate of gunpoint
Reply With Quote #9

peve player ID pev_view_ofs always return 0,0,17, not the offset of gun point.

pev playerID pev_viewmodel2 return models/v_ak47.mdl
pev playerID pev_weaponmodel2 return models/p_ak47.mdl

is there any way I could get viewmodel is attachment position?
akn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-22-2009 , 03:43   Re: How to get the coordinate of gunpoint
Reply With Quote #10

If you want to throw a tracer like this does this plugin, it should be enough to retrieve the gun position. All the weapons in HL or CS use the gun position as source origin.
__________________
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 15:06.


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