Raised This Month: $ Target: $400
 0% 

How to hook event raised in another plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redomin8
Member
Join Date: Feb 2005
Old 01-07-2009 , 00:06   How to hook event raised in another plugin
Reply With Quote #1

Is there any way to hook an event in another plugin? Say hooking zombieplague's buy_extra_item, that way we know everytime someone has bought something?
__________________
"Your momma's so dumb she required a cvar to turn the tv on." - Inspired by Speed!
redomin8 is offline
Send a message via AIM to redomin8
jim_yang
Veteran Member
Join Date: Aug 2006
Old 01-07-2009 , 00:28   Re: How to hook event raised in another plugin
Reply With Quote #2

edit that plugin, fire a forword using plugin api
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-07-2009 , 00:44   Re: How to hook event raised in another plugin
Reply With Quote #3

Quote:
Originally Posted by jim_yang View Post
edit that plugin, fire a forword using plugin api
Considering ZP has forwards for lots of things, it's probably already implemented.

EDIT: Yes, here it is:
PHP Code:
/* Called when a player buys an extra item from the ZP menu
*  player - will hold the id of the player who's buying
*  itemid - will contain the internal extra item ID */
forward zp_extra_item_selected(playeritemid
__________________

Community / No support through PM
danielkza is offline
redomin8
Member
Join Date: Feb 2005
Old 01-07-2009 , 01:06   Re: How to hook event raised in another plugin
Reply With Quote #4

Yes but unfortunately zp_extra_item_selected is only raised for any added custom items (all the default ones are handled internally)

i am making a plugin, and i didnt want every user that wants to try it to have to edit or replace their zombieplague amxxs as well
but thanks for your help guys, it looks like thats the only way
__________________
"Your momma's so dumb she required a cvar to turn the tv on." - Inspired by Speed!
redomin8 is offline
Send a message via AIM to redomin8
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-07-2009 , 01:08   Re: How to hook event raised in another plugin
Reply With Quote #5

Quote:
Originally Posted by redomin8 View Post
Yes but unfortunately zp_extra_item_selected is only raised for any added custom items (all the default ones are handled internally)

i am making a plugin, and i didnt want every user that wants to try it to have to edit or replace their zombieplague amxxs as well
but thanks for your help guys, it looks like thats the only way
The best way is to ask Mercylezz to add the extra forward for you, then tell possible users that they need the lastest version. I'm pretty sure he'll help you.
__________________

Community / No support through PM
danielkza 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 09:07.


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