Raised This Month: $ Target: $400
 0% 

trace question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NTST
Junior Member
Join Date: Oct 2007
Old 10-14-2007 , 23:51   trace question
Reply With Quote #1

In CounterStrike, when the gun attack, what function will be call to make a trace line?
NTST is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-15-2007 , 00:30   Re: trace question
Reply With Quote #2

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

That, I believe.
__________________
Arkshine is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 10-15-2007 , 00:34   Re: trace question
Reply With Quote #3

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
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-15-2007 , 03:27   Re: trace question
Reply With Quote #4

[HowTo] Properly catch shot event in CS
__________________

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]
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-15-2007 , 03:30   Re: trace question
Reply With Quote #5

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
__________________
Arkshine is offline
NTST
Junior Member
Join Date: Oct 2007
Old 10-15-2007 , 08:20   Re: trace question
Reply With Quote #6

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.
NTST is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 10-16-2007 , 20:34   Re: trace question
Reply With Quote #7

you can set velocity over 2000 but its gonna go sideways
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Reply



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 01:12.


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