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

dead body owner and position


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Just Some Dude
Junior Member
Join Date: Mar 2009
Old 04-01-2009 , 15:30   dead body owner and position
Reply With Quote #1

Is is possible to find out what players dead body is on the floor?
Just Some Dude is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-02-2009 , 10:45   Re: dead body owner and position
Reply With Quote #2

check m_hOwner / m_hOwnerEntity offsets
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 04-02-2009 , 11:56   Re: dead body owner and position
Reply With Quote #3

m_hOwnerEntity returned -1 for me. This works as long as the players dont respawn (even then you could save the results on player death):

Code:
GetRagdollOwner(entity) {     new offset = FindSendPropInfo("CCSPlayer","m_hRagdoll")     for(new i = 1; i <= MaxClients; i++) {         if(IsClientInGame(i) && !IsPlayerAlive(i) && GetEntDataEnt2(i,offset) == entity) {             return i         }     }     return -1 }

EDIT: IGNOREME, see 3 posts below
__________________
plop

Last edited by p3tsin; 04-02-2009 at 18:11.
p3tsin is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 04-02-2009 , 15:48   Re: dead body owner and position
Reply With Quote #4

Wouldn't you want to find the offset of the owner on the prop_ragdoll or whatever entity class that is the corpse actually is.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 04-02-2009 , 18:09   Re: dead body owner and position
Reply With Quote #5

Quote:
Originally Posted by paegus View Post
Wouldn't you want to find the offset of the owner on the prop_ragdoll or whatever entity class that is the corpse actually is.
Uhh, yeah

I didnt even look at the other ragdoll props, and now that I did, I saw m_hPlayer which does exactly what you want.

Code:
new client = GetEntPropEnt(entity,Prop_Send,"m_hPlayer")
__________________
plop
p3tsin is offline
Kigen
BANNED
Join Date: Feb 2008
Old 04-02-2009 , 19:48   Re: dead body owner and position
Reply With Quote #6

fyi ragdolls aren't networked past their creation to my knowledge. (i.e., no position updates, etc)
Kigen is offline
Just Some Dude
Junior Member
Join Date: Mar 2009
Old 04-02-2009 , 21:06   Re: dead body owner and position
Reply With Quote #7

So if they are not networked; you can not walk up to and look at a dead player and have info about who it was, printed to chat or console...correct?
Just Some Dude is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 04-02-2009 , 22:18   Re: dead body owner and position
Reply With Quote #8

No you can, the owner of the ragdoll is stored in it's entity info. Kigen is saying that information isn't updated after it's been created.
__________________
Greyscale is offline
Just Some Dude
Junior Member
Join Date: Mar 2009
Old 04-03-2009 , 00:54   Re: dead body owner and position
Reply With Quote #9

Thanks for the responses

How about if I wanted to find the entities position to do a distance calculation; how do I get the ragdolls entity index?
Just Some Dude is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 04-03-2009 , 03:46   Re: dead body owner and position
Reply With Quote #10

find the classname of the entity that is spawned as a ragdoll. phys_ragdoll or something.. then scroll though them with FindEntityByClassName(eTarget, "prop_ragdoll"), when you find one whose owner is your target then you can get the m_vecOrigin(?) properties.

but depending on the mod, usually any updates to the corpse are handled client side... which is why screenshots of a given scene are sometimes different. my view of the corpse is over here. yours will be over there. somie mods (like hidden-source) maintain position data for them since they contribute to game-play. so your data will report the position the entity was spawned at.

for that matter what would GetClientAimTarget() reply with for non-updated entities?
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus 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 14:37.


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