Raised This Month: $ Target: $400
 0% 

User aiming?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-02-2008 , 13:15   Re: User aiming?
Reply With Quote #2

Use this stock:
PHP Code:
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;

And do like this:
PHP Code:
if((engfunc(EngFunc_PointContentsfAimOrigin) != CONTENTS_SKY) && (engfunc(EngFunc_PointContentsfAimOrigin) != CONTENTS_SOLID))
    {
        static 
iEnt;
        
iEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
        
        if(!
iEnt)
            return 
0;
        
        
engfunc(EngFunc_SetOriginiEntfAimOrigin);
        
        static 
Float:fMaxs[3] = { 16.016.038.0 };
        static 
Float:fMins[3] = { -16.0, -16.0, -38.0 };
        
        
engfunc(EngFunc_SetModeliEnt"models/model.mdl");
        
set_pev(iEnt,pev_classname"classname");
        
        
dllfunc(DLLFunc_SpawniEnt);
        
set_pev(iEntpev_solidSOLID_BBOX);
        
engfunc(EngFunc_SetSizeiEntfMinsfMaxs);
        
    } 
__________________

anakin_cstrike 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 03:04.


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