Raised This Month: $ Target: $400
 0% 

get aim origin -> trace line


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
steve139
Senior Member
Join Date: May 2007
Location: here
Old 12-31-2008 , 06:19   get aim origin -> trace line
Reply With Quote #1

Hello,


I want to draw a line to player aim but,
I want to through wall so get_user_origin(player,origin[3],3) cant work ...

so I need a trace line certenly


(e.g. in this picture : http://www.ts-x.eu/files/line2.JPG )

but not exactly this position the as far away as possible ...


PHP Code:
public draw_line(id)
{
    
// get the origin of the player.
    
new Float:origin[3]
    
pev(idpev_originorigin)
    
    
// We want to trace down to the floor, if it's there.
    
new Float:traceto[3// how to get that :/ ?
    
fm_get_aimorigin(id,traceto// maybe with using that its can be extended
    
    
new trace 0
    
// Draw the traceline.
    
engfunc(EngFunc_TraceLineorigintracetoIGNORE_MONSTERSenttrace)
    
    new 
Float:fraction
    get_tr2
(traceTR_flFractionfraction)
   
    return 
ent;


}

stock fm_get_aimorigin(indexFloat:origin[3])
{
    new 
Float:start[3], Float:view_ofs[3];
    
pev(indexpev_originstart);
    
pev(indexpev_view_ofsview_ofs);
    
xs_vec_add(startview_ofsstart);
    
    new 
Float:dest[3];
    
pev(indexpev_v_angledest);
    
engfunc(EngFunc_MakeVectorsdest);
    
global_get(glb_v_forwarddest);
    
xs_vec_mul_scalar(dest9999.0dest);
    
xs_vec_add(startdestdest);
    
    
engfunc(EngFunc_TraceLinestartdest0index0);
    
get_tr2(0TR_vecEndPosorigin);
    
    return 
1;

in reallity, I need to get each players(or 3-4) through the walls
so something like

PHP Code:
for(new 1get_maxplayers(); i++) { // or while(etc etc)
    
new target draw_line(id
    
user_silentkill(target)
    
// well not really good way to do but I need to get the trace line correctly

can you help me please ?

Last edited by steve139; 12-31-2008 at 09:33. Reason: fix typo
steve139 is offline
 



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 09:04.


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