Interrogate map entities
How can I interrogate map entities, such as control points and their properties for a Team Fortress server?
I spent a long time investigating SourceMod because I discovered it had a function called FindEntityByClassname, which sounded ideal, but I can't make head or tail of its cryptic code. PHP Code:
|
Re: Interrogate map entities
FindEntityByClassname only gives you the entity index, and it is best suited to be iterated through.
Main link: http://docs.sourcemod.net/api/index....ad=show&id=43& as an example slightly modified from that page: Code:
new index = -1; You should really read through the entire 'entity' section here: http://docs.sourcemod.net/api/index.php But these are the more interesting functions for what you want. http://docs.sourcemod.net/api/index....ad=show&id=81& (*EntProp* functions can be used by themselves, and are a separate method than the following functions) http://docs.sourcemod.net/api/index....ad=show&id=80& http://docs.sourcemod.net/api/index....ad=show&id=79& http://docs.sourcemod.net/api/index....ad=show&id=78& http://docs.sourcemod.net/api/index....ad=show&id=68& You will also need to find the datamaps/netprops, which you can get yourself with the sm_dump_datamaps and sm_dump_netprops, or you may find one for the game mod you are using at the wiki http://wiki.alliedmods.net/Category:Game_Resources |
Re: Interrogate map entities
This isn't a question about SourceMod, I was merely searching its source code for some insight into a problem I have coding for MetaMod.
|
Re: Interrogate map entities
That portion of code from SourceMod makes use of an interface called BinTools that's provided by SourceMod: public/extensions/IBinTools.h which is probably not accessible through anything but a SourceMod extension. It makes a call to the actual function that valve uses in the game. :o
If I was making an MM:S plugin, I'd basically loop through all the entity indexes and check out their classname, then go from there. :wink: Their should be some code out there from other people's work. |
All times are GMT -4. The time now is 17:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.