Raised This Month: $ Target: $400
 0% 

Get Player Shot angle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-14-2013 , 07:36   Re: Get Player Shot angle
Reply With Quote #1

Explain exactly what you want to do because I think you are confused.
__________________
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 , 11:27   Re: Get Player Shot angle
Reply With Quote #2

Quote:
Originally Posted by hornet View Post
Explain exactly what you want to do because I think you are confused.
Ok, look (it's hard to explain because my English are bad):
Angles — 2 (two) Float values (47,55548, 18,33465). For example: pev_v_angle (player move mouse and v_angle changes).
I want: get angles of weapon shot (traceline) (by player eyes).
I mean (for example):
Player standing and aims (pev_v_angle) on 0, 0 angles (after spawn).

Player make shot and bullet hits upper and left about crosshair (about pev_v_angle) (m4a1 has very big recoil).

And now, if we change pev_v_angle of player on bullet hit coordinates, we got Angles of shot (what I need).
Phant is offline
Send a message via ICQ to Phant
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-16-2013 , 06:03   Re: Get Player Shot angle
Reply With Quote #3

As I already said pev_v_angle does not return 2 float values. It returns a vector.
Now enough of this XY problem, and explain what you need these angles for - what do you want the end result to be?

If your having too much trouble then have your request translated first.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 10-16-2013 at 06:04.
hornet is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 10-16-2013 , 08:55   Re: Get Player Shot angle
Reply With Quote #4

Quote:
Originally Posted by hornet View Post
As I already said pev_v_angle does not return 2 float values. It returns a vector.
Vector, ok. How I can get vector of weapon shot (traceline)?
Phant is offline
Send a message via ICQ to Phant
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 10-17-2013 , 11:54   Re: Get Player Shot angle
Reply With Quote #5

I use this code for visualization:
Code:
#include <amxmodx>
#include <fakemeta>

new m_spriteTexture 

public plugin_precache() 
{
    m_spriteTexture = precache_model("sprites/dot.spr") 
}

public plugin_init()
{
    register_plugin("Traceline Tutorial", "1.0", "Nomexous")    
    register_forward(FM_TraceLine, "traceline_forward")
}

public traceline_forward(Float:start[3], Float:end[3], conditions, id, trace)
{
    //client_print(0, print_chat, "cond: %i", conditions)
    //client_print(0, print_chat, "trace: %i", trace)
    if(trace == 1241064) {
        message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0}, id) 
        write_byte( TE_BEAMPOINTS ) 
        engfunc(EngFunc_WriteCoord, start[0])
        engfunc(EngFunc_WriteCoord, start[1])
        engfunc(EngFunc_WriteCoord, start[2])
        engfunc(EngFunc_WriteCoord, end[0])
        engfunc(EngFunc_WriteCoord, end[1])
        engfunc(EngFunc_WriteCoord, 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()
    }
}
And why I got this:

Not like that:

?
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