Raised This Month: $ Target: $400
 0% 

Set origin entity to ground


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RayZek95
Junior Member
Join Date: Sep 2013
Old 01-10-2023 , 20:42   Set origin entity to ground
Reply With Quote #1

Hi everyone, there's a way to set the origin of an entity to ground?

I tried this way of metalicross:
PHP Code:
stock GetUserEyePosition(iIdFloat:vecReturn[3], Float:fNormalDist// mia gordo mia :3
{
    static 
Float:vecStart[3], Float:vecEnd[3]
    
entity_get_vector(iIdEV_VEC_originvecStart)
    
entity_get_vector(iIdEV_VEC_view_ofsvecEnd)
    
    
xs_vec_add(vecStartvecEndvecEnd// vista de los ojos
    
    
entity_get_vector(iIdEV_VEC_v_anglevecEnd)
    
engfunc(EngFunc_MakeVectorsvecEnd)
    
get_global_vector(GL_v_forwardvecEnd)
    
xs_vec_mul_scalar(vecEnd9999.9vecEnd)
    
    
xs_vec_add(vecStartvecEndvecEnd// vista a la mierda de los ojos
    
    
engfunc(EngFunc_TraceLinevecStartvecEndDONT_IGNORE_MONSTERSiId0)
    
    
get_tr2(0TR_vecPlaneNormalvecEnd)
    
xs_vec_mul_scalar(vecEndfNormalDistvecEnd// distancia de la normal de la superficie
    
    
get_tr2(0TR_vecEndPosvecReturn)
    
xs_vec_add(vecReturnvecEndvecReturn)

Works, but I want to restrict that for only aiming the ground; and in the case that is aiming the ground always set the origin in Z coordenate = 0 (in other words, "set to ground")
__________________
RayZek95 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 20:03.


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