Raised This Month: $ Target: $400
 0% 

(CS) Drawing Spray


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2013 , 01:36   Re: (CS) Drawing Spray
Reply With Quote #1

Because you take in account distance to wall ?

Look at fm_get_aim_origin and just add punchangle to v_angle and see if you got same results.


Following stock is fm_get_user_origin with less native calls, but using trace_line make it automatically use IGNORE_MONSTER if you pass an index (DONT_IGNORE_MONSTER when you pass -1 as index), so if you want to pass index + DONT_IGNORE_MONSTER you need to use engfunc(), but i don't think you care about players in what you are doing.

PHP Code:
get_aim_origin(idFloat:origin[3])
{
    new 
Float:dest[3];

    
entity_get_vector(idEV_VEC_v_angleorigin);
    
entity_get_vector(idEV_VEC_punchangledest);
    
xs_vec_add(origindestdest);

    
angle_vector(destANGLEVECTOR_FORWARDdest);
    
xs_vec_mul_scalar(dest9999.0dest); // you may adjust this according to weapon, as cs does
    
xs_vec_add(origindestdest);

    
entity_get_vector(idEV_VEC_originorigin);
    
origin[2] += entity_get_int(idEV_INT_flags) & FL_DUCKING 12.0 18.0;

    
trace_line(idorigindestorigin);

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-31-2013 at 01:55.
ConnorMcLeod is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 12-31-2013 , 05:10   Re: (CS) Drawing Spray
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
Because you take in account distance to wall ?
Distance from player to wall — 320 units (resolution 640x480, 640/2 = 320).

Thanks for stock. I use it (hope correct):
PHP Code:
public fw_TraceAttack(victimattackerFloat:damageFloat:direction[3], trdamage_type)
{
    new 
Float:rvec[3];
    
pev(attackerpev_v_anglervec);
    
get_aim_origin(attackerrvec);
    
client_print(0print_console"%f %f"rvec[1], rvec[2]);

And first shot got:
PHP Code:
5.581364 0.999273 
Strange why not 0 0, but with this code I got:

Think is not bad result.
Phant is offline
Send a message via ICQ to Phant
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2013 , 10:46   Re: (CS) Drawing Spray
Reply With Quote #3

get_aim_origin returns the origin where player is aiming at, i don't understand why you think it y and z axes would return 0, and why you don't print x origin, and also why you have let line "pev(attacker, pev_v_angle, rvec);"

May be you are confused with punchangle that is not the same thing, punchangle should be 0 on 1st shot, and punchangle is relative to player, not to world.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 10:07.


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