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.