Raised This Month: $ Target: $400
 0% 

Get Player Shot angle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 05-17-2013 , 18:47   Get Player Shot angle
Reply With Quote #1

Hello. I can get player view angle (the result will be two numbers):
Code:
pev(id, pev_v_angle, v_angle)
Can I get player shot angle like that?
I think vector_to_angle() function can be useful.

http://s22.************/bko135gwx/de_nuke0045.jpg

Thanks for advice & sorry for my bad English.
Phant is offline
Send a message via ICQ to Phant
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 05-17-2013 , 18:49   Re: Get Player Shot angle
Reply With Quote #2

you mean the rotation of the player model?
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 05-17-2013 , 19:05   Re: Get Player Shot angle
Reply With Quote #3

Quote:
Originally Posted by pokemonmaster View Post
you mean the rotation of the player model?
No. I mean angle of "bullet shot" (TraceLine) by Player.
Another screenshot example:
http://3.firepic.org/3/images/2013-0...r15qzg8x5l.jpg
Phant is offline
Send a message via ICQ to Phant
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-17-2013 , 21:09   Re: Get Player Shot angle
Reply With Quote #4

Its strange that you guys always show things in picture with 2d( 2 coords numbers.)
This is 3D game so obvious there is more than just 2 float values. ( x, y, z )
.Dare Devil. is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 05-18-2013 , 08:03   Re: Get Player Shot angle
Reply With Quote #5

Quote:
Originally Posted by .Dare Devil. View Post
Its strange that you guys always show things in picture with 2d( 2 coords numbers.)
This is 3D game so obvious there is more than just 2 float values. ( x, y, z )
But, angle is two numbers, like pev_v_angle or pev_punchangle. Or like BSP Viewer, try Edit / Copy Camera Angles, you got two float numbers.
I want get angle of each weapon shot TraceLine (from player eyes position). I think this is correct and possible, but how ?

Last edited by Phant; 05-18-2013 at 08:06.
Phant is offline
Send a message via ICQ to Phant
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-18-2013 , 11:19   Re: Get Player Shot angle
Reply With Quote #6

Quote:
Originally Posted by Phant View Post
But, angle is two numbers, like pev_v_angle or pev_punchangle. Or like BSP Viewer, try Edit / Copy Camera Angles, you got two float numbers.
I want get angle of each weapon shot TraceLine (from player eyes position). I think this is correct and possible, but how ?
What are you trying do?
And also no, it's pitch, yaw, and roll for angles.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-18-2013 , 16:27   Re: Get Player Shot angle
Reply With Quote #7

You should do this :
PHP Code:
{
    new 
Float:aim_vec[3];
    
pev(idpev_v_angleaim_vec);
    
engfunc(EngFunc_MakeVectorsaim_vec);
    
global_get(glb_v_forwardaim_vec);

You can trick it doing that (same thing is done internally to amxx):
PHP Code:
{
    new 
Float:aim_vec[3];
    
velocity_by_aim(id1aim_vec);

And if it is for traceline, to velocity_by_aim(id, 9999, aim_vec); so you can use player gun origin for trace start, and add aim_vec to start to set end position.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-18-2013 at 16:28.
ConnorMcLeod is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 10-14-2013 , 06:08   Re: Get Player Shot angle
Reply With Quote #8

I want get player shot angle (traceline?), not aim/pevs, etc.
I try use (for visualisation):
Code:
register_forward(FM_TraceLine, "traceline_forward")
With:
Code:
public traceline_forward(Float:start[3], Float:end[3], conditions, id, trace)
{
    if(trace != 1241012)
    {
        client_print(0, print_chat, "%f %f %f / %f %f %f", start[0], start[1], start[2], end[0], end[1], end[2])
        new Float:k_origin[3]
        get_user_origin(id,k_origin) 
        message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0}, id) 
        write_byte( TE_BEAMPOINTS ) 
        write_coord(k_origin[0]) 
        write_coord(k_origin[1]) 
        write_coord(k_origin[2]) 
        write_coord(end[0]) 
        write_coord(end[1]) 
        write_coord(end[2]) 
        write_short( m_spriteTexture ) 
        write_byte( 1 ) // framestart 
        write_byte( 1 ) // framerate 
        write_byte( 100 ) // life in 0.1's 
        write_byte( 5 ) // width 
        write_byte( 0 )  // noise 
        write_byte( 0 )   // r, g, b 
        write_byte( 0 )   // r, g, b 
        write_byte( 255 )   // r, g, b 
        write_byte( 255 )   // brightness 
        write_byte( 0 )    // speed 
        message_end() 
    }
}
But it's wrong:
Phant is offline
Send a message via ICQ to Phant
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-14-2013 , 06:25   Re: Get Player Shot angle
Reply With Quote #9

Because FM_TraceLine gives you Float vectors not integer vectors. write_coord() is for integer vectors. You need to use EngFunc_WriteCoord .
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 10-14-2013 , 06:41   Re: Get Player Shot angle
Reply With Quote #10

Quote:
Originally Posted by hornet View Post
Because FM_TraceLine gives you Float vectors not integer vectors. write_coord() is for integer vectors. You need to use EngFunc_WriteCoord .
Thanks, its works now.

Back to topic. Who can help with getting weapon shot angle (2 Float values)?
Phant is offline
Send a message via ICQ to Phant
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 16:18.


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