AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   trace question (https://forums.alliedmods.net/showthread.php?t=61961)

NTST 10-14-2007 23:51

trace question
 
In CounterStrike, when the gun attack, what function will be call to make a trace line?

Arkshine 10-15-2007 00:30

Re: trace question
 
Code:
register_forward( FM_TraceLine, "fwTraceline" ); // [...] public fwTraceline( Float:start[3], Float:end[3], noMonsters, id, trace ); { }

That, I believe.

kp_uparrow 10-15-2007 00:34

Re: trace question
 
it makes a trace no matter you are firing or not

use get_user_button(id)&IN_ATTACK if u want to filter it out

Wilson [29th ID] 10-15-2007 03:27

Re: trace question
 
[HowTo] Properly catch shot event in CS

Arkshine 10-15-2007 03:30

Re: trace question
 
A little more complete.

Code:
    #include <amxmodx>     #include <fakemeta>         #define MAX_CLIENTS 32         new         g_iNormal_trace[ MAX_CLIENTS + 1 ],         g_iMaxClients;         public plugin_init()     {         register_forward( FM_TraceLine, "fwTraceline", 1 );         g_iMaxClients = global_get( glb_maxClients );     }         public client_connect( id )     {         g_iNormal_trace[id] = 0;     }     public client_disconnect( id )     {         g_iNormal_trace[id] = 0;     }       public fwTraceline( Float:start[3], Float:end[3], noMonsters, id, trace )     {         if( !( 1 <= id <= g_iMaxClients ) )             return FMRES_IGNORED;         if( !g_iNormal_trace[id] )         {             g_iNormal_trace[id] = trace;             return FMRES_IGNORED;         }         else if( trace == g_iNormal_trace[id] || !is_user_alive( id ) )             return FMRES_IGNORED;                 if( !pev( id, pev_button ) & IN_ATTACK ) )             return FMRES_IGNORED;                     // stuff                 return FMRES_IGNORED;     }


Also, you can look at this another method : http://forums.alliedmods.net/showthread.php?t=54887

NTST 10-15-2007 08:20

Re: trace question
 
Thanks for answers, but I need a function that have a bullet entity variable.
Or how to set high velocity(>2000) for a entity vector to point a to point b.

kp_uparrow 10-16-2007 20:34

Re: trace question
 
you can set velocity over 2000 but its gonna go sideways


All times are GMT -4. The time now is 01:12.

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