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

GetEntPropEnt(), find a spy's sappers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-24-2013 , 04:13   GetEntPropEnt(), find a spy's sappers
Reply With Quote #1

EDIT: No idea why it didn't before, but the third code block seems to be working now. My question still stands though: is there a list of properties somewhere that I can access?


Quoting my original post:
Spoiler

Last edited by ddhoward; 04-24-2013 at 04:43.
ddhoward is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-24-2013 , 15:48   Re: GetEntPropEnt(), find a spy's sappers
Reply With Quote #2

Try m_hOwnerEntity instead of m_hBuilder.
bl4nk is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 04-24-2013 , 15:53   Re: GetEntPropEnt(), find a spy's sappers
Reply With Quote #3

m_hBuilder is there on built sappers. Perhaps try validating the entity and then checking the netprop, but on seperate lines, instead of trying to short-circuit it (which usually doesn't work and errors out, from my experience)

You can get a list of netprops of every netclass in the game (including TempEnts) by using sm_dump_netprops in server console. (e.g. sm_dump_netprops netprops.txt drops a list into orangebox/tf/netprops.txt) Same story with sm_dump_datamaps, which may have even more properties for the entity you're looking at, since it's per-entity instead of per-netclass.

Although, I don't think you need to be checking IsValidEntity if it pops up in FindEntityByClassname...hm.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 04-24-2013 at 15:54.
MasterOfTheXP is offline
Merbo
Member
Join Date: Jul 2012
Old 04-24-2013 , 18:18   Re: GetEntPropEnt(), find a spy's sappers
Reply With Quote #4

PHP Code:
new sapper = -1
while ((
sapper FindEntityByClassname(sapper"obj_attachment_sapper"))!=INVALID_ENT_REFERENCE) {
    if(
IsValidEntity(sapper) && GetEntPropEnt(sapperProp_Send"m_hBuider") == client) {
        
AcceptEntityInput(sapper"Kill");
    }

Code:
"m_hBuider"
m_hBuider
Buider
BWEEDER
A HANDLE TO A BREEDER?
Merbo is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-24-2013 , 19:36   Re: GetEntPropEnt(), find a spy's sappers
Reply With Quote #5

LOL fixed a typo without even realizing it. That's why my code didn't work before.

Thanks for all your help, doods.
ddhoward is offline
Reply


Thread Tools
Display Modes

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 10:50.


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