AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Trace hull ignoring entities (https://forums.alliedmods.net/showthread.php?t=163892)

ARES[ro] 08-04-2011 16:48

Trace hull ignoring entities
 
So im trying to do a trace_hull and return the id of hit only for this 1 player in my argument.
Cause what if theres 3 players in my hull range, and I want to only find the one who is in my argument.
With the trace_hull function
PHP Code:

trace_hull Float:origin[3], hull, [ ignoredent=0ignoremonsters=] ) 

I can only ignore 1 ent ...

Hunter-Digital 08-04-2011 17:11

Re: Trace hull ignoring entities
 
Set ignoremonsters to 1 and it will ignore players, as for multiple other entities... well, I dunno... you could try -1, maybe it will ignore all entities then if that's what you need.

ARES[ro] 08-04-2011 17:14

Re: Trace hull ignoring entities
 
Thanks for the help well yeah I thought about that, it would require a list of entities of some sort and it may just not be possible idk... If its not clear enough ill summarize it, trying to ignore all players except for 1 in a trace_hull.

ConnorMcLeod 08-04-2011 18:06

Re: Trace hull ignoring entities
 
trace_hull doesn't return any entity index.
If you want to know pHit you may have to use fakemeta.

Code:

static cell AMX_NATIVE_CALL trace_hull(AMX *amx,cell *params)
{
        int iResult=0;
        TraceResult tr;
        Vector vPos;
        cell *vCell;

        vCell = MF_GetAmxAddr(amx, params[1]);

        vPos.x = amx_ctof(vCell[0]);
        vPos.y = amx_ctof(vCell[1]);
        vPos.z = amx_ctof(vCell[2]);

        TRACE_HULL(vPos,vPos, params[4], params[2], params[3] > 0 ? INDEXENT2(params[3]) : 0 , &tr);

        if (tr.fStartSolid) {
                iResult += 1;
        }
        if (tr.fAllSolid) {
                iResult += 2;
        }
        if (!tr.fInOpen) {
                iResult += 4;
        }
        return iResult;
}


ARES[ro] 08-04-2011 18:45

Re: Trace hull ignoring entities
 
indeed I do thank you Connor I let that detail slide oops,
and then I re-ask the same question:
PHP Code:

EF_TraceHull ( const Float:V1[3], const Float:V2[3], fNoMonstershullNumber, const ENTITY_TO_SKIP 

How to skip more then 1 entity.

ConnorMcLeod 08-05-2011 04:21

Re: Trace hull ignoring entities
 
Could you please explain exactly what you want to do ?

ARES[ro] 08-05-2011 15:40

Re: Trace hull ignoring entities
 
Fix the shield when it comes to knife, so I decided to do a reverse hull trace from the shield to see if the stabber or slasher is in front hull. If it doesnt hit him, the stab was successful.


All times are GMT -4. The time now is 03:25.

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