Raised This Month: $51 Target: $400
 12% 

[HowTo] Properly catch shot event in CS


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-14-2012 , 04:27   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #41

Quote:
"events/elite_left.sc",
"events/elite_right.sc",
The answer is already in the first post.
__________________
Arkshine is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 03-14-2012 , 06:49   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #42

So i should create two var to get_orig_retval ?
__________________

Hatsune Miku~
tei1995 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-14-2012 , 06:52   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #43

Like in the example, use a sum of bits.
__________________
Arkshine is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 03-14-2012 , 19:20   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #44

Can you give me an example code?i cant imagine your idea...
__________________

Hatsune Miku~
tei1995 is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 03-23-2012 , 11:36   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #45

search the tutorials for bitsums and bitwise operators.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 03-31-2012 , 09:48   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #46

I dont understand your idea about using bitsum.explain more for me plz?
__________________

Hatsune Miku~
tei1995 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-31-2012 , 10:26  
Reply With Quote #47

Quote:
Originally Posted by tei1995 View Post
I dont understand your idea about using bitsum.explain more for me plz?
There is a ginormous tutorial on it.... Search don't be lazy
Doc-Holiday is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 04-04-2012 , 07:35   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #48

I searched,read, but i until understand...
__________________

Hatsune Miku~
tei1995 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-09-2012 , 09:14   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #49

Code can be shortened a bit :

PHP Code:
#include <amxmodx>
#include <fakemeta>

new g_iMaxPlayers;
#define IsPlayer(%0)    ( 1 <= (%0) <= g_iMaxPlayers )

new g_iGunsEventsIdBitSum;

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);

    new const 
szGunsEvents[][] = {
        
"events/awp.sc""events/g3sg1.sc""events/ak47.sc""events/scout.sc""events/m249.sc",
        
"events/m4a1.sc""events/sg552.sc""events/aug.sc""events/sg550.sc""events/m3.sc",
        
"events/xm1014.sc""events/usp.sc""events/mac10.sc""events/ump45.sc""events/fiveseven.sc",
        
"events/p90.sc""events/deagle.sc""events/p228.sc""events/glock18.sc""events/mp5n.sc",
        
"events/tmp.sc""events/elite_left.sc""events/elite_right.sc""events/galil.sc""events/famas.sc"
    
};
    for(new 
ii<sizeof(szGunsEvents); i++)
    {
        
g_iGunsEventsIdBitSum |= 1<<engfunc(EngFunc_PrecacheEvent1szGunsEvents[i]);
    }

    
register_forward(FM_PlaybackEvent"OnPlaybackEvent");

    
g_iMaxPlayers get_maxplayers();
}

public 
OnPlaybackEvent(flagsideventid)
{
    if( 
IsPlayer(id) && g_iGunsEventsIdBitSum & (1<<eventid) )
    {
        
// gun fired

        
return FMRES_HANDLED;
    }
    return 
FMRES_IGNORED;

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-28-2013 at 03:35.
ConnorMcLeod is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-17-2012 , 03:58   Re: [HowTo] Properly catch shot event in CS
Reply With Quote #50

So how does this method compare as oppose to using Ham or Orpheu?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 02:06.


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