Raised This Month: $ Target: $400
 0% 

[Solved for now]Player in duct (?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 06-29-2014 , 12:57   Re: Player in duct (?
Reply With Quote #9

These are my 2 options .-.

PHP Code:
stock bool:player_in_duct(id)
{
    new 
Float:origin[3]
    
pev(idpev_originorigin)
    
origin[2] += 10.0

    engfunc
(EngFunc_TraceHulloriginoriginIGNORE_MONSTERSpev(idpev_flags) & FL_DUCKING HULL_HEAD HULL_HUMANid)

    new 
Float:fFraction
    get_tr2
(0TR_flFractionfFraction)

    if (!
get_tr2(0TR_AllSolid) && fFraction 1.0)
        return 
true

    
return false

PHP Code:
stock bool:player_in_duct2(id)
{
        const 
IN_SOLID_AREA    = (1<<TR_StartSolid)
    new 
Float:origin[3]
    
pev(idpev_originorigin)
    
origin[2] += 10.0

    
if(!(trace_hull(originpev(idpev_flags) & FL_DUCKING HULL_HEAD HULL_HUMANid) & IN_SOLID_AREA)) 
        return 
true

    
return false

I'm not sure of trace_hull, I've never used it. I stole some Connor's code

Will be testing later

Last edited by NikKOo31; 06-29-2014 at 18:28.
NikKOo31 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 21:15.


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