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

[DEV] Event Info v1.0.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Plugin ID:
2807
Plugin Version:
1.0.2
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Hooks events dynamically from .res files
    Old 02-16-2012 , 11:40   [DEV] Event Info v1.0.2
    Reply With Quote #1

    [DEV] Event Info
    Version: 1.0.1

    Hello again everyone. Today I bring all of you a handy dandy plugin which dynamically hooks all possible game events.

    This plugin is very large once compiled, due to the very large arrays that it creates. To reduce size of the plugin, change MAX_EVENTS to something smaller, I know that L4D2 in total has about 300 events, but most games don't have that many. You can reduce this to about 200 or less for most games.

    These commands are used to begin printing event info to chat:
    These commands need the generic admin flag to be used!

    "sm_listen <event>" "Start or stop listening to an event"
    Ex: sm_listen player_hurt
    The above example starts listening to player_hurt
    ^This command works as a toggle.

    "sm_keylisten <event> [keyname]" "Start or stop listening to an event"
    Ex: sm_keylisten player_hurt
    The above example starts listening to player_hurt and all of its keys
    Ex2: sm_keylisten player_hurt userid
    The above example starts listening to player_hurt and only its userid key.
    ^This command works as a toggle on an individual key level and at an event level.

    "sm_listentoall" "Start listening to all events"
    ^This is not a toggle, use sm_stoplisten to stop listening to all events.

    "sm_keylistentoall"
    "Start listening to all events and their keys"
    ^This is not a toggle, use sm_stoplisten to stop listening to all events and keys.

    "sm_stoplisten"
    "Stop listening to all events and keys"

    "sm_listevents" "List all hooked events"

    "sm_listkeys <event>" "List all keys for an event"
    Ex: sm_listkeys player_hurt

    "sm_searchevents <searchstring>" "Search for events"
    Ex: sm_searchevents player
    ^This example will find all events that contain "player" and print them to you.

    History:
    1.0.0 - Initial Release
    1.0.1 - Fixed console not properly being supported
    1.0.2 - modevents.res is last to be parsed, events already hooked matching events in modevents.res will be unhooked and rehooked with keys in modevents.res
    Attached Files
    File Type: sp Get Plugin or Get Source (dev_eventinfo.sp - 1845 views - 14.8 KB)
    __________________

    Last edited by McFlurry; 06-20-2013 at 00:59.
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 03-10-2012 , 13:18   Re: [DEV] Event Info
    Reply With Quote #2

    Nice dev tool, i like it.
    Two things i noticed when using it: it does not support the server console itself, but does funky stuff or errors out:
    Code:
    sm_listevents
    ♦[EI]☺ Listing events
    ♦[EI]☺ "intro_finish"
    ♦[EI]☺ "intro_nextcamera"
    ♦[EI]☺ "player_changeclass"
    ♦[EI]☺ "player_death"
    ♦[EI]☺ "object_removed"
    ♦[EI]☺ "object_destroyed"
    ♦[EI]☺ "tf_map_time_remaining"
    ♦[EI]☺ "tf_game_over"
    ♦[EI]☺ "ctf_flag_captured"
    Code:
    sm_listentoall
    ♦[EI]☺ Started listening to all events
    tv_enable 1
    maxplayers set to 25 (extra slot was added for SourceTV)
    L 03/10/2012 - 19:14:47: [SM] Native "PrintToChat" reported: Client index 0 is invalid
    L 03/10/2012 - 19:14:47: [SM] Displaying call stack trace for plugin "dev_eventinfo.smx":
    L 03/10/2012 - 19:14:47: [SM]   [0]  Line 497, /home/groups/alliedmodders/forums/files/7/2/3/6/5/99421.attach::PrintEventNameToListeners()
    L 03/10/2012 - 19:14:47: [SM]   [1]  Line 362, /home/groups/alliedmodders/forums/files/7/2/3/6/5/99421.attach::Event_Callback()
    __________________
    einmal mit profis arbeiten. einmal.
    Thrawn2 is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 03-10-2012 , 13:53   Re: [DEV] Event Info
    Reply With Quote #3

    very nice - thank you for putting this out for all to use and benefit from
    __________________
    View my Plugins | Donate
    TnTSCS is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 03-10-2012 , 14:09   Re: [DEV] Event Info
    Reply With Quote #4

    A nice alternative to net_showevents; good job.
    __________________
    thetwistedpanda is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 03-10-2012 , 17:32   Re: [DEV] Event Info
    Reply With Quote #5

    Version 1.0.1 released, fixed console trying to listen to events giving errors.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    341464
    Senior Member
    Join Date: Dec 2010
    Location: GetClientEyePosition
    Old 03-11-2012 , 06:49   Re: [DEV] Event Info
    Reply With Quote #6

    Uhm, can't compile
    __________________
    341464 is offline
    Send a message via Skype™ to 341464
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 03-11-2012 , 11:45   Re: [DEV] Event Info
    Reply With Quote #7

    we need your highly guarded mcflurry include file
    __________________
    View my Plugins | Donate
    TnTSCS is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 03-11-2012 , 14:10   Re: [DEV] Event Info
    Reply With Quote #8

    Quote:
    Originally Posted by TnTSCS View Post
    we need your highly guarded mcflurry include file
    ^
    It's secret!
    minimoney1 is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 03-11-2012 , 16:04   Re: [DEV] Event Info
    Reply With Quote #9

    Fixed that, I don't know why I had it included as there was nothing I was using from it.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    Peace-Maker
    SourceMod Plugin Approver
    Join Date: Aug 2008
    Location: Germany
    Old 03-26-2012 , 16:24   Re: [DEV] Event Info v1.0.1
    Reply With Quote #10

    That looks neat! Often mods override default game events like player_death in their modevents.res. You should parse that file as the last one and replace events with the same name instead of adding the event twice. Remember to not hook the event again, if you found it already present in your list! I did forget to do that here ;)
    __________________
    Peace-Maker is offline
    Reply


    Thread Tools
    Display Modes

    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 08:29.


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