Raised This Month: $ Target: $400
 0% 

Hook Sentry Gun Related Events?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SamuraiBarbi
Senior Member
Join Date: Aug 2006
Location: United States
Old 08-12-2007 , 22:10   Hook Sentry Gun Related Events?
Reply With Quote #1

Can I get away with doing something like

register_event("Sentry_Built_Level_1", "sentry_built", "be")
register_event("Sentry_Upgrade_Level_2", "sentry_lvltwo", "be")
register_event("Sentry_Upgrade_Level_3", "sentry_lvlthree", "be")

to hook events related to sentry guns?
SamuraiBarbi is offline
Send a message via AIM to SamuraiBarbi Send a message via MSN to SamuraiBarbi Send a message via Yahoo to SamuraiBarbi
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 08-14-2007 , 17:56   Re: Hook Sentry Gun Related Events?
Reply With Quote #2

Afaik its not possible.
But you can use an Soundhook to get these events.

Here an Example(untested):
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "Administrator" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_forward(FM_EmitSound, "fw_EmitSound")   } public fw_EmitSound(id, channel, sample[]) {     if(!strcmp(sample,"weapons/turrset.wav") && pev_valid(id) && id > 32)     {         new classname[32]         pev(id,pev_classname,classname,31)         if (!strcmp(classname,"building_dispenser"))             client_print(0,print_chat,"Dispencer Builded")         else if (!strcmp(classname,"building_sentrygun"))         {             new sentry_level = get_pdata_int(id,37,3)//offset 37 hold sentry level(+3 for linux offset)             if (sentry_level == 1)                 client_print(0,print_chat,"Sentrygun Builded")             else if (sentry_level == 2)                 client_print(0,print_chat,"Sentrygun Upgraded to Level2")             else if (sentry_level == 3)                 client_print(0,print_chat,"Sentrygun Upgraded to Level3")         }         else if (!strcmp(classname,"building_teleporter"))         {             new teleporter_type = get_pdata_int(id,427) //offset 427 hold the type of teleporter(entrance=4,exit=5)             if (teleporter_type == 4)                 client_print(0,print_chat,"Entrance Teleporter builded")             else client_print(0,print_chat,"Exit Teleporter builded")         }     }     return FMRES_IGNORED }
__________________

Last edited by schnitzelmaker; 08-14-2007 at 18:00.
schnitzelmaker 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 19:37.


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