Raised This Month: $32 Target: $400
 8% 

trace_line() issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 01-03-2016 , 15:37   trace_line() issue
Reply With Quote #1

Hey guys. I'm trying to detect if there's some entity or wall between my entity (ent) and a player (id), and I'm having issues with trace_line native

PHP Code:
    new Float:vstart[3], Float:vend[3], Float:vret[3]
    
entity_get_vector(entEV_VEC_originvstart)
    
entity_get_vector(idEV_VEC_originvend)

    new 
hit trace_line(entvstartvendvret)
    new 
hitr traceresult(TR_Hit)
    new 
Float:fraction
    traceresult
(TR_Fractionfraction)

    
client_print(idprint_chat"trace_line ->  hit = %d  hitr = %d  fraction = %.1f"hithitrfraction
It always returns the same values, no matter if there is or isn't anything between ent and id
Code:
trace_line ->  hit = 0  hitr = -1  fraction = 0.0
I've tried the inverse trace, from the player (id) to the entity (ent) but keep getting the same results. What am I doing wrong?
__________________
Hey ^_^
NikKOo31 is offline
Reply


Thread Tools
Display Modes

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:58.


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