AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   dead body owner and position (https://forums.alliedmods.net/showthread.php?t=89054)

Just Some Dude 04-01-2009 15:30

dead body owner and position
 
Is is possible to find out what players dead body is on the floor?

SAMURAI16 04-02-2009 10:45

Re: dead body owner and position
 
check m_hOwner / m_hOwnerEntity offsets

p3tsin 04-02-2009 11:56

Re: dead body owner and position
 
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 :)

paegus 04-02-2009 15:48

Re: dead body owner and position
 
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.

p3tsin 04-02-2009 18:09

Re: dead body owner and position
 
Quote:

Originally Posted by paegus (Post 795638)
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 :stupid:

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")

Kigen 04-02-2009 19:48

Re: dead body owner and position
 
fyi ragdolls aren't networked past their creation to my knowledge. (i.e., no position updates, etc)

Just Some Dude 04-02-2009 21:06

Re: dead body owner and position
 
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?

Greyscale 04-02-2009 22:18

Re: dead body owner and position
 
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.

Just Some Dude 04-03-2009 00:54

Re: dead body owner and position
 
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?

paegus 04-03-2009 03:46

Re: dead body owner and position
 
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?


All times are GMT -4. The time now is 21:48.

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