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

Hooking sentry upgrade?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Quaz and Wally
Junior Member
Join Date: Sep 2009
Old 09-17-2009 , 13:30   Hooking sentry upgrade?
Reply With Quote #1

Hi all, I'm very very new to sourcemod, but I'm trying to learn. I'm trying to make a mod that allows a max level sum of sentries per team, (Like, a max sum of 4, so only two level 2 sentries, a level 3 and a level 1, or four level 1s, etc...)

I think I could manage something if I can just figure out how to detect when the sentry gets hit, or when it's upgrade progress changes, or something.

I found this post, which is really close, and hooks when the sentry's health changes (such as when it's upgraded), but by then it's too late.
http://forums.alliedmods.net/showpos...09&postcount=6

It doesn't look like there's an event for when a sentry is whacked, but I'm thinking maybe I'm just missing something. If somebody knows how to do this with DukeHacks I could try that too, but I'm trying to manage without extensions.

Edit: I'm playing with the idea of having a timer that checks the upgrade progress of the sentry, but I don't know what this property is called, so I can access it from the sentry's entity. I'm also playing with the idea of catching when it's health changes as described above, and then just forcing the sentry to instantly degrade, but that is really the last resort for me.

Edit: I think I found the upgrade progress property ("m_iUpgradeMetal" I still need to test), so I think I could at least manage that timer idea, the only problem being if engineers get clever and simultaneously upgrade their sentry guns. Not to mention I don't know if this will lag out the server, if it's constantly counting getting all the sentry entities and adding up their levels. Is there a way to hook when this property changes, like how you can hook when the object's health changes?

Edit: You know what, just forget about it.

Last edited by Quaz and Wally; 09-19-2009 at 18:40.
Quaz and Wally 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 05:14.


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