AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Right way of gameevents (https://forums.alliedmods.net/showthread.php?t=291091)

gubka 12-01-2016 10:10

Right way of gameevents
 
Hellow, somebody can help me pls, do i use event hook in right way or i need add additional include to code? or it wrong method? I need it for CS:GO. Thanks a million

extension.cpp
Spoiler


events.hpp
Spoiler



or just use that method

extension.cpp
Spoiler


events.hpp
Spoiler


Which of those will better for CS:GO?

psychonic 12-02-2016 12:32

Re: Right way of gameevents
 
The simplest and most common method is to just make your plugin class, the ZombiePlague instance in this case, a listener. In the callback, check the event name and then do or call your logic for each that you want to handle.

Like this, https://github.com/psychonic/d2fixup...ixups.cpp#L290


All times are GMT -4. The time now is 18:24.

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