Raised This Month: $ Target: $400
 0% 

FakeMeta Trace_Line help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-24-2007 , 20:58   Re: FakeMeta Trace_Line help
Reply With Quote #2

In fakemeta_const.inc, the first variable type after the EngFunc and DLLFunc commands is the return variable type, which is in this case "void". That tells you that EngFunc_TraceLine does not return anything at all.

What you need to do to get results from TraceLine is to hook FM_TraceLine. Use the parameters after the word "void" to get the parameters of the hook.

(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)

Those are the parameters that are sent, and thus hooked through FM_TraceLine. Use register_forward() to hook it.
Your function will look something like
public hook_traceline( Float:v1[3], Float:v2[3], nomonsters, id, ptr ) {

On a separate note, to actually accomplish anything with the traceline hook, use the TraceResult stuff inside fakemeta_const:


enum TraceResult
{
TR_AllSolid, // int
TR_StartSolid, // int
TR_InOpen, // int
TR_InWater, // int
TR_flFraction, // float
TR_vecEndPos, // float array[3]
TR_flPlaneDist, // float
TR_vecPlaneNormal, // float array[3]
TR_pHit, // int (edict_t*)
TR_iHitgroup, // int
};

Search the forums for any of those and you'll get some code examples.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
 



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


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