View Single Post
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